| 512 | } |
| 513 | |
| 514 | void MapLoader::LoadModelsDescription( const Vfs::FileContent& resource_file, MapData& map_data ) |
| 515 | { |
| 516 | const char* start= GetSubstring( reinterpret_cast<const char*>( resource_file.data() ), "#newobjects" ); |
| 517 | |
| 518 | while( *start != '\n' ) start++; |
| 519 | start++; |
| 520 | |
| 521 | const char* const end= GetSubstring( start, "#end" ); |
| 522 | |
| 523 | std::istringstream stream( std::string( start, end ) ); |
| 524 | |
| 525 | while( !stream.eof() ) |
| 526 | { |
| 527 | char line[ 512u ]; |
| 528 | stream.getline( line, sizeof(line), '\n' ); |
| 529 | |
| 530 | if( stream.eof() ) |
| 531 | break; |
| 532 | |
| 533 | std::istringstream line_stream{ std::string( line ) }; |
| 534 | |
| 535 | map_data.models_description.emplace_back(); |
| 536 | MapData::ModelDescription& model_description= map_data.models_description.back(); |
| 537 | |
| 538 | line_stream >> model_description.radius; // GoRad |
| 539 | |
| 540 | int shadow= 0; |
| 541 | line_stream >> shadow; // Shad |
| 542 | model_description.cast_shadow= shadow != 0; // Stream fails if number is not zero or not one |
| 543 | |
| 544 | line_stream >> model_description.bobj; // BObj |
| 545 | line_stream >> model_description.bmpz; // BMPz |
| 546 | line_stream >> model_description.ac; // AC |
| 547 | line_stream >> model_description.blow_effect; // Blw |
| 548 | line_stream >> model_description.break_limit; // BLmt |
| 549 | line_stream >> model_description.ambient_sfx_number; // SFX |
| 550 | line_stream >> model_description.break_sfx_number; // BSfx |
| 551 | |
| 552 | line_stream >> model_description.file_name; // FileName |
| 553 | |
| 554 | model_description.animation_file_name[0u]= '\0'; |
| 555 | line_stream >> model_description.animation_file_name; |
| 556 | |
| 557 | model_description.radius*= g_map_coords_scale; |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | void MapLoader::LoadWallsTexturesDescription( const Vfs::FileContent& resource_file, MapData& map_data ) |
| 562 | { |
nothing calls this directly
no test coverage detected