From f339cc8431c0a7b6a4d514599e6fa57a75eb6495 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Fri, 20 Nov 2015 19:34:09 +0000 Subject: Member variable unused so removed it. Leaves one asking *why* the datapath can be inside the game directory. --- src/shared/fallout3info.cpp | 4 ++-- src/shared/fallout3info.h | 2 +- src/shared/falloutnvinfo.cpp | 4 ++-- src/shared/falloutnvinfo.h | 2 +- src/shared/gameinfo.cpp | 20 ++++++++++---------- src/shared/gameinfo.h | 7 +++---- src/shared/oblivioninfo.cpp | 4 ++-- src/shared/oblivioninfo.h | 2 +- src/shared/skyriminfo.cpp | 4 ++-- src/shared/skyriminfo.h | 2 +- 10 files changed, 25 insertions(+), 26 deletions(-) (limited to 'src/shared') diff --git a/src/shared/fallout3info.cpp b/src/shared/fallout3info.cpp index 055d3b38..9c6ad5b9 100644 --- a/src/shared/fallout3info.cpp +++ b/src/shared/fallout3info.cpp @@ -30,8 +30,8 @@ along with Mod Organizer. If not, see . namespace MOShared { -Fallout3Info::Fallout3Info(const std::wstring &moDataDirectory, const std::wstring &gameDirectory) - : GameInfo(moDataDirectory, gameDirectory) +Fallout3Info::Fallout3Info(const std::wstring &gameDirectory) + : GameInfo(gameDirectory) { identifyMyGamesDirectory(L"fallout3"); } diff --git a/src/shared/fallout3info.h b/src/shared/fallout3info.h index d019ee07..51abe073 100644 --- a/src/shared/fallout3info.h +++ b/src/shared/fallout3info.h @@ -69,7 +69,7 @@ public: private: - Fallout3Info(const std::wstring &moDataDirectory, const std::wstring &gameDirectory); + Fallout3Info(const std::wstring &gameDirectory); static bool identifyGame(const std::wstring &searchPath); diff --git a/src/shared/falloutnvinfo.cpp b/src/shared/falloutnvinfo.cpp index 2ddbf055..4601caf5 100644 --- a/src/shared/falloutnvinfo.cpp +++ b/src/shared/falloutnvinfo.cpp @@ -31,8 +31,8 @@ along with Mod Organizer. If not, see . namespace MOShared { -FalloutNVInfo::FalloutNVInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory) - : GameInfo(moDataDirectory, gameDirectory) +FalloutNVInfo::FalloutNVInfo(const std::wstring &gameDirectory) + : GameInfo(gameDirectory) { identifyMyGamesDirectory(L"falloutnv"); } diff --git a/src/shared/falloutnvinfo.h b/src/shared/falloutnvinfo.h index 9a9004ec..59b52323 100644 --- a/src/shared/falloutnvinfo.h +++ b/src/shared/falloutnvinfo.h @@ -102,7 +102,7 @@ public: private: - FalloutNVInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory); + FalloutNVInfo(const std::wstring &gameDirectory); static bool identifyGame(const std::wstring &searchPath); }; diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp index e5e47cdf..703f4a40 100644 --- a/src/shared/gameinfo.cpp +++ b/src/shared/gameinfo.cpp @@ -40,8 +40,8 @@ namespace MOShared { GameInfo* GameInfo::s_Instance = nullptr; -GameInfo::GameInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory) - : m_GameDirectory(gameDirectory), m_OrganizerDataDirectory(moDataDirectory) +GameInfo::GameInfo(const std::wstring &gameDirectory) + : m_GameDirectory(gameDirectory) { atexit(&cleanup); } @@ -87,36 +87,36 @@ void GameInfo::identifyMyGamesDirectory(const std::wstring &file) } -bool GameInfo::identifyGame(const std::wstring &moDataDirectory, const std::wstring &searchPath) +bool GameInfo::identifyGame(const std::wstring &searchPath) { if (OblivionInfo::identifyGame(searchPath)) { - s_Instance = new OblivionInfo(moDataDirectory, searchPath); + s_Instance = new OblivionInfo(searchPath); } else if (Fallout3Info::identifyGame(searchPath)) { - s_Instance = new Fallout3Info(moDataDirectory, searchPath); + s_Instance = new Fallout3Info(searchPath); } else if (FalloutNVInfo::identifyGame(searchPath)) { - s_Instance = new FalloutNVInfo(moDataDirectory, searchPath); + s_Instance = new FalloutNVInfo(searchPath); } else if (SkyrimInfo::identifyGame(searchPath)) { - s_Instance = new SkyrimInfo(moDataDirectory, searchPath); + s_Instance = new SkyrimInfo(searchPath); } return s_Instance != nullptr; } -bool GameInfo::init(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &gamePath) +bool GameInfo::init(const std::wstring &moDirectory, const std::wstring &gamePath) { if (s_Instance == nullptr) { if (gamePath.length() == 0) { // search upward in the directory until a recognized game-binary is found std::wstring searchPath(moDirectory); - while (!identifyGame(moDataDirectory, searchPath)) { + while (!identifyGame(searchPath)) { size_t lastSep = searchPath.find_last_of(L"/\\"); if (lastSep == std::string::npos) { return false; } searchPath.erase(lastSep); } - } else if (!identifyGame(moDataDirectory, gamePath)) { + } else if (!identifyGame(gamePath)) { return false; } } diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h index 1d4b050b..47a5e767 100644 --- a/src/shared/gameinfo.h +++ b/src/shared/gameinfo.h @@ -100,14 +100,14 @@ public: //**USED IN HOOKDLL // initialise with the path to the mo directory (needs to be where hook.dll is stored). This // needs to be called before the instance can be retrieved - static bool init(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &gamePath = L""); + static bool init(const std::wstring &moDirectory, const std::wstring &gamePath = L""); //**USED IN HOOKDLL static GameInfo& instance(); protected: - GameInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory); + GameInfo(const std::wstring &gameDirectory); std::wstring getLocalAppFolder() const; const std::wstring &getMyGamesDirectory() const { return m_MyGamesDirectory; } @@ -115,7 +115,7 @@ protected: private: - static bool identifyGame(const std::wstring &moDataDirectory, const std::wstring &searchPath); + static bool identifyGame(const std::wstring &searchPath); std::wstring getSpecialPath(LPCWSTR name) const; static void cleanup(); @@ -127,7 +127,6 @@ private: std::wstring m_MyGamesDirectory; std::wstring m_GameDirectory; - std::wstring m_OrganizerDataDirectory; }; diff --git a/src/shared/oblivioninfo.cpp b/src/shared/oblivioninfo.cpp index a5760570..4b0a8499 100644 --- a/src/shared/oblivioninfo.cpp +++ b/src/shared/oblivioninfo.cpp @@ -31,8 +31,8 @@ along with Mod Organizer. If not, see . namespace MOShared { -OblivionInfo::OblivionInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory) - : GameInfo(moDataDirectory, gameDirectory) +OblivionInfo::OblivionInfo(const std::wstring &gameDirectory) + : GameInfo(gameDirectory) { identifyMyGamesDirectory(L"oblivion"); } diff --git a/src/shared/oblivioninfo.h b/src/shared/oblivioninfo.h index 0a6c416c..ac10b80a 100644 --- a/src/shared/oblivioninfo.h +++ b/src/shared/oblivioninfo.h @@ -100,7 +100,7 @@ public: private: - OblivionInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory); + OblivionInfo(const std::wstring &gameDirectory); static bool identifyGame(const std::wstring &searchPath); diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp index e122390d..bd901357 100644 --- a/src/shared/skyriminfo.cpp +++ b/src/shared/skyriminfo.cpp @@ -33,8 +33,8 @@ along with Mod Organizer. If not, see . namespace MOShared { -SkyrimInfo::SkyrimInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory) - : GameInfo(moDataDirectory, gameDirectory) +SkyrimInfo::SkyrimInfo(const std::wstring &gameDirectory) + : GameInfo(gameDirectory) { identifyMyGamesDirectory(L"skyrim"); diff --git a/src/shared/skyriminfo.h b/src/shared/skyriminfo.h index f52be73a..65977a69 100644 --- a/src/shared/skyriminfo.h +++ b/src/shared/skyriminfo.h @@ -68,7 +68,7 @@ public: private: - SkyrimInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory); + SkyrimInfo(const std::wstring &gameDirectory); static bool identifyGame(const std::wstring &searchPath); -- cgit v1.3.1