MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / Decompress

Function Decompress

Engine/lib/squish/squish.cpp:125–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void Decompress( u8* rgba, void const* block, int flags )
126{
127 // fix any bad flags
128 flags = FixFlags( flags );
129
130 // get the block locations
131 void const* colourBlock = block;
132 void const* alphaBock = block;
133 if( ( flags & ( kDxt3 | kDxt5 ) ) != 0 )
134 colourBlock = reinterpret_cast< u8 const* >( block ) + 8;
135
136 // decompress colour
137 DecompressColour( rgba, colourBlock, ( flags & kDxt1 ) != 0 );
138
139 // decompress alpha separately if necessary
140 if( ( flags & kDxt3 ) != 0 )
141 DecompressAlphaDxt3( rgba, alphaBock );
142 else if( ( flags & kDxt5 ) != 0 )
143 DecompressAlphaDxt5( rgba, alphaBock );
144}
145
146int GetStorageRequirements( int width, int height, int flags )
147{

Callers 2

DecompressImageFunction · 0.85
DecodeMethod · 0.85

Calls 4

FixFlagsFunction · 0.85
DecompressColourFunction · 0.85
DecompressAlphaDxt3Function · 0.85
DecompressAlphaDxt5Function · 0.85

Tested by

no test coverage detected