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

Function initReplays

TheForceEngine/TFE_Input/replay.cpp:91–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 };
90
91 void initReplays()
92 {
93 // TO DO - combine replays from both sources.
94
95 sprintf(s_replayDir, "%sReplays/", TFE_Paths::getPath(PATH_PROGRAM));
96 TFE_Paths::fixupPathAsDirectory(s_replayDir);
97
98 // Check TFE/Replays first
99 if (!FileUtil::directoryExits(s_replayDir))
100 {
101 sprintf(s_replayDir, "%sReplays/", TFE_Paths::getPath(PATH_USER_DOCUMENTS));
102 TFE_Paths::fixupPathAsDirectory(s_replayDir);
103 // Otherwise check <USER>/TheForceEngine/Replays
104 if (!FileUtil::directoryExits(s_replayDir))
105 {
106 FileUtil::makeDirectory(s_replayDir);
107 }
108 }
109 else
110 {
111 sprintf(s_replayAgentPath, "%sreplay.agent", TFE_Paths::getPath(PATH_USER_DOCUMENTS));
112 }
113 TFE_System::logWrite(LOG_MSG, "Replay", "Loading Replays from %s ...", s_replayDir);
114
115 if (TFE_Settings::getGameSettings()->df_enableRecordingAll)
116 {
117 TFE_Settings::getGameSettings()->df_enableRecording = true;
118 }
119 }
120
121 bool shouldLogReplay()
122 {

Callers 1

mainFunction · 0.85

Calls 6

logWriteFunction · 0.85
getGameSettingsFunction · 0.85
getPathFunction · 0.50
fixupPathAsDirectoryFunction · 0.50
directoryExitsFunction · 0.50
makeDirectoryFunction · 0.50

Tested by

no test coverage detected