summaryrefslogtreecommitdiffstats
path: root/src/resources/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/map.h')
-rw-r--r--src/resources/map.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/resources/map.h b/src/resources/map.h
index 2f4a60e..116300d 100644
--- a/src/resources/map.h
+++ b/src/resources/map.h
@@ -3,8 +3,16 @@
#include <SDL_stdinc.h>
#include "resource.h"
+#include "palette.h"
#include "image.h"
+enum map_palette_id {
+ MAP_PALETTE_MORN = 0,
+ MAP_PALETTE_DAY,
+ MAP_PALETTE_EVE,
+ MAP_PALETTE_NIGHT,
+ MAP_PALETTES_MAX
+};
enum map_layer {
MAP_LAYER_GROUND = 0,
MAP_LAYER_OBJ_LOW,
@@ -14,6 +22,10 @@ enum map_layer {
MAP_LAYER_WEATHER,
MAP_LAYERS_MAX
};
+struct map_palette {
+ struct palette *palette;
+ Uint16 min;
+};
struct tileset {
struct resource res;
char *dirname;
@@ -79,13 +91,12 @@ struct map_spawn {
struct map {
struct resource res;
char *dirname;
- /* TODO: map_get() should take a name, not a path.
- char *name;
- */
+ /* TODO: Consider making these Uint16s. */
int width;
int height;
int tilewidth;
int tileheight;
+ struct map_palette palettes[MAP_PALETTES_MAX];
struct map_tileset *tilesets_head;
struct map_tileset *tilesets_tail;
struct layer layers[MAP_LAYERS_MAX];
@@ -98,6 +109,7 @@ struct map {
struct map *map_get(const char *path);
void map_free(struct map *map);
void map_add_tileset(struct map *m, struct tileset *t, Uint32 firstgid);
+struct map_palette *map_get_palette(struct map *m, const char *name);
struct layer *map_get_layer(struct map *m, const char *name);
void map_add_exit(struct map *m, struct map_exit *e);