]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/guiscalingfilter.cpp
Remove unused ITextSceneNode header (#11476)
[dragonfireclient.git] / src / client / guiscalingfilter.cpp
index 2ff57ab74dbb5a1a3c876fb7301b02254d5b02c1..232219237be2bdcab84745022b29f35cd0c358d2 100644 (file)
@@ -23,7 +23,6 @@ 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
@@ -102,7 +101,7 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
                if (!g_settings->getBool("gui_scaling_filter_txr2img"))
                        return src;
                srcimg = driver->createImageFromData(src->getColorFormat(),
-                       src->getSize(), src->lock(), false);
+                       src->getSize(), src->lock(video::ETLM_READ_ONLY), false);
                src->unlock();
                g_imgCache[origname] = srcimg;
        }
@@ -117,7 +116,7 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
 #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()) {
+       if (!driver->queryFeature(video::EVDF_TEXTURE_NPOT)) {
                video::IImage *po2img = driver->createImage(src->getColorFormat(),
                                core::dimension2d<u32>(npot2((u32)destrect.getWidth()),
                                npot2((u32)destrect.getHeight())));
@@ -129,7 +128,7 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
 #endif
 
        // Convert the scaled image back into a texture.
-       scaled = driver->addTexture(scalename, destimg, NULL);
+       scaled = driver->addTexture(scalename, destimg);
        destimg->drop();
        g_txrCache[scalename] = scaled;
 
@@ -171,11 +170,9 @@ void draw2DImageFilterScaled(video::IVideoDriver *driver, video::ITexture *txr,
 }
 
 void draw2DImage9Slice(video::IVideoDriver *driver, video::ITexture *texture,
-               const core::rect<s32> &rect, const core::rect<s32> &middle)
+               const core::rect<s32> &rect, const core::rect<s32> &middle,
+               const core::rect<s32> *cliprect, const video::SColor *const colors)
 {
-       const video::SColor color(255,255,255,255);
-       const video::SColor colors[] = {color,color,color,color};
-
        auto originalSize = texture->getOriginalSize();
        core::vector2di lowerRightOffset = core::vector2di(originalSize.Width, originalSize.Height) - middle.LowerRightCorner;
 
@@ -222,9 +219,7 @@ void draw2DImage9Slice(video::IVideoDriver *driver, video::ITexture *texture,
                                break;
                        }
 
-                       draw2DImageFilterScaled(driver, texture, dest,
-                                       src,
-                                       NULL/*&AbsoluteClippingRect*/, colors, true);
+                       draw2DImageFilterScaled(driver, texture, dest, src, cliprect, colors, true);
                }
        }
 }