MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / GetTextureBlockWidth

Function GetTextureBlockWidth

Source/SysPSP/Graphics/NativeTexturePSP.cpp:233–245  ·  view source on GitHub ↗

Swizzle the texture, explicitly setting the texture colour to the specified value (alpha is left alone!) void swizzle_fast_setcolour(u8* out, const u8* in, u32 width, u32 height, u32 mask, u32 colour) { u32 blockx, blocky; u32 j; u32 width_blocks = (width / 16); u32 height_blocks = (height / 8); u32 src_pitch = (width-16)/4; u32 src_row = width * 8; const u8* ysrc = in; u32* dst = (u32

Source from the content-addressed store, hash-verified

231//
232//*****************************************************************************
233u32 GetTextureBlockWidth( u32 dimension, ETextureFormat texture_format )
234{
235 #ifdef DAEDALUS_ENABLE_ASSERTS
236 DAEDALUS_ASSERT( GetNextPowerOf2( dimension ) == dimension, "This is not a power of 2" );
237 #endif
238 // Ensure that the pitch is at least 16 bytes
239 while( CalcBytesRequired( dimension, texture_format ) < 16 )
240 {
241 dimension *= 2;
242 }
243
244 return dimension;
245}
246
247//*****************************************************************************
248//

Callers 1

CNativeTextureMethod · 0.70

Calls 2

GetNextPowerOf2Function · 0.85
CalcBytesRequiredFunction · 0.85

Tested by

no test coverage detected