diff options
author | 2016-03-12 12:31:13 +0100 | |
---|---|---|
committer | 2016-03-12 12:31:13 +0100 | |
commit | a026a582f1a0ea8c1ede3acaddacef506ef3f3b0 (patch) | |
tree | e31573822f2359677de519f9f3b600d98e8764cd /3rdparty/bgfx/tools/texturec/texturec.cpp | |
parent | 477d2abd43984f076b7e45f5527591fa8fd0d241 (diff) | |
parent | dcab55bf53b94713a6f72e9633f5101c8dd6c08c (diff) |
Merge pull request #15 from mamedev/master
Sync to base master
Diffstat (limited to '3rdparty/bgfx/tools/texturec/texturec.cpp')
-rw-r--r-- | 3rdparty/bgfx/tools/texturec/texturec.cpp | 8 |
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); |