diff options
-rw-r--r-- | src/map.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -542,8 +542,8 @@ _db_map_render_layer(struct db_map *map, struct db_map_layer *layer, tile_rect.h = tileheight; tile_rect.x *= tile_rect.w; tile_rect.y *= tile_rect.h; - layer_rect.x = i % columns; - layer_rect.y = i / columns; + layer_rect.x = i % map->w; + layer_rect.y = i / map->w; layer_rect.w = tilewidth; layer_rect.h = tileheight; layer_rect.x *= layer_rect.w; |