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

Function setCurrentGame

TheForceEngine/TFE_Game/saveSystem.cpp:320–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318 }
319
320 void setCurrentGame(GameID id)
321 {
322 char relativeBasePath[TFE_MAX_PATH];
323 TFE_Paths::appendPath(PATH_USER_DOCUMENTS, "Saves/", relativeBasePath);
324 if (!FileUtil::directoryExits(s_gameSavePath))
325 {
326 FileUtil::makeDirectory(relativeBasePath);
327 }
328
329 char relativePath[TFE_MAX_PATH];
330 sprintf(relativePath, "Saves/%s/", TFE_Settings::c_gameName[id]);
331
332 TFE_Paths::appendPath(PATH_USER_DOCUMENTS, relativePath, s_gameSavePath);
333 if (!FileUtil::directoryExits(s_gameSavePath))
334 {
335 FileUtil::makeDirectory(s_gameSavePath);
336 }
337 }
338
339 void setCurrentGame(IGame* game)
340 {

Callers 2

setAppStateFunction · 0.50
mainFunction · 0.50

Calls 3

appendPathFunction · 0.50
directoryExitsFunction · 0.50
makeDirectoryFunction · 0.50

Tested by

no test coverage detected