From 2c5e621cdaef674fb6c812d8937598575784db63 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 6 Sep 2025 18:21:43 -0700 Subject: Add preliminary support for multiple layers in ortho maps --- include/isogfx/asset.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/isogfx/asset.h b/include/isogfx/asset.h index cc70ee3..74063a8 100644 --- a/include/isogfx/asset.h +++ b/include/isogfx/asset.h @@ -10,6 +10,7 @@ #include #include +#include #include // Maximum length of path strings in .TS and .TM files. @@ -177,9 +178,10 @@ static inline const Tm_Layer* tm_map_get_layer( assert(map); assert(layer >= 0); assert(layer < map->num_layers); - return (const Tm_Layer*)((const uint8_t*)map->layers + - (layer * map->world_width * map->world_height * - sizeof(Tile))); + return ( + const Tm_Layer*)((const uint8_t*)map->layers + + ((size_t)(layer * map->world_width * map->world_height) * + sizeof(Tile))); } /// Return the ith layer in the tile map. -- cgit v1.2.3