Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-s2tc: Commit

external/s2tc


Commit MetaInfo

Revision1fc9f34d7c81a43c5bebc2730d3636116574ee03 (tree)
Zeit2013-10-31 23:21:48
AutorRudolf Polzer <divverent@xono...>
CommiterRudolf Polzer

Log Message

Fix for #2 (alpha zero pixels wreaking havoc).

One place accidentally ignored alpha-zero pixels, making it inconsistent
with the rest and causing bad visual errors in MODE_FAST.

Ändern Zusammenfassung

Diff

--- a/s2tc_algorithm.cpp
+++ b/s2tc_algorithm.cpp
@@ -880,7 +880,7 @@ namespace
880880
881881 color_t c0 = make_color_t(0, 0, 0);
882882
883- // dummy values because we don't know whether the first pixel willw rite
883+ // dummy values because we don't know whether the first pixel will write
884884 c[0].r = 31;
885885 c[0].g = 63;
886886 c[0].b = 31;
@@ -903,8 +903,6 @@ namespace
903903 c[2].b = rgba[(x + y * iw) * 4 + 2];
904904 ca[2] = rgba[(x + y * iw) * 4 + 3];
905905 // MODE_FAST doesn't work for normalmaps, so this works
906- if(!ca[2])
907- continue;
908906
909907 int d = ColorDist(c[2], c0);
910908 if(d > dmax)
@@ -1130,7 +1128,7 @@ namespace
11301128 template<DxtMode dxt, ColorDistFunc ColorDist>
11311129 inline s2tc_encode_block_func_t s2tc_encode_block_func(int nrandom, RefinementMode refine)
11321130 {
1133- if(!supports_fast<ColorDist>::value || nrandom >= 0)
1131+ if(!supports_fast<ColorDist>::value || nrandom >= 0)
11341132 return s2tc_encode_block_func<dxt, ColorDist, MODE_NORMAL>(refine);
11351133 else
11361134 return s2tc_encode_block_func<dxt, ColorDist, MODE_FAST>(refine);
Show on old repository browser