From 10f0e39e461c406c1ac898d9d6bbf144b44c6cf3 Mon Sep 17 00:00:00 2001 From: cutealien Date: Sun, 8 May 2022 15:40:38 +0000 Subject: [PATCH] Change all CColorConverter functions to work with u32 instead of s32 for sizes. Nothing good could come out of putting negative values into any of those functions. And they are used a lot in image loaders which often can be tricked into passing large enough values to make those functions be called with negative numbers. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6389 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CColorConverter.cpp | 166 ++++++++++++++-------------- source/Irrlicht/CColorConverter.h | 68 ++++++------ source/Irrlicht/CImageWriterBMP.cpp | 2 +- source/Irrlicht/CImageWriterJPG.cpp | 2 +- source/Irrlicht/CImageWriterTGA.cpp | 4 +- tests/tests-last-passed-at.txt | 4 +- 6 files changed, 123 insertions(+), 123 deletions(-) diff --git a/source/Irrlicht/CColorConverter.cpp b/source/Irrlicht/CColorConverter.cpp index ddfbfdf1..f7c92f18 100644 --- a/source/Irrlicht/CColorConverter.cpp +++ b/source/Irrlicht/CColorConverter.cpp @@ -13,21 +13,21 @@ namespace video { //! converts a monochrome bitmap to A1R5G5B5 data -void CColorConverter::convert1BitTo16Bit(const u8* in, s16* out, s32 width, s32 height, s32 linepad, bool flip) +void CColorConverter::convert1BitTo16Bit(const u8* in, s16* out, u32 width, u32 height, u32 linepad, bool flip) { if (!in || !out) return; if (flip) - out += width * height; + out += (size_t)width * height; - for (s32 y=0; y>shift & 0x01 ? (s16)0xffff : (s16)0x8000; @@ -50,21 +50,21 @@ void CColorConverter::convert1BitTo16Bit(const u8* in, s16* out, s32 width, s32 //! converts a 4 bit palettized image to A1R5G5B5 -void CColorConverter::convert4BitTo16Bit(const u8* in, s16* out, s32 width, s32 height, const s32* palette, s32 linepad, bool flip) +void CColorConverter::convert4BitTo16Bit(const u8* in, s16* out, u32 width, u32 height, const s32* palette, u32 linepad, bool flip) { if (!in || !out || !palette) return; if (flip) - out += width*height; + out += (size_t)width*height; - for (s32 y=0; y> shift) & 0xf)]); @@ -89,19 +89,19 @@ void CColorConverter::convert4BitTo16Bit(const u8* in, s16* out, s32 width, s32 //! converts a 8 bit palettized image into A1R5G5B5 -void CColorConverter::convert8BitTo16Bit(const u8* in, s16* out, s32 width, s32 height, const s32* palette, s32 linepad, bool flip) +void CColorConverter::convert8BitTo16Bit(const u8* in, s16* out, u32 width, u32 height, const s32* palette, u32 linepad, bool flip) { if (!in || !out || !palette) return; if (flip) - out += width * height; + out += (size_t)width * height; - for (s32 y=0; y> 15)&0x1)<<31) | (((t >> 10)&0x1F)<<19) | @@ -299,20 +299,20 @@ void CColorConverter::convert16bitToA8R8G8B8andResize(const s16* in, s32* out, s //! copies X8R8G8B8 32 bit data -void CColorConverter::convert32BitTo32Bit(const s32* in, s32* out, s32 width, s32 height, s32 linepad, bool flip) +void CColorConverter::convert32BitTo32Bit(const s32* in, s32* out, u32 width, u32 height, u32 linepad, bool flip) { if (!in || !out) return; if (flip) - out += width * height; + out += (size_t)width * height; - for (s32 y=0; y> 7; dB[1] = (*sB & 0x03e0) >> 2; @@ -342,12 +342,12 @@ void CColorConverter::convert_A1R5G5B5toR8G8B8(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_A1R5G5B5toB8G8R8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A1R5G5B5toB8G8R8(const void* sP, u32 sN, void* dP) { u16* sB = (u16*)sP; u8 * dB = (u8 *)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { dB[0] = (*sB & 0x7c00) >> 7; dB[1] = (*sB & 0x03e0) >> 2; @@ -358,35 +358,35 @@ void CColorConverter::convert_A1R5G5B5toB8G8R8(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_A1R5G5B5toA8R8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A1R5G5B5toA8R8G8B8(const void* sP, u32 sN, void* dP) { u16* sB = (u16*)sP; u32* dB = (u32*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) *dB++ = A1R5G5B5toA8R8G8B8(*sB++); } -void CColorConverter::convert_A1R5G5B5toA1R5G5B5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A1R5G5B5toA1R5G5B5(const void* sP, u32 sN, void* dP) { memcpy(dP, sP, sN * 2); } -void CColorConverter::convert_A1R5G5B5toR5G6B5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A1R5G5B5toR5G6B5(const void* sP, u32 sN, void* dP) { u16* sB = (u16*)sP; u16* dB = (u16*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) *dB++ = A1R5G5B5toR5G6B5(*sB++); } -void CColorConverter::convert_A8R8G8B8toR8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A8R8G8B8toR8G8B8(const void* sP, u32 sN, void* dP) { u8* sB = (u8*)sP; u8* dB = (u8*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { // sB[3] is alpha dB[0] = sB[2]; @@ -398,12 +398,12 @@ void CColorConverter::convert_A8R8G8B8toR8G8B8(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_A8R8G8B8toB8G8R8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A8R8G8B8toB8G8R8(const void* sP, u32 sN, void* dP) { u8* sB = (u8*)sP; u8* dB = (u8*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { // sB[3] is alpha dB[0] = sB[0]; @@ -415,26 +415,26 @@ void CColorConverter::convert_A8R8G8B8toB8G8R8(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_A8R8G8B8toA8R8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A8R8G8B8toA8R8G8B8(const void* sP, u32 sN, void* dP) { memcpy(dP, sP, sN * 4); } -void CColorConverter::convert_A8R8G8B8toA1R5G5B5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A8R8G8B8toA1R5G5B5(const void* sP, u32 sN, void* dP) { u32* sB = (u32*)sP; u16* dB = (u16*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) *dB++ = A8R8G8B8toA1R5G5B5(*sB++); } -void CColorConverter::convert_A8R8G8B8toA1B5G5R5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A8R8G8B8toA1B5G5R5(const void* sP, u32 sN, void* dP) { u8 * sB = (u8 *)sP; u16* dB = (u16*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { s32 r = sB[0] >> 3; s32 g = sB[1] >> 3; @@ -448,12 +448,12 @@ void CColorConverter::convert_A8R8G8B8toA1B5G5R5(const void* sP, s32 sN, void* d } } -void CColorConverter::convert_A8R8G8B8toR5G6B5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A8R8G8B8toR5G6B5(const void* sP, u32 sN, void* dP) { u8 * sB = (u8 *)sP; u16* dB = (u16*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { s32 r = sB[2] >> 3; s32 g = sB[1] >> 2; @@ -466,12 +466,12 @@ void CColorConverter::convert_A8R8G8B8toR5G6B5(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_A8R8G8B8toR3G3B2(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A8R8G8B8toR3G3B2(const void* sP, u32 sN, void* dP) { u8* sB = (u8*)sP; u8* dB = (u8*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { u8 r = sB[2] & 0xe0; u8 g = (sB[1] & 0xe0) >> 3; @@ -484,17 +484,17 @@ void CColorConverter::convert_A8R8G8B8toR3G3B2(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_R8G8B8toR8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R8G8B8toR8G8B8(const void* sP, u32 sN, void* dP) { memcpy(dP, sP, sN * 3); } -void CColorConverter::convert_R8G8B8toA8R8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R8G8B8toA8R8G8B8(const void* sP, u32 sN, void* dP) { u8* sB = (u8* )sP; u32* dB = (u32*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { *dB = 0xff000000 | (sB[0]<<16) | (sB[1]<<8) | sB[2]; @@ -503,12 +503,12 @@ void CColorConverter::convert_R8G8B8toA8R8G8B8(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_R8G8B8toA1R5G5B5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R8G8B8toA1R5G5B5(const void* sP, u32 sN, void* dP) { u8 * sB = (u8 *)sP; u16* dB = (u16*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { s32 r = sB[0] >> 3; s32 g = sB[1] >> 3; @@ -521,12 +521,12 @@ void CColorConverter::convert_R8G8B8toA1R5G5B5(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_B8G8R8toA8R8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_B8G8R8toA8R8G8B8(const void* sP, u32 sN, void* dP) { u8* sB = (u8* )sP; u32* dB = (u32*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { *dB = 0xff000000 | (sB[2]<<16) | (sB[1]<<8) | sB[0]; @@ -535,12 +535,12 @@ void CColorConverter::convert_B8G8R8toA8R8G8B8(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_B8G8R8A8toA8R8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_B8G8R8A8toA8R8G8B8(const void* sP, u32 sN, void* dP) { u8* sB = (u8*)sP; u8* dB = (u8*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { dB[0] = sB[3]; dB[1] = sB[2]; @@ -553,24 +553,24 @@ void CColorConverter::convert_B8G8R8A8toA8R8G8B8(const void* sP, s32 sN, void* d } -void CColorConverter::convert_A8R8G8B8toA8B8G8R8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_A8R8G8B8toA8B8G8R8(const void* sP, u32 sN, void* dP) { const u32* sB = (const u32*)sP; u32* dB = (u32*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { *dB++ = (*sB & 0xff00ff00) | ((*sB & 0x00ff0000) >> 16) | ((*sB & 0x000000ff) << 16); ++sB; } } -void CColorConverter::convert_R8G8B8toR5G6B5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R8G8B8toR5G6B5(const void* sP, u32 sN, void* dP) { u8 * sB = (u8 *)sP; u16* dB = (u16*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { s32 r = sB[0] >> 3; s32 g = sB[1] >> 2; @@ -583,17 +583,17 @@ void CColorConverter::convert_R8G8B8toR5G6B5(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_R5G6B5toR5G6B5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R5G6B5toR5G6B5(const void* sP, u32 sN, void* dP) { memcpy(dP, sP, sN * 2); } -void CColorConverter::convert_R5G6B5toR8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R5G6B5toR8G8B8(const void* sP, u32 sN, void* dP) { u16* sB = (u16*)sP; u8 * dB = (u8 *)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { dB[0] = (*sB & 0xf800) >> 8; dB[1] = (*sB & 0x07e0) >> 3; @@ -604,12 +604,12 @@ void CColorConverter::convert_R5G6B5toR8G8B8(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_R5G6B5toB8G8R8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R5G6B5toB8G8R8(const void* sP, u32 sN, void* dP) { u16* sB = (u16*)sP; u8 * dB = (u8 *)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) { dB[2] = (*sB & 0xf800) >> 8; dB[1] = (*sB & 0x07e0) >> 3; @@ -620,21 +620,21 @@ void CColorConverter::convert_R5G6B5toB8G8R8(const void* sP, s32 sN, void* dP) } } -void CColorConverter::convert_R5G6B5toA8R8G8B8(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R5G6B5toA8R8G8B8(const void* sP, u32 sN, void* dP) { u16* sB = (u16*)sP; u32* dB = (u32*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) *dB++ = R5G6B5toA8R8G8B8(*sB++); } -void CColorConverter::convert_R5G6B5toA1R5G5B5(const void* sP, s32 sN, void* dP) +void CColorConverter::convert_R5G6B5toA1R5G5B5(const void* sP, u32 sN, void* dP) { u16* sB = (u16*)sP; u16* dB = (u16*)dP; - for (s32 x = 0; x < sN; ++x) + for (u32 x = 0; x < sN; ++x) *dB++ = R5G6B5toA1R5G5B5(*sB++); } @@ -696,7 +696,7 @@ bool CColorConverter::canConvertFormat(ECOLOR_FORMAT sourceFormat, ECOLOR_FORMAT return false; } -void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN, +void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, u32 sN, void* dP, ECOLOR_FORMAT dF) { // please also update can_convert_viaFormat when adding new conversions diff --git a/source/Irrlicht/CColorConverter.h b/source/Irrlicht/CColorConverter.h index 888b18fb..eaab9e14 100644 --- a/source/Irrlicht/CColorConverter.h +++ b/source/Irrlicht/CColorConverter.h @@ -18,34 +18,34 @@ class CColorConverter public: //! converts a monochrome bitmap to A1R5G5B5 - static void convert1BitTo16Bit(const u8* in, s16* out, s32 width, s32 height, s32 linepad=0, bool flip=false); + static void convert1BitTo16Bit(const u8* in, s16* out, u32 width, u32 height, u32 linepad=0, bool flip=false); //! converts a 4 bit palettized image to A1R5G5B5 - static void convert4BitTo16Bit(const u8* in, s16* out, s32 width, s32 height, const s32* palette, s32 linepad=0, bool flip=false); + static void convert4BitTo16Bit(const u8* in, s16* out, u32 width, u32 height, const s32* palette, u32 linepad=0, bool flip=false); //! converts a 8 bit palettized image to A1R5G5B5 - static void convert8BitTo16Bit(const u8* in, s16* out, s32 width, s32 height, const s32* palette, s32 linepad=0, bool flip=false); + static void convert8BitTo16Bit(const u8* in, s16* out, u32 width, u32 height, const s32* palette, u32 linepad=0, bool flip=false); //! converts a 8 bit palettized or non palettized image (A8) into R8G8B8 - static void convert8BitTo24Bit(const u8* in, u8* out, s32 width, s32 height, const u8* palette, s32 linepad = 0, bool flip=false); + static void convert8BitTo24Bit(const u8* in, u8* out, u32 width, u32 height, const u8* palette, u32 linepad = 0, bool flip=false); //! converts a 8 bit palettized or non palettized image (A8) into A8R8G8B8 - static void convert8BitTo32Bit(const u8* in, u8* out, s32 width, s32 height, const u8* palette, s32 linepad = 0, bool flip=false); + static void convert8BitTo32Bit(const u8* in, u8* out, u32 width, u32 height, const u8* palette, u32 linepad = 0, bool flip=false); //! converts R8G8B8 16 bit data to A1R5G5B5 data - static void convert16BitTo16Bit(const s16* in, s16* out, s32 width, s32 height, s32 linepad=0, bool flip=false); + static void convert16BitTo16Bit(const s16* in, s16* out, u32 width, u32 height, u32 linepad=0, bool flip=false); //! copies R8G8B8 24 bit data to 24 data, and flips and //! mirrors the image during the process. - static void convert24BitTo24Bit(const u8* in, u8* out, s32 width, s32 height, s32 linepad=0, bool flip=false, bool bgr=false); + static void convert24BitTo24Bit(const u8* in, u8* out, u32 width, u32 height, u32 linepad=0, bool flip=false, bool bgr=false); //! Resizes the surface to a new size and converts it at the same time //! to an A8R8G8B8 format, returning the pointer to the new buffer. - static void convert16bitToA8R8G8B8andResize(const s16* in, s32* out, s32 newWidth, s32 newHeight, s32 currentWidth, s32 currentHeight); + static void convert16bitToA8R8G8B8andResize(const s16* in, s32* out, u32 newWidth, u32 newHeight, u32 currentWidth, u32 currentHeight); //! copies X8R8G8B8 32 bit data, and flips and //! mirrors the image during the process. - static void convert32BitTo32Bit(const s32* in, s32* out, s32 width, s32 height, s32 linepad, bool flip=false); + static void convert32BitTo32Bit(const s32* in, s32* out, u32 width, u32 height, u32 linepad, bool flip=false); //! Functions for converting one image format to another efficiently @@ -57,34 +57,34 @@ public: //! \param sN number of source pixels to copy //! \param dP pointer to destination data buffer. must be big enough //! to hold sN pixels in the output format. - static void convert_A1R5G5B5toR8G8B8(const void* sP, s32 sN, void* dP); - static void convert_A1R5G5B5toB8G8R8(const void* sP, s32 sN, void* dP); - static void convert_A1R5G5B5toA8R8G8B8(const void* sP, s32 sN, void* dP); - static void convert_A1R5G5B5toA1R5G5B5(const void* sP, s32 sN, void* dP); - static void convert_A1R5G5B5toR5G6B5(const void* sP, s32 sN, void* dP); + static void convert_A1R5G5B5toR8G8B8(const void* sP, u32 sN, void* dP); + static void convert_A1R5G5B5toB8G8R8(const void* sP, u32 sN, void* dP); + static void convert_A1R5G5B5toA8R8G8B8(const void* sP, u32 sN, void* dP); + static void convert_A1R5G5B5toA1R5G5B5(const void* sP, u32 sN, void* dP); + static void convert_A1R5G5B5toR5G6B5(const void* sP, u32 sN, void* dP); - static void convert_A8R8G8B8toR8G8B8(const void* sP, s32 sN, void* dP); - static void convert_A8R8G8B8toB8G8R8(const void* sP, s32 sN, void* dP); - static void convert_A8R8G8B8toA8R8G8B8(const void* sP, s32 sN, void* dP); - static void convert_A8R8G8B8toA1R5G5B5(const void* sP, s32 sN, void* dP); - static void convert_A8R8G8B8toA1B5G5R5(const void* sP, s32 sN, void* dP); - static void convert_A8R8G8B8toR5G6B5(const void* sP, s32 sN, void* dP); + static void convert_A8R8G8B8toR8G8B8(const void* sP, u32 sN, void* dP); + static void convert_A8R8G8B8toB8G8R8(const void* sP, u32 sN, void* dP); + static void convert_A8R8G8B8toA8R8G8B8(const void* sP, u32 sN, void* dP); + static void convert_A8R8G8B8toA1R5G5B5(const void* sP, u32 sN, void* dP); + static void convert_A8R8G8B8toA1B5G5R5(const void* sP, u32 sN, void* dP); + static void convert_A8R8G8B8toR5G6B5(const void* sP, u32 sN, void* dP); - static void convert_A8R8G8B8toR3G3B2(const void* sP, s32 sN, void* dP); - static void convert_R8G8B8toR8G8B8(const void* sP, s32 sN, void* dP); - static void convert_R8G8B8toA8R8G8B8(const void* sP, s32 sN, void* dP); - static void convert_R8G8B8toA1R5G5B5(const void* sP, s32 sN, void* dP); - static void convert_R8G8B8toR5G6B5(const void* sP, s32 sN, void* dP); - static void convert_B8G8R8toA8R8G8B8(const void* sP, s32 sN, void* dP); - static void convert_B8G8R8A8toA8R8G8B8(const void* sP, s32 sN, void* dP); - static void convert_A8R8G8B8toA8B8G8R8(const void* sP, s32 sN, void* dP); + static void convert_A8R8G8B8toR3G3B2(const void* sP, u32 sN, void* dP); + static void convert_R8G8B8toR8G8B8(const void* sP, u32 sN, void* dP); + static void convert_R8G8B8toA8R8G8B8(const void* sP, u32 sN, void* dP); + static void convert_R8G8B8toA1R5G5B5(const void* sP, u32 sN, void* dP); + static void convert_R8G8B8toR5G6B5(const void* sP, u32 sN, void* dP); + static void convert_B8G8R8toA8R8G8B8(const void* sP, u32 sN, void* dP); + static void convert_B8G8R8A8toA8R8G8B8(const void* sP, u32 sN, void* dP); + static void convert_A8R8G8B8toA8B8G8R8(const void* sP, u32 sN, void* dP); - static void convert_R5G6B5toR5G6B5(const void* sP, s32 sN, void* dP); - static void convert_R5G6B5toR8G8B8(const void* sP, s32 sN, void* dP); - static void convert_R5G6B5toB8G8R8(const void* sP, s32 sN, void* dP); - static void convert_R5G6B5toA8R8G8B8(const void* sP, s32 sN, void* dP); - static void convert_R5G6B5toA1R5G5B5(const void* sP, s32 sN, void* dP); - static void convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN, + static void convert_R5G6B5toR5G6B5(const void* sP, u32 sN, void* dP); + static void convert_R5G6B5toR8G8B8(const void* sP, u32 sN, void* dP); + static void convert_R5G6B5toB8G8R8(const void* sP, u32 sN, void* dP); + static void convert_R5G6B5toA8R8G8B8(const void* sP, u32 sN, void* dP); + static void convert_R5G6B5toA1R5G5B5(const void* sP, u32 sN, void* dP); + static void convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, u32 sN, void* dP, ECOLOR_FORMAT dF); // Check if convert_viaFormat is usable static bool canConvertFormat(ECOLOR_FORMAT sourceFormat, ECOLOR_FORMAT destFormat); diff --git a/source/Irrlicht/CImageWriterBMP.cpp b/source/Irrlicht/CImageWriterBMP.cpp index 84fdc7ba..04d39731 100644 --- a/source/Irrlicht/CImageWriterBMP.cpp +++ b/source/Irrlicht/CImageWriterBMP.cpp @@ -62,7 +62,7 @@ bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param) imageHeader.FileSize = imageHeader.BitmapDataOffset + imageHeader.BitmapDataSize; // bitmaps are stored upside down and padded so we always do this - void (*CColorConverter_convertFORMATtoFORMAT)(const void*, s32, void*) = 0; + void (*CColorConverter_convertFORMATtoFORMAT)(const void*, u32, void*) = 0; switch(image->getColorFormat()) { case ECF_R8G8B8: diff --git a/source/Irrlicht/CImageWriterJPG.cpp b/source/Irrlicht/CImageWriterJPG.cpp index e1d88e46..793aed22 100644 --- a/source/Irrlicht/CImageWriterJPG.cpp +++ b/source/Irrlicht/CImageWriterJPG.cpp @@ -107,7 +107,7 @@ static void jpeg_file_dest(j_compress_ptr cinfo, io::IWriteFile* file) */ static bool writeJPEGFile(io::IWriteFile* file, IImage* image, u32 quality) { - void (*format)(const void*, s32, void*) = 0; + void (*format)(const void*, u32, void*) = 0; switch( image->getColorFormat () ) { case ECF_R8G8B8: diff --git a/source/Irrlicht/CImageWriterTGA.cpp b/source/Irrlicht/CImageWriterTGA.cpp index dd8c0705..35f7afef 100644 --- a/source/Irrlicht/CImageWriterTGA.cpp +++ b/source/Irrlicht/CImageWriterTGA.cpp @@ -55,10 +55,10 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param) // be fixed to only swap/flip imageHeader.ImageDescriptor = (1 << 5); - // chances are good we'll need to swizzle data, so i'm going + // chances are good we'll need to swizzle data, so I'm going // to convert and write one scan line at a time. it's also // a bit cleaner this way - void (*CColorConverter_convertFORMATtoFORMAT)(const void*, s32, void*) = 0; + void (*CColorConverter_convertFORMATtoFORMAT)(const void*, u32, void*) = 0; switch(image->getColorFormat()) { case ECF_A8R8G8B8: diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index eac8f0bf..ebcc190c 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ Tests finished. 72 tests of 72 passed. -Compiled as RELEASE -Test suite pass at GMT Wed May 4 10:25:42 2022 +Compiled as DEBUG +Test suite pass at GMT Sun May 08 15:37:29 2022