Changed savegame & profile dir on Windows
parent
8f379e5cf1
commit
3402219438
|
@ -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;
|
||||
}
|
|
@ -44,6 +44,9 @@ public:
|
|||
virtual long long GetTimeStampExactResolution() override;
|
||||
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) override;
|
||||
|
||||
virtual std::string profileFileLocation() override;
|
||||
virtual std::string savegameDirectoryLocation() override;
|
||||
|
||||
private:
|
||||
std::string UTF8_Encode(const std::wstring &wstr);
|
||||
std::wstring UTF8_Decode(const std::string &str);
|
||||
|
|
Loading…
Reference in New Issue