From 35b84eecacf2ba49db8e34de29d0dabb1b095ee9 Mon Sep 17 00:00:00 2001 From: Sacha Date: Sun, 17 Nov 2013 15:19:13 +1000 Subject: [PATCH] Update to v1.4 of rg_etc1 to fix 64-bit compile bug with gcc. --- ext/rg_etc1/rg_etc1.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/rg_etc1/rg_etc1.cpp b/ext/rg_etc1/rg_etc1.cpp index b03377ec36..25e9d8d7f3 100644 --- a/ext/rg_etc1/rg_etc1.cpp +++ b/ext/rg_etc1/rg_etc1.cpp @@ -4,6 +4,10 @@ // For more information Ericsson Texture Compression (ETC/ETC1), see: // http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt // +// v1.04 - 5/15/14 - Fix signed vs. unsigned subtraction problem (noticed when compiled with gcc) in pack_etc1_block_init(). +// This issue would cause an assert when this func. was called in debug. (Note this module was developed/testing with MSVC, +// I still need to test it throughly when compiled with gcc.) +// // v1.03 - 5/12/13 - Initial public release #include "rg_etc1.h" @@ -1905,7 +1909,7 @@ done: for (uint packed_c = 0; packed_c < limit; packed_c++) { int v = etc1_decode_value(diff, inten, selector, packed_c); - uint err = labs(v - color); + uint err = labs(v - static_cast(color)); if (err < best_error) { best_error = err;