Navigation Menu

Skip to content

Commit

Permalink
Do not scale texture unless necessary.
Browse files Browse the repository at this point in the history
This avoids scaling textures to 'texture_min_size' unless it is actually
required (because either auto-scaling or bi/trilinear filtering is enabled)
  • Loading branch information
lhofhansl committed Nov 5, 2017
1 parent 21f3237 commit 6be6fb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/tile.cpp
Expand Up @@ -1777,7 +1777,8 @@ bool TextureSource::generateImagePart(std::string part_of_name,
* mix high- and low-res textures, or for mods with least-common-denominator
* textures that don't have the resources to offer high-res alternatives.
*/
s32 scaleto = g_settings->getS32("texture_min_size");
const bool filter = m_setting_trilinear_filter || m_setting_bilinear_filter;
const s32 scaleto = filter ? g_settings->getS32("texture_min_size") : 1;
if (scaleto > 1) {
const core::dimension2d<u32> dim = baseimg->getDimension();

Expand Down

0 comments on commit 6be6fb7

Please sign in to comment.