MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / LoadReplayDataMap

Method LoadReplayDataMap

src/openrct2/ReplayManager.cpp:532–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 9

GetContextFunction · 0.85
GameLoadInitFunction · 0.85
LoadObjectsMethod · 0.80
SetPositionMethod · 0.45
LoadFromStreamMethod · 0.45
ImportMethod · 0.45
ResetMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected