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

Method LoadModels

PanzerChasm/map_loader.cpp:950–983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

948}
949
950void MapLoader::LoadModels( MapData& map_data )
951{
952 Log::Info( "Loading map models" );
953
954 map_data.models.resize( map_data.models_description.size() );
955
956 Vfs::FileContent file_content;
957 Vfs::FileContent animation_file_content;
958
959 for( unsigned int m= 0u; m < map_data.models.size(); m++ )
960 {
961 const MapData::ModelDescription& model_description= map_data.models_description[m];
962
963 char model_file_path[ MapData::c_max_file_path_size ];
964 std::snprintf( model_file_path, sizeof(model_file_path), "%s%s", models_path_, model_description.file_name );
965 vfs_->ReadFile( model_file_path, file_content );
966
967 if( model_description.animation_file_name[0u] != '\0' )
968 {
969 // TODO - know, why some models animations file names have % prefix.
970 const char* file_name= model_description.animation_file_name;
971 if( file_name[0] == '%' )
972 file_name++;
973
974 char animation_file_path[ MapData::c_max_file_path_size ];
975 std::snprintf( animation_file_path, sizeof(animation_file_path), "%s%s", animations_path_, file_name );
976 vfs_->ReadFile( animation_file_path, animation_file_content );
977 }
978 else
979 animation_file_content.clear();
980
981 LoadModel_o3( file_content, animation_file_content, map_data.models[m] );
982 } // for models
983}
984
985} // namespace PanzerChasm

Callers

nothing calls this directly

Calls 2

LoadModel_o3Function · 0.85
ReadFileMethod · 0.80

Tested by

no test coverage detected