OSDN Git Service
(root)
/
android-x86
/
external-s2tc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95aa937
)
make encoding of DXT3/5 "more friendly" (don't use the swapped-colors case of DXT1)
author
Rudolf Polzer
<divverent@xonotic.org>
Fri, 15 Jul 2011 11:08:46 +0000
(13:08 +0200)
committer
Rudolf Polzer
<divverent@xonotic.org>
Fri, 15 Jul 2011 11:08:46 +0000
(13:08 +0200)
s2tc_compressor.cpp
patch
|
blob
|
history
diff --git
a/s2tc_compressor.cpp
b/s2tc_compressor.cpp
index
e3312ef
..
aebf469
100644
(file)
--- a/
s2tc_compressor.cpp
+++ b/
s2tc_compressor.cpp
@@
-482,12
+482,15
@@
namespace
{
if(ca[1] < ca[0])
{
+ // select mode with 6 = 0, 7 = 255
ca[2] = ca[0];
ca[0] = ca[1];
ca[1] = ca[2];
}
}
- if(c[1] < c[0])
+ if((dxt == DXT1) ? (c[1] < c[0]) : (c[0] < c[1]))
+ // DXT1: select mode with 3 = transparent
+ // other: don't select this mode
{
c[2] = c[0];
c[0] = c[1];
@@
-733,7
+736,9
@@
namespace
}
}
}
- if(c[1] < c[0])
+ if((dxt == DXT1) ? (c[1] < c[0]) : (c[0] < c[1]))
+ // DXT1: select mode with 3 = transparent
+ // other: don't select this mode
{
c[2] = c[0];
c[0] = c[1];