mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Optimize DXT1 index order fixing.
This commit is contained in:
parent
aa3b0de1f5
commit
191ff93822
@ -219,10 +219,11 @@ void TextureCompression::FixOrder( char* data, size_t blocks )
|
|||||||
assert( blocks > 0 );
|
assert( blocks > 0 );
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
uint8_t tmp[4];
|
uint32_t res = 0;
|
||||||
memcpy( tmp, data+4, 4 );
|
uint32_t tmp;
|
||||||
for( int k=0; k<4; k++ ) tmp[k] = DxtcIndexTable[(uint8_t)tmp[k]];
|
memcpy( &tmp, data+4, 4 );
|
||||||
memcpy( data+4, tmp, 4 );
|
for( int k=0; k<4; k++ ) res |= DxtcIndexTable[(tmp >> (k*8)) & 0xFF] << (k*8);
|
||||||
|
memcpy( data+4, &res, 4 );
|
||||||
data += 8;
|
data += 8;
|
||||||
}
|
}
|
||||||
while( --blocks );
|
while( --blocks );
|
||||||
|
Loading…
Reference in New Issue
Block a user