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

Method LoadWalls

PanzerChasm/client/map_drawer_soft.cpp:874–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

872}
873
874void MapDrawerSoft::LoadWalls( const MapData& map_data )
875{
876 static_walls_ .resize( map_data.static_walls .size() );
877 dynamic_walls_.resize( map_data.dynamic_walls.size() );
878
879 const auto setup_wall=
880 []( const MapData::Wall& in_wall, DrawWall& out_wall ) -> void
881 {
882 out_wall.surface_width= static_cast<unsigned int>( 128.0f * in_wall.vert_tex_coord[0] );
883 PC_ASSERT( out_wall.surface_width == 64u || out_wall.surface_width == 128u );
884
885 out_wall.texture_id= in_wall.texture_id;
886 std::memcpy( out_wall.lightmap, in_wall.lightmap, 8u );
887
888 for( SurfacesCache::Surface*& surf_ptr : out_wall.mips_surfaces )
889 surf_ptr= nullptr;
890 };
891
892 for( unsigned int i= 0u; i < static_walls_ .size(); i++ )
893 setup_wall( map_data.static_walls [i], static_walls_ [i] );
894
895 for( unsigned int i= 0u; i < dynamic_walls_.size(); i++ )
896 setup_wall( map_data.dynamic_walls[i], dynamic_walls_[i] );
897}
898
899MapDrawerSoft::TextureView MapDrawerSoft::GetPlayerTexture( const unsigned char color )
900{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected