#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
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;
}
#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())));
#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;
}
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;
break;
}
- draw2DImageFilterScaled(driver, texture, dest,
- src,
- NULL/*&AbsoluteClippingRect*/, colors, true);
+ draw2DImageFilterScaled(driver, texture, dest, src, cliprect, colors, true);
}
}
}