summaryrefslogtreecommitdiff
path: root/src/client/guiscalingfilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/guiscalingfilter.cpp')
-rw-r--r--src/client/guiscalingfilter.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/client/guiscalingfilter.cpp b/src/client/guiscalingfilter.cpp
index 3490c47e8..2ff57ab74 100644
--- a/src/client/guiscalingfilter.cpp
+++ b/src/client/guiscalingfilter.cpp
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/numeric.h"
#include <cstdio>
#include "client/renderingengine.h"
+#include "client/tile.h" // hasNPotSupport()
/* Maintain a static cache to store the images that correspond to textures
* in a format that's manipulable by code. Some platforms exhibit issues
@@ -113,17 +114,18 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
(u32)destrect.getHeight()));
imageScaleNNAA(srcimg, srcrect, destimg);
-#ifdef __ANDROID__
- // Android is very picky about textures being powers of 2, so expand
- // the image dimensions to the next power of 2, if necessary, for
- // that platform.
- video::IImage *po2img = driver->createImage(src->getColorFormat(),
- core::dimension2d<u32>(npot2((u32)destrect.getWidth()),
- npot2((u32)destrect.getHeight())));
- po2img->fill(video::SColor(0, 0, 0, 0));
- destimg->copyTo(po2img);
- destimg->drop();
- destimg = po2img;
+#if ENABLE_GLES
+ // Some platforms are picky about textures being powers of 2, so expand
+ // the image dimensions to the next power of 2, if necessary.
+ if (!hasNPotSupport()) {
+ video::IImage *po2img = driver->createImage(src->getColorFormat(),
+ core::dimension2d<u32>(npot2((u32)destrect.getWidth()),
+ npot2((u32)destrect.getHeight())));
+ po2img->fill(video::SColor(0, 0, 0, 0));
+ destimg->copyTo(po2img);
+ destimg->drop();
+ destimg = po2img;
+ }
#endif
// Convert the scaled image back into a texture.