summaryrefslogtreecommitdiff
path: root/src/map.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-12-28 09:12:29 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2023-12-28 09:12:29 +0100
commit007335a39baff05fb7cabb07457cd5972a013fda (patch)
tree8f43623138789a261fa814213b63a4723a650835 /src/map.c
parentc6e7e4b1b1b72e0b67a64332033e3f41f2407f09 (diff)
sort objects by yaxis
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map.c b/src/map.c
index e268c47..4ebd930 100644
--- a/src/map.c
+++ b/src/map.c
@@ -121,6 +121,10 @@ static bool ray_intersects_with_ground(vec3f begin, vec3f end) {
return false;
}
+int sort_objects(const void * obj1, const void* obj2) {
+ return (((object*)obj1)->position.y - ((object*)obj2)->position.y);
+}
+
void load_mapdata_into_world() {
loaded_map.width = map_to_load.width;
loaded_map.height = map_to_load.height;