MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / main

Function main

PaletteExtractor/main.cpp:11–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace ChasmReverse;
10
11int main( const int argc, const char* const argv[] )
12{
13 const unsigned int c_scale= 8u;
14 const unsigned int c_width= 16;
15 const unsigned int c_height= 16u;
16
17 Palette palette;
18 LoadPalette( palette );
19
20 unsigned char data[ c_scale * c_scale * c_width * c_height ];
21 for( unsigned int y= 0u; y < c_height; y++ )
22 for( unsigned int sy= 0u; sy < c_scale; sy++ )
23 {
24 unsigned char* const dst= data + ( y * c_scale + sy ) * c_scale * c_width;
25 for( unsigned int x= 0u; x < c_width; x++ )
26 for( unsigned int sx= 0u; sx < c_scale; sx++ )
27 dst[ x * c_scale + sx ]= x + y * c_width;
28 }
29
30 WriteTGA(
31 c_width * c_scale,
32 c_height * c_scale,
33 data,
34 palette.data(),
35 "palette.tga" );
36
37}

Callers

nothing calls this directly

Calls 2

WriteTGAFunction · 0.85
LoadPaletteFunction · 0.50

Tested by

no test coverage detected