Skip to content

Commit

Permalink
Include changes from CleverRaven#22638
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Dec 21, 2017
1 parent 86e0138 commit 5197445
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,19 @@ void tileset_loader::load_tileset( std::string img_path )
info.max_texture_height = sprite_height * 20 + 1;
#endif

const int min_tile_xcount = 128;
const int min_tile_ycount = min_tile_xcount * 2;

if( info.max_texture_width == 0 ){
info.max_texture_width = sprite_width * min_tile_xcount;
DebugLog( D_INFO, DC_ALL ) << "SDL_RendererInfo max_texture_width was set to 0. Changing it to " << info.max_texture_width;
}

if( info.max_texture_height == 0 ){
info.max_texture_height = sprite_height * min_tile_ycount;
DebugLog( D_INFO, DC_ALL ) << "SDL_RendererInfo max_texture_height was set to 0. Changing it to " << info.max_texture_height;
}

// Number of tiles in each dimension that fits into a (maximal) SDL texture.
// If the tile atlas contains more than that, we have to split it.
const int max_tile_xcount = info.max_texture_width / sprite_width;
Expand Down

0 comments on commit 5197445

Please sign in to comment.