summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/tools/texturec/texturec.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/tools/texturec/texturec.cpp')
-rw-r--r--3rdparty/bgfx/tools/texturec/texturec.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/3rdparty/bgfx/tools/texturec/texturec.cpp b/3rdparty/bgfx/tools/texturec/texturec.cpp
index 81bccfeb6f6..35983dc9849 100644
--- a/3rdparty/bgfx/tools/texturec/texturec.cpp
+++ b/3rdparty/bgfx/tools/texturec/texturec.cpp
@@ -27,8 +27,8 @@
#endif // DEBUG
#include <bx/bx.h>
-#include <bx/allocator.h>
#include <bx/commandline.h>
+#include <bx/crtimpl.h>
#include <bx/uint32_t.h>
namespace bgfx
@@ -117,7 +117,7 @@ namespace bgfx
case TextureFormat::PTC14:
{
using namespace Javelin;
- RgbBitmap bmp;
+ RgbaBitmap bmp;
bmp.width = _width;
bmp.height = _height;
bmp.data = (uint8_t*)const_cast<void*>(_src);
@@ -511,6 +511,8 @@ int main(int _argc, const char* _argv[])
{
imageRgba32fDownsample2x2NormalMap(mip.m_width, mip.m_height, mip.m_width*16, rgba, rgba);
imageRgba32f11to01(rgbaDst, mip.m_width, mip.m_height, mip.m_width*16, rgba);
+ mip.m_width = bx::uint32_max(1, mip.m_width >> 1);
+ mip.m_height = bx::uint32_max(1, mip.m_height >> 1);
ImageMip dstMip;
imageGetRawData(imageContainer, 0, lod, output->data, output->size, dstMip);
@@ -541,6 +543,8 @@ int main(int _argc, const char* _argv[])
for (uint8_t lod = 1; lod < numMips; ++lod)
{
imageRgba8Downsample2x2(mip.m_width, mip.m_height, mip.m_width*4, rgba, rgba);
+ mip.m_width = bx::uint32_max(1, mip.m_width >> 1);
+ mip.m_height = bx::uint32_max(1, mip.m_height >> 1);
ImageMip dstMip;
imageGetRawData(imageContainer, 0, lod, output->data, output->size, dstMip);