OSDN Git Service

also handle 8 alphabits specially
authorRudolf Polzer <divverent@xonotic.org>
Fri, 15 Jul 2011 07:30:50 +0000 (09:30 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 15 Jul 2011 07:30:50 +0000 (09:30 +0200)
s2tc_compressor.cpp

index ba05290..17065a8 100644 (file)
@@ -892,11 +892,16 @@ void rgb565_image(unsigned char *out, const unsigned char *rgba, int w, int h, i
        {
                if(alphabits == 1)
                {
-                       int alphadiffuse = 8 - alphabits;
                        for(y = 0; y < h; ++y)
                                for(x = 0; x < w; ++x)
                                        out[(x + y * w) * 4 + 3] = diffuse1(&diffuse_a, rgba[(x + y * w) * srccomps + 3]);
                }
+               else if(alphabits == 8)
+               {
+                       for(y = 0; y < h; ++y)
+                               for(x = 0; x < w; ++x)
+                                       out[(x + y * w) * 4 + 3] = rgba[(x + y * w) * srccomps + 3]; // no conversion
+               }
                else
                {
                        int alphadiffuse = 8 - alphabits;