diff options
author | krzys-h <krzys_h@interia.pl> | 2013-03-27 20:24:05 +0100 |
---|---|---|
committer | krzys-h <krzys_h@interia.pl> | 2013-03-27 20:24:05 +0100 |
commit | 3402219438d3a3e92150d9183de981ddfa803f00 (patch) | |
tree | 581b6424e8fffcbe6237292980a9479a6e8d663b /src/app/system_windows.cpp | |
parent | 8f379e5cf12a35ca9a32f34f85f42765c53cba47 (diff) | |
download | colobot-3402219438d3a3e92150d9183de981ddfa803f00.tar.gz colobot-3402219438d3a3e92150d9183de981ddfa803f00.tar.bz2 colobot-3402219438d3a3e92150d9183de981ddfa803f00.zip |
Changed savegame & profile dir on Windows
Diffstat (limited to 'src/app/system_windows.cpp')
-rw-r--r-- | src/app/system_windows.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/app/system_windows.cpp b/src/app/system_windows.cpp index 780afef..870683f 100644 --- a/src/app/system_windows.cpp +++ b/src/app/system_windows.cpp @@ -110,3 +110,39 @@ std::wstring CSystemUtilsWindows::UTF8_Decode(const std::string& str) return wstrTo; } + +std::string CSystemUtilsWindows::profileFileLocation() +{ + std::string m_profileFile; + + char* envUSERPROFILE = getenv("USERPROFILE"); + if (envUSERPROFILE == NULL) + { + m_profileFile = "colobot.ini"; + } + else + { + m_profileFile = std::string(envUSERPROFILE) + "\\colobot\\colobot.ini"; + } + GetLogger()->Trace("Profile configuration is %s\n", m_profileFile.c_str()); + + return m_profileFile; +} + +std::string CSystemUtilsWindows::savegameDirectoryLocation() +{ + std::string m_savegameDir; + + char* envUSERPROFILE = getenv("USERPROFILE"); + if (envUSERPROFILE == NULL) + { + m_savegameDir = "savegame"; + } + else + { + m_savegameDir = std::string(envUSERPROFILE) + "\\colobot\\savegame"; + } + GetLogger()->Trace("Saved game files are going to %s\n", m_savegameDir.c_str()); + + return m_savegameDir; +}
\ No newline at end of file |