MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / loadReplayFromPath

Function loadReplayFromPath

TheForceEngine/TFE_Input/replay.cpp:983–1007  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

981 }
982
983 void loadReplayFromPath(const char * sourceReplayPath)
984 {
985 char replayPath[TFE_MAX_PATH];
986 sprintf(replayPath, "%s", sourceReplayPath);
987
988 FileUtil::fixupPath(replayPath);
989
990 if (!FileUtil::exists(replayPath))
991 {
992 TFE_System::logWrite(LOG_MSG, "Replay", "Replay file does not exist: %s . Exiting...", replayPath);
993 TFE_FrontEndUI::setState(APP_STATE_QUIT);
994 return;
995 }
996
997 // Always set this to false as we are loading a replay from path
998 alwaysRecord = TFE_Settings::getGameSettings()->df_enableRecordingAll;
999 TFE_Settings::getGameSettings()->df_enableRecordingAll = false;
1000
1001 TFE_SaveSystem::SaveHeader header;
1002 loadReplayHeader(replayPath, &header);
1003
1004 TFE_DarkForces::enableCutscenes(false);
1005
1006 loadReplayWrapper(replayPath, header.modNames, header.levelId);
1007 }
1008
1009 // This is a replay wrapper that handles agents and replay configuration
1010 void loadReplayWrapper(string replayFile, string modName, string levelId)

Callers 1

parseOptionFunction · 0.85

Calls 8

logWriteFunction · 0.85
setStateFunction · 0.85
getGameSettingsFunction · 0.85
loadReplayHeaderFunction · 0.85
enableCutscenesFunction · 0.85
loadReplayWrapperFunction · 0.85
fixupPathFunction · 0.50
existsFunction · 0.50

Tested by

no test coverage detected