Skip to content

Commit 6be6fb7

Browse files
committedNov 5, 2017
Do not scale texture unless necessary.
This avoids scaling textures to 'texture_min_size' unless it is actually required (because either auto-scaling or bi/trilinear filtering is enabled)
1 parent 21f3237 commit 6be6fb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/client/tile.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,8 @@ bool TextureSource::generateImagePart(std::string part_of_name,
17771777
* mix high- and low-res textures, or for mods with least-common-denominator
17781778
* textures that don't have the resources to offer high-res alternatives.
17791779
*/
1780-
s32 scaleto = g_settings->getS32("texture_min_size");
1780+
const bool filter = m_setting_trilinear_filter || m_setting_bilinear_filter;
1781+
const s32 scaleto = filter ? g_settings->getS32("texture_min_size") : 1;
17811782
if (scaleto > 1) {
17821783
const core::dimension2d<u32> dim = baseimg->getDimension();
17831784

0 commit comments

Comments
 (0)
Please sign in to comment.