diff options
author | P. 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) |
commit | 5ae17e4d78aefc97f22dbafddb054efe28c2f69d (patch) | |
tree | 50038c1ccdf41398471e508e5822cd7b37f180c5 | |
parent | 5e0f3439d82a4ff04bf0ce5da47901129acf521e (diff) | |
download | dodge-balls-5ae17e4d78aefc97f22dbafddb054efe28c2f69d.zip dodge-balls-5ae17e4d78aefc97f22dbafddb054efe28c2f69d.tar.gz dodge-balls-5ae17e4d78aefc97f22dbafddb054efe28c2f69d.tar.bz2 |
map: Fix layer rect math
-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; |