summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-03-24 09:56:24 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-03-24 09:56:24 (EDT)
commit5ae17e4d78aefc97f22dbafddb054efe28c2f69d (patch)
tree50038c1ccdf41398471e508e5822cd7b37f180c5
parent5e0f3439d82a4ff04bf0ce5da47901129acf521e (diff)
downloaddodge-balls-5ae17e4d78aefc97f22dbafddb054efe28c2f69d.zip
dodge-balls-5ae17e4d78aefc97f22dbafddb054efe28c2f69d.tar.gz
dodge-balls-5ae17e4d78aefc97f22dbafddb054efe28c2f69d.tar.bz2
map: Fix layer rect math
-rw-r--r--src/map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map.c b/src/map.c
index 41d6af8..53dd570 100644
--- a/src/map.c
+++ b/src/map.c
@@ -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;