diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/app.cpp | 10 | ||||
-rw-r--r-- | src/app/app.h | 3 | ||||
-rw-r--r-- | src/app/system_other.cpp | 2 | ||||
-rw-r--r-- | src/app/system_other.h | 3 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp index f98e0fc..d2994a9 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -110,6 +110,7 @@ CApplication::CApplication() m_exitCode = 0; m_active = false; m_debugModes = 0; + m_customDataPath = false; m_windowTitle = "COLOBOT"; @@ -344,7 +345,8 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[]) case OPT_DATADIR: { m_dataPath = optarg; - GetLogger()->Info("Using custom data dir: '%s'\n", m_dataPath.c_str()); + m_customDataPath = true; + GetLogger()->Info("Using custom datadir or running mod: '%s'\n", m_dataPath.c_str()); break; } case OPT_LANGDIR: @@ -404,7 +406,7 @@ bool CApplication::Create() } else { - if (GetProfile().GetLocalProfileString("Resources", "Data", path)) + if (!m_customDataPath && GetProfile().GetLocalProfileString("Resources", "Data", path)) m_dataPath = path; } @@ -440,7 +442,7 @@ bool CApplication::Create() GetProfile().SetLocalProfileString("Resources", "Music", GetDataSubdirPath(DIR_MUSIC)); } - if (GetProfile().GetLocalProfileString("Resources", "Sound", path)) + if (!m_customDataPath && GetProfile().GetLocalProfileString("Resources", "Sound", path)) { m_sound->CacheAll(path); } @@ -449,7 +451,7 @@ bool CApplication::Create() m_sound->CacheAll(GetDataSubdirPath(DIR_SOUND)); } - if (GetProfile().GetLocalProfileString("Resources", "Music", path)) + if (!m_customDataPath && GetProfile().GetLocalProfileString("Resources", "Music", path)) { m_sound->AddMusicFiles(path); } diff --git a/src/app/app.h b/src/app/app.h index 269fa9b..6b02f67 100644 --- a/src/app/app.h +++ b/src/app/app.h @@ -480,6 +480,9 @@ protected: //! Path to directory with data files std::string m_dataPath; + //! True if datadir was passed in command line + bool m_customDataPath; + //! Path to directory with language files std::string m_langPath; diff --git a/src/app/system_other.cpp b/src/app/system_other.cpp index da81a6d..9d9f76a 100644 --- a/src/app/system_other.cpp +++ b/src/app/system_other.cpp @@ -33,7 +33,7 @@ long long int CSystemUtilsOther::GetTimeStampExactResolution() return 1000000ll; } -long long int CSystemUtilsOther::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after) const +long long int CSystemUtilsOther::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after) { return (after->sdlTicks - before->sdlTicks) * 1000000ll; } diff --git a/src/app/system_other.h b/src/app/system_other.h index b10a326..7eccf3f 100644 --- a/src/app/system_other.h +++ b/src/app/system_other.h @@ -40,10 +40,11 @@ struct SystemTimeStamp class CSystemUtilsOther : public CSystemUtils { public: + virtual void Init() {}; virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) override; virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) override; - virtual long long GetTimeStampExactResolution() override; + virtual long long int GetTimeStampExactResolution() override; virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) override; }; |