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

Method LoadAmbientLight

PanzerChasm/map_loader.cpp:393–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393void MapLoader::LoadAmbientLight( const Vfs::FileContent& map_file, MapData& map_data )
394{
395 const unsigned int c_ambient_lightmap_offset= 0x23001u + MapData::c_map_size * MapData::c_map_size * 2u;
396
397 const unsigned char* in_ambient_lightmap_data= map_file.data() + c_ambient_lightmap_offset;
398 for( unsigned int x= 0u; x < MapData::c_map_size; x++ )
399 for( unsigned int y= 0u; y < MapData::c_map_size; y++ )
400 {
401 // Convert "darkeness" into light.
402 const int l= std::max( 18 - int( in_ambient_lightmap_data[ x * MapData::c_map_size + y ] ), 0 ) * 6;
403 map_data.ambient_lightmap[ x + y * MapData::c_map_size ]= static_cast<unsigned char>(l);
404 }
405}
406
407void MapLoader::LoadAmbientSoundsMap( const Vfs::FileContent& map_file, MapData& map_data )
408{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected