Fix #33629: DDS DXT5 with alpha not loaded correctly, Y flipping code was wrong.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 20 Dec 2012 15:45:42 +0000 (15:45 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 20 Dec 2012 15:45:42 +0000 (15:45 +0000)
source/blender/imbuf/intern/dds/FlipDXT.cpp

index 05821b27ca6884894279f654fe7770cacb2baaf6..660643530ba8f46ccb89582668a9b47d79a52bef 100644 (file)
@@ -147,10 +147,10 @@ static void FlipDXT5BlockFull(uint8_t *block)
 
        block[2] = line_3_2 & 0xff;
        block[3] = (line_3_2 & 0xff00) >> 8;
-       block[4] = (line_3_2 & 0xff0000) >> 8;
+       block[4] = (line_3_2 & 0xff0000) >> 16;
        block[5] = line_1_0 & 0xff;
        block[6] = (line_1_0 & 0xff00) >> 8;
-       block[7] = (line_1_0 & 0xff0000) >> 8;
+       block[7] = (line_1_0 & 0xff0000) >> 16;
 
        // And flip the DXT1 block using the above function.
        FlipDXT1BlockFull(block + 8);
@@ -165,7 +165,7 @@ static void FlipDXT5BlockHalf(uint8_t *block)
                                ((line_0_1 & 0xfff000) >> 12);
        block[2] = line_1_0 & 0xff;
        block[3] = (line_1_0 & 0xff00) >> 8;
-       block[4] = (line_1_0 & 0xff0000) >> 8;
+       block[4] = (line_1_0 & 0xff0000) >> 16;
        FlipDXT1BlockHalf(block + 8);
 }