summaryrefslogtreecommitdiff
path: root/drivers/etc1
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-04-07 20:22:58 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-04-07 20:22:58 -0300
commitb135cdbf05312211a81ad3405f154082d1c059e3 (patch)
tree39fb2b99b64e2dfc7d9403c61bb33eff418bf4ee /drivers/etc1
parente336306e9176bb3e9e459a63344ef54c1e57c9cd (diff)
parent4fa71a6ee0ea72289d9e647eb0aeea59cf8a7192 (diff)
Merge pull request #1531 from vkbsb/h5_canvas_polygon_fix
H5 canvas polygon fix
Diffstat (limited to 'drivers/etc1')
-rw-r--r--drivers/etc1/SCsub3
-rw-r--r--drivers/etc1/rg_etc1.cpp5
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub
index 152dc3f4d0..251c3ffb86 100644
--- a/drivers/etc1/SCsub
+++ b/drivers/etc1/SCsub
@@ -6,7 +6,8 @@ etc_sources = [
"etc1/rg_etc1.cpp"
]
-env.drivers_sources+=etc_sources
+if (env["etc1"] != "no"):
+ env.drivers_sources+=etc_sources
#env.add_source_files(env.drivers_sources, etc_sources)
diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp
index 63877e6d12..fd109f003c 100644
--- a/drivers/etc1/rg_etc1.cpp
+++ b/drivers/etc1/rg_etc1.cpp
@@ -24,6 +24,9 @@
namespace rg_etc1
{
+ inline long labs(long val) {
+ return val < 0 ? -val : val;
+ }
inline int intabs(int val) {
@@ -1913,7 +1916,7 @@ done:
for (uint packed_c = 0; packed_c < limit; packed_c++)
{
int v = etc1_decode_value(diff, inten, selector, packed_c);
- uint err = intabs(v - color);
+ uint err = labs(v - static_cast<int>(color));
//printf("err: %d - %u = %u\n",v,color,err);
if (err < best_error)
{