diff --git a/src/cata_tiles.cpp b/src/cata_tiles.cpp index 75046565caed0..74b66073c5b3f 100644 --- a/src/cata_tiles.cpp +++ b/src/cata_tiles.cpp @@ -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;