| 24 | // such a way that their bytes remain in the same order in memory. |
| 25 | template< typename T > |
| 26 | static 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 | |
| 45 | template< typename T > |
| 46 | static void RecolourPalette( void * p_data, u32 num_entries, c32 c ) |
nothing calls this directly
no test coverage detected