summaryrefslogtreecommitdiff
path: root/src/tilemap.h
diff options
context:
space:
mode:
authorzlago2024-09-27 18:34:24 +0200
committerzlago2024-09-27 18:34:24 +0200
commite304b0a4acc3f0870f55e6b584c464096333dfdc (patch)
tree9c985b966d758020e0aa0efdd8cbdb69ec716412 /src/tilemap.h
parentd3dc2389c308278442831f370950b2d25e5fa734 (diff)
tilemap collision
the 'middle ground' layer is the only layer which is solid, and the boundary between the background and the foreground additionally, the maps now can have a custom sky color
Diffstat (limited to 'src/tilemap.h')
-rw-r--r--src/tilemap.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/tilemap.h b/src/tilemap.h
index 587bdf6..912b67f 100644
--- a/src/tilemap.h
+++ b/src/tilemap.h
@@ -4,17 +4,24 @@
extern struct tilemap {
void *tileset;
void *wang_tileset;
+ struct {
+ unsigned char r, g, b, a;
+ } backdrop;
unsigned width;
unsigned height;
unsigned layers;
- unsigned behind;
+ unsigned middleground;
struct parallax {
float x, y;
} *parallax;
collision_T *collision;
void **tilemaps;
+ size_t input_bytes;
} *tilemap, *next_tilemap;
-void init_tilemap(void);
-void free_tilemap(struct tilemap *tilemap);
-struct tilemap *load_tilemap(void *data, size_t size);
+// render the fore/back ground of the tilemap to `renderer`
+void tilemap_background(struct tilemap *tilemap, int x, int y, int w, int h);
+void tilemap_foreground(struct tilemap *tilemap, int x, int y, int w, int h);
+
+void tilemap_free(struct tilemap *tilemap);
+struct tilemap *tilemap_load(void *data, size_t size);