summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-05-11 15:34:37 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-05-11 15:34:37 +0200
commit2f493c24e3771bca9b9ee717cb3d7c18c406678f (patch)
tree9613b0ee6e1adf495e1171b399d818b7111565de /include
parent2f9e8a6033075f68bbed46a66d22712a84b8f678 (diff)
map work
Diffstat (limited to 'include')
-rw-r--r--include/asset_defs.h1
-rw-r--r--include/map.h10
-rw-r--r--include/objects.h28
3 files changed, 31 insertions, 8 deletions
diff --git a/include/asset_defs.h b/include/asset_defs.h
index fc770cb..fa04472 100644
--- a/include/asset_defs.h
+++ b/include/asset_defs.h
@@ -44,6 +44,7 @@ image* img_metal_wall;
image* img_metal_wall2;
image* img_chair_up;
image* img_zombie_spawner;
+image* img_lamp_east;
// Throwables
image* img_grenade;
diff --git a/include/map.h b/include/map.h
index 3980c8a..8b57d84 100644
--- a/include/map.h
+++ b/include/map.h
@@ -51,6 +51,16 @@ typedef struct t_map_data { // Data written to disk.
light_emitter light_emitters[MAX_LIGHT_EMITTERS];
} map_data;
+/* used for migerations.
+typedef struct t_map_data2 { // Data written to disk.
+ int width;
+ int height;
+ int heightmap[MAP_SIZE_Y][MAP_SIZE_X];
+ tile_type tiles[MAP_SIZE_Y][MAP_SIZE_X];
+ object2 objects[MAX_OBJECTS];
+ light_emitter light_emitters[MAX_LIGHT_EMITTERS];
+} map_data2;*/
+
typedef struct t_light_data {
float tl;
float tr;
diff --git a/include/objects.h b/include/objects.h
index da1459e..6369224 100644
--- a/include/objects.h
+++ b/include/objects.h
@@ -29,6 +29,7 @@ typedef enum t_object_type {
OBJECT_CHAIR_UP = 6,
OBJECT_SPACE_WINDOW_H = 7,
OBJECT_ZOMBIE_SPAWNER = 8, // Substitute.
+ OBJECT_LAMP_EAST = 9,
OBJECT_END,
} object_type;
@@ -38,8 +39,18 @@ typedef struct t_object {
vec3f position;
vec3f size;
object_type type;
+ bool collision;
} object;
+/*
+typedef struct t_object2 {
+ bool active;
+ vec3f position;
+ vec3f size;
+ object_type type;
+ bool collision;
+} object2;*/
+
typedef struct t_box {
vec2f tl_d;
vec2f tr_d;
@@ -54,14 +65,15 @@ typedef struct t_box {
// @NEWOBJECT
object object_dict[OBJECT_END] = {
- {0,(vec3f){0, 0, 0},{1,3,0.5f},OBJECT_SPACE_CONTROL_PANEL},
- {0,(vec3f){0, 0, 0},{1,1,1},OBJECT_SPACE_WINDOW},
- {0,(vec3f){0, 0, 0},{1,1,1},OBJECT_METAL_WALL},
- {0,(vec3f){0, 0, 0},{1,1,1},OBJECT_METAL_WALL2},
- {0,(vec3f){0, 0, 0},{3,1,0.5f},OBJECT_SPACE_CONTROL_PANEL2},
- {0,(vec3f){0, 0, 0},{1,1,0.5f},OBJECT_CHAIR_UP},
- {0,(vec3f){0, 0, 0},{1,1,1},OBJECT_SPACE_WINDOW_H},
- {0,(vec3f){0, 0, 0},{1,1,0.5},OBJECT_ZOMBIE_SPAWNER},
+ {0,(vec3f){0, 0, 0},{1,3,0.5f},OBJECT_SPACE_CONTROL_PANEL, 1},
+ {0,(vec3f){0, 0, 0},{1,1,1},OBJECT_SPACE_WINDOW, 1},
+ {0,(vec3f){0, 0, 0},{1,1,1},OBJECT_METAL_WALL, 1},
+ {0,(vec3f){0, 0, 0},{1,1,1},OBJECT_METAL_WALL2, 1},
+ {0,(vec3f){0, 0, 0},{3,1,0.5f},OBJECT_SPACE_CONTROL_PANEL2, 1},
+ {0,(vec3f){0, 0, 0},{1,1,0.5f},OBJECT_CHAIR_UP, 1},
+ {0,(vec3f){0, 0, 0},{1,1,1},OBJECT_SPACE_WINDOW_H, 1},
+ {0,(vec3f){0, 0, 0},{1,1,0.5},OBJECT_ZOMBIE_SPAWNER, 1},
+ {0,(vec3f){0, 0, 0},{1,1,0},OBJECT_LAMP_EAST, 0},
};
object get_object_at_tile(float x, float y);