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

Function RecolourTexture

Source/Graphics/TextureTransform.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24// such a way that their bytes remain in the same order in memory.
25template< typename T >
26static void RecolourTexture( void * p_data, u32 width, u32 height, u32 stride, c32 c )
27{
28 u8 r {c.GetR()};
29 u8 g {c.GetG()};
30 u8 b {c.GetB()};
31
32 T * data = reinterpret_cast< T * >( p_data );
33
34 for( u32 y {}; y < height; ++y )
35 {
36 for( u32 x {}; x < width; ++x )
37 {
38 data[x] = T( r, g, b, data[x].GetA() );
39 }
40
41 data = AddByteOffset( data, stride );
42 }
43}
44
45template< typename T >
46static void RecolourPalette( void * p_data, u32 num_entries, c32 c )

Callers

nothing calls this directly

Calls 5

AddByteOffsetFunction · 0.85
GetRMethod · 0.45
GetGMethod · 0.45
GetBMethod · 0.45
GetAMethod · 0.45

Tested by

no test coverage detected