diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-03-24 10:36:34 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-03-24 10:36:34 (EDT) |
commit | 51fe7e54a2c10457d3dd1380aca5bb9a6692ba2b (patch) | |
tree | a1e5e5507ae93a7b1bf040d548df949135dfd966 /src | |
parent | 103b5c0eea22b6570ada8ae9200ab069466bd1b3 (diff) | |
download | dodge-balls-51fe7e54a2c10457d3dd1380aca5bb9a6692ba2b.zip dodge-balls-51fe7e54a2c10457d3dd1380aca5bb9a6692ba2b.tar.gz dodge-balls-51fe7e54a2c10457d3dd1380aca5bb9a6692ba2b.tar.bz2 |
map: Fix map size
And add SDL_RenderCopy() dstrect size to debugging output.
Diffstat (limited to 'src')
-rw-r--r-- | src/map.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -549,9 +549,11 @@ _db_map_render_layer(struct db_map *map, struct db_map_layer *layer, layer_rect.x *= layer_rect.w; layer_rect.y *= layer_rect.h; db_dbg("Blitting %dx%d tile at (%d,%d) " - "onto layer at (%d,%d)...", + "onto %dx%d area of layer at " + "(%d,%d)...", tile_rect.w, tile_rect.h, tile_rect.x, tile_rect.y, + layer_rect.w, layer_rect.h, layer_rect.x, layer_rect.y); if (SDL_RenderCopy(renderer, db_tileset_texture( tileset, @@ -582,7 +584,8 @@ db_map_render(struct db_map *map, SDL_Renderer *renderer) struct db_map_layer *layer; texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, - SDL_TEXTUREACCESS_TARGET, map->w, map->h); + SDL_TEXTUREACCESS_TARGET, map->w * map->tw, + map->h * map->th); old_target = SDL_GetRenderTarget(renderer); SDL_SetRenderTarget(renderer, texture); if (SDL_RenderClear(renderer) != 0) { |