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

Method LoadFloorsAndCeilings

PanzerChasm/map_loader.cpp:370–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370void MapLoader::LoadFloorsAndCeilings( const Vfs::FileContent& map_file, MapData& map_data )
371{
372 const unsigned int c_offset= 0x23001u;
373
374 for( int floor_or_ceiling= 1u; floor_or_ceiling >= 0; floor_or_ceiling-- )
375 {
376 const unsigned char* const in_data=
377 map_file.data() + c_offset + MapData::c_map_size * MapData::c_map_size * static_cast<unsigned int>(1 - floor_or_ceiling);
378
379 unsigned char* const out_data=
380 floor_or_ceiling == 0
381 ? map_data.floor_textures
382 : map_data.ceiling_textures;
383
384 for( unsigned int x= 0u; x < MapData::c_map_size; x++ )
385 for( unsigned int y= 0u; y < MapData::c_map_size; y++ )
386 {
387 const unsigned char texture_number= in_data[ x * MapData::c_map_size + y ];
388 out_data[ x + y * MapData::c_map_size ]= texture_number;
389 }
390 }
391}
392
393void MapLoader::LoadAmbientLight( const Vfs::FileContent& map_file, MapData& map_data )
394{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected