diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-04-07 21:21:06 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-04-07 21:21:06 -0300 |
commit | 963845eea9794c1e35e536da57cb22b01fd58fa7 (patch) | |
tree | 5d963252f3bc2cb175bfdda91d1369aace97a45b /drivers/etc1 | |
parent | 22997294fa87a1346ef4617b887953a356943354 (diff) | |
parent | ef222aea8976d66986e8c05a82e9d6f938a87235 (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'drivers/etc1')
-rw-r--r-- | drivers/etc1/SCsub | 3 | ||||
-rw-r--r-- | drivers/etc1/rg_etc1.cpp | 5 |
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)
{
|