| 530 | } |
| 531 | |
| 532 | bool LoadReplayDataMap(ReplayRecordData& data) |
| 533 | { |
| 534 | try |
| 535 | { |
| 536 | data.parkData.SetPosition(0); |
| 537 | |
| 538 | auto context = GetContext(); |
| 539 | auto& objManager = context->GetObjectManager(); |
| 540 | auto importer = ParkImporter::CreateParkFile(context->GetObjectRepository()); |
| 541 | |
| 542 | auto loadResult = importer->LoadFromStream(&data.parkData, false); |
| 543 | objManager.LoadObjects(loadResult.RequiredObjects); |
| 544 | |
| 545 | // TODO: Have a separate GameState and exchange once loaded. |
| 546 | auto& gameState = getGameState(); |
| 547 | importer->Import(gameState); |
| 548 | |
| 549 | EntityTweener::Get().Reset(); |
| 550 | |
| 551 | // Load all map global variables. |
| 552 | DataSerialiser parkParamsDs(false, data.parkParams); |
| 553 | SerialiseParkParameters(parkParamsDs); |
| 554 | |
| 555 | GameLoadInit(); |
| 556 | FixInvalidVehicleSpriteSizes(); |
| 557 | } |
| 558 | catch (const std::exception& ex) |
| 559 | { |
| 560 | LOG_ERROR("Exception: %s", ex.what()); |
| 561 | return false; |
| 562 | } |
| 563 | return true; |
| 564 | } |
| 565 | |
| 566 | /** |
| 567 | * Returns true if decompression was not needed or succeeded |
nothing calls this directly
no test coverage detected