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

Method LoadFloorsAndCeilings

PanzerChasm/client/map_drawer_soft.cpp:953–983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

951}
952
953void MapDrawerSoft::LoadFloorsAndCeilings( const MapData& map_data )
954{
955 map_floors_and_ceilings_.clear();
956
957 for( unsigned int i= 0u; i < 2u; i++ )
958 {
959 ( i == 0u ? first_floor_ : first_ceiling_ )= map_floors_and_ceilings_.size();
960
961 const unsigned char* const src= i == 0u ? map_data.floor_textures : map_data.ceiling_textures;
962
963 for( unsigned int y= 0u; y < MapData::c_map_size; y++ )
964 for( unsigned int x= 0u; x < MapData::c_map_size; x++ )
965 {
966 const unsigned char texture_number= src[ x + y * MapData::c_map_size ];
967
968 if( texture_number == MapData::c_empty_floor_texture_id ||
969 texture_number == MapData::c_sky_floor_texture_id ||
970 texture_number >= MapData::c_floors_textures_count )
971 continue;
972
973 map_floors_and_ceilings_.emplace_back();
974 FloorCeilingCell& cell= map_floors_and_ceilings_.back();
975 cell.xy[0]= x;
976 cell.xy[1]= y;
977 cell.texture_id= texture_number;
978
979 for( SurfacesCache::Surface*& surf_ptr : cell.mips_surfaces )
980 surf_ptr= nullptr;
981 }
982 }
983}
984
985template< bool is_dynamic_wall >
986void MapDrawerSoft::DrawWallSegment(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected