aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorLars Hofhansl <larsh@apache.org>2017-11-04 18:05:47 -0700
committerLars Hofhansl <larsh@apache.org>2017-11-04 18:05:55 -0700
commit6be6fb78a4becc9bf4e999ff5aaa3c2d75fcc428 (patch)
tree8591642326e44703b604cbc54fc2880ed45417c0 /src/client
parent21f3237fe95a18e97421ea80762f989c7841a181 (diff)
downloadminetest-6be6fb78a4becc9bf4e999ff5aaa3c2d75fcc428.tar.gz
minetest-6be6fb78a4becc9bf4e999ff5aaa3c2d75fcc428.tar.bz2
minetest-6be6fb78a4becc9bf4e999ff5aaa3c2d75fcc428.zip
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)
Diffstat (limited to 'src/client')
-rw-r--r--src/client/tile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/tile.cpp b/src/client/tile.cpp
index 9321a4586..d0b9d81bf 100644
--- a/src/client/tile.cpp
+++ b/src/client/tile.cpp
@@ -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();