From 0bcbbd0f6879838e1f34ebc83cf4b800cf933b4a Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 19 Oct 2024 21:03:36 +0200 Subject: [PATCH] refactor: get rid of global game variables --- src/Common/Game/IGame.cpp | 26 +++++++++++++++++ src/Common/Game/IGame.h | 10 +++---- src/Common/Game/IW3/GameIW3.cpp | 24 +++++++-------- src/Common/Game/IW3/GameIW3.h | 29 ++++++++++--------- src/Common/Game/IW4/GameIW4.cpp | 24 +++++++-------- src/Common/Game/IW4/GameIW4.h | 29 ++++++++++--------- src/Common/Game/IW5/GameIW5.cpp | 24 +++++++-------- src/Common/Game/IW5/GameIW5.h | 29 ++++++++++--------- src/Common/Game/T5/GameT5.cpp | 24 +++++++-------- src/Common/Game/T5/GameT5.h | 29 ++++++++++--------- src/Common/Game/T6/GameT6.cpp | 24 +++++++-------- src/Common/Game/T6/GameT6.h | 29 ++++++++++--------- src/ObjLoading/Game/T6/ObjLoaderT6.cpp | 2 +- .../Material/MaterialConstantZoneState.cpp | 2 +- .../T6/AssetDumpers/AssetDumperSndBank.cpp | 2 +- .../T6/Material/MaterialConstantZoneState.cpp | 2 +- .../AssetLoaderStringTableTest.cpp | 2 +- .../AssetLoaderStringTableTest.cpp | 2 +- .../Game/IW4/Menu/MenuParsingIW4IT.cpp | 2 +- .../AssetLoaderStringTableTest.cpp | 2 +- .../AssetLoaderStringTableTest.cpp | 2 +- .../AssetLoaderStringTableTest.cpp | 2 +- 22 files changed, 171 insertions(+), 150 deletions(-) create mode 100644 src/Common/Game/IGame.cpp diff --git a/src/Common/Game/IGame.cpp b/src/Common/Game/IGame.cpp new file mode 100644 index 00000000..ad8827db --- /dev/null +++ b/src/Common/Game/IGame.cpp @@ -0,0 +1,26 @@ +#include "IGame.h" + +#include "IW3/GameIW3.h" +#include "IW4/GameIW4.h" +#include "IW5/GameIW5.h" +#include "T5/GameT5.h" +#include "T6/GameT6.h" + +#include + +IGame* IGame::GetGameById(GameId gameId) +{ + static IGame* games[static_cast(GameId::COUNT)]{ + new IW3::Game(), + new IW4::Game(), + new IW5::Game(), + new T5::Game(), + new T6::Game(), + }; + + assert(static_cast(gameId) < static_cast(GameId::COUNT)); + auto* result = games[static_cast(gameId)]; + assert(result); + + return result; +} diff --git a/src/Common/Game/IGame.h b/src/Common/Game/IGame.h index 2fb4b5c6..02419205 100644 --- a/src/Common/Game/IGame.h +++ b/src/Common/Game/IGame.h @@ -36,13 +36,13 @@ class IGame IGame& operator=(const IGame& other) = default; IGame& operator=(IGame&& other) noexcept = default; - virtual GameId GetId() = 0; - virtual std::string GetFullName() = 0; - virtual std::string GetShortName() = 0; + [[nodiscard]] virtual GameId GetId() const = 0; + [[nodiscard]] virtual const std::string& GetFullName() const = 0; + [[nodiscard]] virtual const std::string& GetShortName() const = 0; virtual void AddZone(Zone* zone) = 0; virtual void RemoveZone(Zone* zone) = 0; - virtual std::vector GetZones() = 0; - virtual const std::vector& GetLanguagePrefixes() = 0; + [[nodiscard]] virtual const std::vector& GetZones() const = 0; + [[nodiscard]] virtual const std::vector& GetLanguagePrefixes() const = 0; static IGame* GetGameById(GameId gameId); }; diff --git a/src/Common/Game/IW3/GameIW3.cpp b/src/Common/Game/IW3/GameIW3.cpp index ea8b3840..2c080343 100644 --- a/src/Common/Game/IW3/GameIW3.cpp +++ b/src/Common/Game/IW3/GameIW3.cpp @@ -1,34 +1,32 @@ #include "GameIW3.h" -#include "IW3.h" - #include using namespace IW3; -GameIW3 g_GameIW3; - -GameId GameIW3::GetId() +GameId Game::GetId() const { return GameId::IW3; } -std::string GameIW3::GetFullName() +const std::string& Game::GetFullName() const { - return "Call Of Duty 4: Modern Warfare"; + static std::string fullName = "Call Of Duty 4: Modern Warfare"; + return fullName; } -std::string GameIW3::GetShortName() +const std::string& Game::GetShortName() const { - return "IW3"; + static std::string shortName = "IW3"; + return shortName; } -void GameIW3::AddZone(Zone* zone) +void Game::AddZone(Zone* zone) { m_zones.push_back(zone); } -void GameIW3::RemoveZone(Zone* zone) +void Game::RemoveZone(Zone* zone) { const auto foundEntry = std::ranges::find(m_zones, zone); @@ -36,12 +34,12 @@ void GameIW3::RemoveZone(Zone* zone) m_zones.erase(foundEntry); } -std::vector GameIW3::GetZones() +const std::vector& Game::GetZones() const { return m_zones; } -const std::vector& GameIW3::GetLanguagePrefixes() +const std::vector& Game::GetLanguagePrefixes() const { static std::vector prefixes; return prefixes; diff --git a/src/Common/Game/IW3/GameIW3.h b/src/Common/Game/IW3/GameIW3.h index b212834c..bfd896e6 100644 --- a/src/Common/Game/IW3/GameIW3.h +++ b/src/Common/Game/IW3/GameIW3.h @@ -1,19 +1,20 @@ #pragma once #include "Game/IGame.h" -class GameIW3 final : public IGame +namespace IW3 { -public: - GameId GetId() override; - std::string GetFullName() override; - std::string GetShortName() override; - void AddZone(Zone* zone) override; - void RemoveZone(Zone* zone) override; - std::vector GetZones() override; - const std::vector& GetLanguagePrefixes() override; + class Game final : public IGame + { + public: + [[nodiscard]] GameId GetId() const override; + [[nodiscard]] const std::string& GetFullName() const override; + [[nodiscard]] const std::string& GetShortName() const override; + void AddZone(Zone* zone) override; + void RemoveZone(Zone* zone) override; + [[nodiscard]] const std::vector& GetZones() const override; + [[nodiscard]] const std::vector& GetLanguagePrefixes() const override; -private: - std::vector m_zones; -}; - -extern GameIW3 g_GameIW3; + private: + std::vector m_zones; + }; +} // namespace IW3 diff --git a/src/Common/Game/IW4/GameIW4.cpp b/src/Common/Game/IW4/GameIW4.cpp index 7d825b2c..bb5de03b 100644 --- a/src/Common/Game/IW4/GameIW4.cpp +++ b/src/Common/Game/IW4/GameIW4.cpp @@ -1,34 +1,32 @@ #include "GameIW4.h" -#include "IW4.h" - #include using namespace IW4; -GameIW4 g_GameIW4; - -GameId GameIW4::GetId() +GameId Game::GetId() const { return GameId::IW4; } -std::string GameIW4::GetFullName() +const std::string& Game::GetFullName() const { - return "Call Of Duty: Modern Warfare 2"; + static std::string fullName = "Call Of Duty: Modern Warfare 2"; + return fullName; } -std::string GameIW4::GetShortName() +const std::string& Game::GetShortName() const { - return "IW4"; + static std::string shortName = "IW4"; + return shortName; } -void GameIW4::AddZone(Zone* zone) +void Game::AddZone(Zone* zone) { m_zones.push_back(zone); } -void GameIW4::RemoveZone(Zone* zone) +void Game::RemoveZone(Zone* zone) { const auto foundEntry = std::ranges::find(m_zones, zone); @@ -36,12 +34,12 @@ void GameIW4::RemoveZone(Zone* zone) m_zones.erase(foundEntry); } -std::vector GameIW4::GetZones() +const std::vector& Game::GetZones() const { return m_zones; } -const std::vector& GameIW4::GetLanguagePrefixes() +const std::vector& Game::GetLanguagePrefixes() const { static std::vector prefixes; return prefixes; diff --git a/src/Common/Game/IW4/GameIW4.h b/src/Common/Game/IW4/GameIW4.h index fb335bfa..2f8e6d66 100644 --- a/src/Common/Game/IW4/GameIW4.h +++ b/src/Common/Game/IW4/GameIW4.h @@ -1,19 +1,20 @@ #pragma once #include "Game/IGame.h" -class GameIW4 final : public IGame +namespace IW4 { -public: - GameId GetId() override; - std::string GetFullName() override; - std::string GetShortName() override; - void AddZone(Zone* zone) override; - void RemoveZone(Zone* zone) override; - std::vector GetZones() override; - const std::vector& GetLanguagePrefixes() override; + class Game final : public IGame + { + public: + [[nodiscard]] GameId GetId() const override; + [[nodiscard]] const std::string& GetFullName() const override; + [[nodiscard]] const std::string& GetShortName() const override; + void AddZone(Zone* zone) override; + void RemoveZone(Zone* zone) override; + [[nodiscard]] const std::vector& GetZones() const override; + [[nodiscard]] const std::vector& GetLanguagePrefixes() const override; -private: - std::vector m_zones; -}; - -extern GameIW4 g_GameIW4; + private: + std::vector m_zones; + }; +} // namespace IW4 diff --git a/src/Common/Game/IW5/GameIW5.cpp b/src/Common/Game/IW5/GameIW5.cpp index a82108b5..17581d9b 100644 --- a/src/Common/Game/IW5/GameIW5.cpp +++ b/src/Common/Game/IW5/GameIW5.cpp @@ -1,34 +1,32 @@ #include "GameIW5.h" -#include "IW5.h" - #include using namespace IW5; -GameIW5 g_GameIW5; - -GameId GameIW5::GetId() +GameId Game::GetId() const { return GameId::IW5; } -std::string GameIW5::GetFullName() +const std::string& Game::GetFullName() const { - return "Call Of Duty: Modern Warfare 3"; + static std::string fullName = "Call Of Duty: Modern Warfare 3"; + return fullName; } -std::string GameIW5::GetShortName() +const std::string& Game::GetShortName() const { - return "IW5"; + static std::string shortName = "IW5"; + return shortName; } -void GameIW5::AddZone(Zone* zone) +void Game::AddZone(Zone* zone) { m_zones.push_back(zone); } -void GameIW5::RemoveZone(Zone* zone) +void Game::RemoveZone(Zone* zone) { const auto foundEntry = std::ranges::find(m_zones, zone); @@ -36,12 +34,12 @@ void GameIW5::RemoveZone(Zone* zone) m_zones.erase(foundEntry); } -std::vector GameIW5::GetZones() +const std::vector& Game::GetZones() const { return m_zones; } -const std::vector& GameIW5::GetLanguagePrefixes() +const std::vector& Game::GetLanguagePrefixes() const { static std::vector prefixes; return prefixes; diff --git a/src/Common/Game/IW5/GameIW5.h b/src/Common/Game/IW5/GameIW5.h index 06c87139..2ba464d6 100644 --- a/src/Common/Game/IW5/GameIW5.h +++ b/src/Common/Game/IW5/GameIW5.h @@ -1,19 +1,20 @@ #pragma once #include "Game/IGame.h" -class GameIW5 final : public IGame +namespace IW5 { -public: - GameId GetId() override; - std::string GetFullName() override; - std::string GetShortName() override; - void AddZone(Zone* zone) override; - void RemoveZone(Zone* zone) override; - std::vector GetZones() override; - const std::vector& GetLanguagePrefixes() override; + class Game final : public IGame + { + public: + [[nodiscard]] GameId GetId() const override; + [[nodiscard]] const std::string& GetFullName() const override; + [[nodiscard]] const std::string& GetShortName() const override; + void AddZone(Zone* zone) override; + void RemoveZone(Zone* zone) override; + [[nodiscard]] const std::vector& GetZones() const override; + [[nodiscard]] const std::vector& GetLanguagePrefixes() const override; -private: - std::vector m_zones; -}; - -extern GameIW5 g_GameIW5; + private: + std::vector m_zones; + }; +} // namespace IW5 diff --git a/src/Common/Game/T5/GameT5.cpp b/src/Common/Game/T5/GameT5.cpp index 705f8028..7448b026 100644 --- a/src/Common/Game/T5/GameT5.cpp +++ b/src/Common/Game/T5/GameT5.cpp @@ -1,34 +1,32 @@ #include "GameT5.h" -#include "T5.h" - #include using namespace T5; -GameT5 g_GameT5; - -GameId GameT5::GetId() +GameId Game::GetId() const { return GameId::T5; } -std::string GameT5::GetFullName() +const std::string& Game::GetFullName() const { - return "Call Of Duty: Black Ops"; + static std::string fullName = "Call Of Duty: Black Ops"; + return fullName; } -std::string GameT5::GetShortName() +const std::string& Game::GetShortName() const { - return "T5"; + static std::string shortName = "T5"; + return shortName; } -void GameT5::AddZone(Zone* zone) +void Game::AddZone(Zone* zone) { m_zones.push_back(zone); } -void GameT5::RemoveZone(Zone* zone) +void Game::RemoveZone(Zone* zone) { const auto foundEntry = std::ranges::find(m_zones, zone); @@ -36,12 +34,12 @@ void GameT5::RemoveZone(Zone* zone) m_zones.erase(foundEntry); } -std::vector GameT5::GetZones() +const std::vector& Game::GetZones() const { return m_zones; } -const std::vector& GameT5::GetLanguagePrefixes() +const std::vector& Game::GetLanguagePrefixes() const { static std::vector prefixes{ {GameLanguage::LANGUAGE_ENGLISH, "en_"}, diff --git a/src/Common/Game/T5/GameT5.h b/src/Common/Game/T5/GameT5.h index bf392a7e..43ee7f6f 100644 --- a/src/Common/Game/T5/GameT5.h +++ b/src/Common/Game/T5/GameT5.h @@ -1,19 +1,20 @@ #pragma once #include "Game/IGame.h" -class GameT5 final : public IGame +namespace T5 { -public: - GameId GetId() override; - std::string GetFullName() override; - std::string GetShortName() override; - void AddZone(Zone* zone) override; - void RemoveZone(Zone* zone) override; - std::vector GetZones() override; - const std::vector& GetLanguagePrefixes() override; + class Game final : public IGame + { + public: + [[nodiscard]] GameId GetId() const override; + [[nodiscard]] const std::string& GetFullName() const override; + [[nodiscard]] const std::string& GetShortName() const override; + void AddZone(Zone* zone) override; + void RemoveZone(Zone* zone) override; + [[nodiscard]] const std::vector& GetZones() const override; + [[nodiscard]] const std::vector& GetLanguagePrefixes() const override; -private: - std::vector m_zones; -}; - -extern GameT5 g_GameT5; + private: + std::vector m_zones; + }; +} // namespace T5 diff --git a/src/Common/Game/T6/GameT6.cpp b/src/Common/Game/T6/GameT6.cpp index 10553342..26edc8ce 100644 --- a/src/Common/Game/T6/GameT6.cpp +++ b/src/Common/Game/T6/GameT6.cpp @@ -1,34 +1,32 @@ #include "GameT6.h" -#include "T6.h" - #include using namespace T6; -GameT6 g_GameT6; - -GameId GameT6::GetId() +GameId Game::GetId() const { return GameId::T6; } -std::string GameT6::GetFullName() +const std::string& Game::GetFullName() const { - return "Call Of Duty: Black Ops II"; + static std::string fullName = "Call Of Duty: Black Ops II"; + return fullName; } -std::string GameT6::GetShortName() +const std::string& Game::GetShortName() const { - return "T6"; + static std::string shortName = "T6"; + return shortName; } -void GameT6::AddZone(Zone* zone) +void Game::AddZone(Zone* zone) { m_zones.push_back(zone); } -void GameT6::RemoveZone(Zone* zone) +void Game::RemoveZone(Zone* zone) { const auto foundEntry = std::ranges::find(m_zones, zone); @@ -36,12 +34,12 @@ void GameT6::RemoveZone(Zone* zone) m_zones.erase(foundEntry); } -std::vector GameT6::GetZones() +const std::vector& Game::GetZones() const { return m_zones; } -const std::vector& GameT6::GetLanguagePrefixes() +const std::vector& Game::GetLanguagePrefixes() const { static std::vector prefixes{ {GameLanguage::LANGUAGE_ENGLISH, "en_"}, diff --git a/src/Common/Game/T6/GameT6.h b/src/Common/Game/T6/GameT6.h index f5bb5441..248f2aeb 100644 --- a/src/Common/Game/T6/GameT6.h +++ b/src/Common/Game/T6/GameT6.h @@ -1,19 +1,20 @@ #pragma once #include "Game/IGame.h" -class GameT6 final : public IGame +namespace T6 { -public: - GameId GetId() override; - std::string GetFullName() override; - std::string GetShortName() override; - void AddZone(Zone* zone) override; - void RemoveZone(Zone* zone) override; - std::vector GetZones() override; - const std::vector& GetLanguagePrefixes() override; + class Game final : public IGame + { + public: + [[nodiscard]] GameId GetId() const override; + [[nodiscard]] const std::string& GetFullName() const override; + [[nodiscard]] const std::string& GetShortName() const override; + void AddZone(Zone* zone) override; + void RemoveZone(Zone* zone) override; + [[nodiscard]] const std::vector& GetZones() const override; + [[nodiscard]] const std::vector& GetLanguagePrefixes() const override; -private: - std::vector m_zones; -}; - -extern GameT6 g_GameT6; + private: + std::vector m_zones; + }; +} // namespace T6 diff --git a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp index e272d454..99d48000 100644 --- a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp +++ b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp @@ -288,7 +288,7 @@ namespace T6 std::cout << std::format("Loading common ipaks for zone \"{}\"\n", zone.m_name); LoadIPakForZone(searchPath, "base", zone); - const auto languagePrefixes = g_GameT6.GetLanguagePrefixes(); + const auto& languagePrefixes = IGame::GetGameById(GameId::T6)->GetLanguagePrefixes(); for (const auto& languagePrefix : languagePrefixes) LoadIPakForZone(searchPath, std::format("{}base", languagePrefix.m_prefix), zone); diff --git a/src/ObjWriting/Game/IW5/Material/MaterialConstantZoneState.cpp b/src/ObjWriting/Game/IW5/Material/MaterialConstantZoneState.cpp index 033421f8..fe6d870d 100644 --- a/src/ObjWriting/Game/IW5/Material/MaterialConstantZoneState.cpp +++ b/src/ObjWriting/Game/IW5/Material/MaterialConstantZoneState.cpp @@ -199,7 +199,7 @@ namespace IW5 void MaterialConstantZoneState::ExtractNamesFromZoneInternal() { - for (const auto* zone : g_GameIW5.GetZones()) + for (const auto* zone : IGame::GetGameById(GameId::IW5)->GetZones()) { const auto* iw5AssetPools = dynamic_cast(zone->m_pools.get()); if (!iw5AssetPools) diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp index 10805b9c..a1d47041 100644 --- a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp +++ b/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperSndBank.cpp @@ -201,7 +201,7 @@ namespace public: void Initialize() { - for (const auto& zone : g_GameT6.GetZones()) + for (const auto& zone : IGame::GetGameById(GameId::T6)->GetZones()) { auto& sndBankPool = *dynamic_cast(zone->m_pools.get())->m_sound_bank; for (auto* entry : sndBankPool) diff --git a/src/ObjWriting/Game/T6/Material/MaterialConstantZoneState.cpp b/src/ObjWriting/Game/T6/Material/MaterialConstantZoneState.cpp index 0219063e..5492c775 100644 --- a/src/ObjWriting/Game/T6/Material/MaterialConstantZoneState.cpp +++ b/src/ObjWriting/Game/T6/Material/MaterialConstantZoneState.cpp @@ -473,7 +473,7 @@ namespace T6 void MaterialConstantZoneState::ExtractNamesFromZoneInternal() { - for (const auto* zone : g_GameT6.GetZones()) + for (const auto* zone : IGame::GetGameById(GameId::T6)->GetZones()) { const auto* t6AssetPools = dynamic_cast(zone->m_pools.get()); if (!t6AssetPools) diff --git a/test/ObjLoadingTests/Game/IW3/AssetLoaders/AssetLoaderStringTableTest.cpp b/test/ObjLoadingTests/Game/IW3/AssetLoaders/AssetLoaderStringTableTest.cpp index 339d2871..e3320300 100644 --- a/test/ObjLoadingTests/Game/IW3/AssetLoaders/AssetLoaderStringTableTest.cpp +++ b/test/ObjLoadingTests/Game/IW3/AssetLoaders/AssetLoaderStringTableTest.cpp @@ -20,7 +20,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, &g_GameIW3); + Zone zone("MockZone", 0, IGame::GetGameById(GameId::IW3)); MockAssetLoadingManager assetLoadingManager(zone, searchPath); AssetLoaderStringTable assetLoader; diff --git a/test/ObjLoadingTests/Game/IW4/AssetLoaders/AssetLoaderStringTableTest.cpp b/test/ObjLoadingTests/Game/IW4/AssetLoaders/AssetLoaderStringTableTest.cpp index 5feb8ae0..5dc5769c 100644 --- a/test/ObjLoadingTests/Game/IW4/AssetLoaders/AssetLoaderStringTableTest.cpp +++ b/test/ObjLoadingTests/Game/IW4/AssetLoaders/AssetLoaderStringTableTest.cpp @@ -21,7 +21,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, &g_GameIW4); + Zone zone("MockZone", 0, IGame::GetGameById(GameId::IW4)); MockAssetLoadingManager assetLoadingManager(zone, searchPath); AssetLoaderStringTable assetLoader; diff --git a/test/ObjLoadingTests/Game/IW4/Menu/MenuParsingIW4IT.cpp b/test/ObjLoadingTests/Game/IW4/Menu/MenuParsingIW4IT.cpp index da44d544..195d5621 100644 --- a/test/ObjLoadingTests/Game/IW4/Menu/MenuParsingIW4IT.cpp +++ b/test/ObjLoadingTests/Game/IW4/Menu/MenuParsingIW4IT.cpp @@ -28,7 +28,7 @@ namespace test::game::iw4::menu::parsing::it public: MenuParsingItHelper() - : m_zone("MockZone", 0, &g_GameIW4), + : m_zone("MockZone", 0, IGame::GetGameById(GameId::IW4)), m_manager(m_zone, m_search_path) { } diff --git a/test/ObjLoadingTests/Game/IW5/AssetLoaders/AssetLoaderStringTableTest.cpp b/test/ObjLoadingTests/Game/IW5/AssetLoaders/AssetLoaderStringTableTest.cpp index d921b6fe..27f434c8 100644 --- a/test/ObjLoadingTests/Game/IW5/AssetLoaders/AssetLoaderStringTableTest.cpp +++ b/test/ObjLoadingTests/Game/IW5/AssetLoaders/AssetLoaderStringTableTest.cpp @@ -20,7 +20,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, &g_GameIW5); + Zone zone("MockZone", 0, IGame::GetGameById(GameId::IW5)); MockAssetLoadingManager assetLoadingManager(zone, searchPath); AssetLoaderStringTable assetLoader; diff --git a/test/ObjLoadingTests/Game/T5/AssetLoaders/AssetLoaderStringTableTest.cpp b/test/ObjLoadingTests/Game/T5/AssetLoaders/AssetLoaderStringTableTest.cpp index 0b8b83fe..6d0c1a40 100644 --- a/test/ObjLoadingTests/Game/T5/AssetLoaders/AssetLoaderStringTableTest.cpp +++ b/test/ObjLoadingTests/Game/T5/AssetLoaders/AssetLoaderStringTableTest.cpp @@ -20,7 +20,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, &g_GameT5); + Zone zone("MockZone", 0, IGame::GetGameById(GameId::T5)); MockAssetLoadingManager assetLoadingManager(zone, searchPath); AssetLoaderStringTable assetLoader; diff --git a/test/ObjLoadingTests/Game/T6/AssetLoaders/AssetLoaderStringTableTest.cpp b/test/ObjLoadingTests/Game/T6/AssetLoaders/AssetLoaderStringTableTest.cpp index 7c4a3461..a853c878 100644 --- a/test/ObjLoadingTests/Game/T6/AssetLoaders/AssetLoaderStringTableTest.cpp +++ b/test/ObjLoadingTests/Game/T6/AssetLoaders/AssetLoaderStringTableTest.cpp @@ -20,7 +20,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, &g_GameT6); + Zone zone("MockZone", 0, IGame::GetGameById(GameId::T6)); MockAssetLoadingManager assetLoadingManager(zone, searchPath); AssetLoaderStringTable assetLoader;