diff options
author | Lukas Rusak <lorusak@gmail.com> | 2023-05-04 19:58:12 -0700 |
---|---|---|
committer | Lukas Rusak <lorusak@gmail.com> | 2023-05-12 20:42:04 -0700 |
commit | ea20ca9d71e683a2e573f61feaa98f5fef2560d1 (patch) | |
tree | d075e02c837d0f8997276d1638ba3c02b558b450 /tools | |
parent | dbd9071a5702fc06c66cbd14f518f8f8000bd122 (diff) |
TexturePacker: add HasAlpha to an anonymous namespace
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/depends/native/TexturePacker/src/TexturePacker.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/depends/native/TexturePacker/src/TexturePacker.cpp b/tools/depends/native/TexturePacker/src/TexturePacker.cpp index 0fabb2a234..2094fe44d3 100644 --- a/tools/depends/native/TexturePacker/src/TexturePacker.cpp +++ b/tools/depends/native/TexturePacker/src/TexturePacker.cpp @@ -77,6 +77,17 @@ const char *GetFormatString(unsigned int format) } } +bool HasAlpha(unsigned char* argb, unsigned int width, unsigned int height) +{ + unsigned char* p = argb + 3; // offset of alpha + for (unsigned int i = 0; i < 4 * width * height; i += 4) + { + if (p[i] != 0xff) + return true; + } + return false; +} + } // namespace class TexturePacker @@ -209,17 +220,6 @@ CXBTFFrame appendContent(CXBTFWriter &writer, int width, int height, unsigned ch return frame; } -bool HasAlpha(unsigned char *argb, unsigned int width, unsigned int height) -{ - unsigned char *p = argb + 3; // offset of alpha - for (unsigned int i = 0; i < 4*width*height; i += 4) - { - if (p[i] != 0xff) - return true; - } - return false; -} - CXBTFFrame createXBTFFrame(RGBAImage& image, CXBTFWriter& writer, unsigned int flags) { |