diff --git a/src/Common/Game/GameVariant.cpp b/src/Common/Game/GameVariant.cpp new file mode 100644 index 00000000..f57b4ba4 --- /dev/null +++ b/src/Common/Game/GameVariant.cpp @@ -0,0 +1,73 @@ +#include "GameVariant.h" + +#include +#include + +GameVariant::GameVariant( + const GameVariantId id, const GameId gameId, std::string name, const GameEndianness endianness, const GameWordSize wordSize, const GamePlatform platform) + : m_id(id), + m_game_id(gameId), + m_name(std::move(name)), + m_endianness(endianness), + m_word_size(wordSize), + m_platform(platform) +{ +} + +GameVariantId GameVariant::GetId() const +{ + return m_id; +} + +GameId GameVariant::GetGameId() const +{ + return m_game_id; +} + +const std::string& GameVariant::GetName() const +{ + return m_name; +} + +GameEndianness GameVariant::GetEndianness() const +{ + return m_endianness; +} + +GameWordSize GameVariant::GetWordSize() const +{ + return m_word_size; +} + +GamePlatform GameVariant::GetPlatform() const +{ + return m_platform; +} + +IGameVariant* IGameVariant::GetVariantById(const GameVariantId variantId) +{ + static IGameVariant* variants[]{ + new GameVariant(GameVariantId::IW3_PC, GameId::IW3, "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), + new GameVariant(GameVariantId::IW3_XBOX, GameId::IW3, "xbox", GameEndianness::BE, GameWordSize::ARCH_32, GamePlatform::XBOX), + new GameVariant(GameVariantId::IW4_PC32, GameId::IW4, "pc32", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), + new GameVariant(GameVariantId::IW4_PC64, GameId::IW4, "pc64", GameEndianness::LE, GameWordSize::ARCH_64, GamePlatform::PC), + new GameVariant(GameVariantId::IW4_XBOX, GameId::IW4, "xbox", GameEndianness::BE, GameWordSize::ARCH_32, GamePlatform::XBOX), + new GameVariant(GameVariantId::IW5_PC32, GameId::IW5, "pc32", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), + new GameVariant(GameVariantId::IW5_PC64, GameId::IW5, "pc64", GameEndianness::LE, GameWordSize::ARCH_64, GamePlatform::PC), + new GameVariant(GameVariantId::IW5_XBOX, GameId::IW5, "xbox", GameEndianness::BE, GameWordSize::ARCH_32, GamePlatform::XBOX), + new GameVariant(GameVariantId::QOS_PC, GameId::QOS, "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), + new GameVariant(GameVariantId::T4_PC, GameId::T4, "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), + new GameVariant(GameVariantId::T5_PC, GameId::T5, "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), + new GameVariant(GameVariantId::T6_PC, GameId::T6, "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), + new GameVariant(GameVariantId::T6_XBOX, GameId::T6, "xbox", GameEndianness::BE, GameWordSize::ARCH_32, GamePlatform::XBOX), + new GameVariant(GameVariantId::T6_PS3, GameId::T6, "ps3", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PS3), + new GameVariant(GameVariantId::T6_WIIU, GameId::T6, "wiiu", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::WIIU), + }; + static_assert(std::size(variants) == std::to_underlying(GameVariantId::COUNT)); + + assert(std::to_underlying(variantId) < std::to_underlying(GameVariantId::COUNT)); + auto* result = variants[std::to_underlying(variantId)]; + assert(result); + + return result; +} diff --git a/src/Common/Game/GameVariant.h b/src/Common/Game/GameVariant.h new file mode 100644 index 00000000..6e9e24e4 --- /dev/null +++ b/src/Common/Game/GameVariant.h @@ -0,0 +1,96 @@ +#pragma once + +#include "IGame.h" + +#include +#include + +/* + * A game variant is a specific game version or platform files are created for. + * This determines the layout of the structs, endianness/wordsize in the zone and informs about the target platform. + */ +enum class GameVariantId : std::uint8_t +{ + IW3_PC, + IW3_XBOX, + IW4_PC32, + IW4_PC64, + IW4_XBOX, + IW5_PC32, + IW5_PC64, + IW5_XBOX, + QOS_PC, + T4_PC, + T5_PC, + T6_PC, + T6_XBOX, + T6_PS3, + T6_WIIU, + + COUNT +}; + +// The full uppercase names are macros in the standard lib +// So unfortunately not usable as values in the enum +enum class GameEndianness : std::uint8_t +{ + /* Little endian */ + LE, + /* Big endian */ + BE +}; + +enum class GameWordSize : std::uint8_t +{ + ARCH_32, + ARCH_64 +}; + +enum class GamePlatform : std::uint8_t +{ + PC, + XBOX, + PS3, + WIIU +}; + +class IGameVariant +{ +public: + IGameVariant() = default; + virtual ~IGameVariant() = default; + IGameVariant(const IGameVariant& other) = default; + IGameVariant(IGameVariant&& other) noexcept = default; + IGameVariant& operator=(const IGameVariant& other) = default; + IGameVariant& operator=(IGameVariant&& other) noexcept = default; + + static IGameVariant* GetVariantById(GameVariantId variantId); + + [[nodiscard]] virtual GameVariantId GetId() const = 0; + [[nodiscard]] virtual GameId GetGameId() const = 0; + [[nodiscard]] virtual const std::string& GetName() const = 0; + [[nodiscard]] virtual GameEndianness GetEndianness() const = 0; + [[nodiscard]] virtual GameWordSize GetWordSize() const = 0; + [[nodiscard]] virtual GamePlatform GetPlatform() const = 0; +}; + +class GameVariant : public IGameVariant +{ +public: + GameVariant(GameVariantId id, GameId gameId, std::string name, GameEndianness endianness, GameWordSize wordSize, GamePlatform platform); + + [[nodiscard]] GameVariantId GetId() const override; + [[nodiscard]] GameId GetGameId() const override; + [[nodiscard]] const std::string& GetName() const override; + [[nodiscard]] GameEndianness GetEndianness() const override; + [[nodiscard]] GameWordSize GetWordSize() const override; + [[nodiscard]] GamePlatform GetPlatform() const override; + +private: + GameVariantId m_id; + GameId m_game_id; + std::string m_name; + GameEndianness m_endianness; + GameWordSize m_word_size; + GamePlatform m_platform; +}; diff --git a/src/Common/Game/IGame.cpp b/src/Common/Game/IGame.cpp index 8a9eb9ee..9ea0e5b8 100644 --- a/src/Common/Game/IGame.cpp +++ b/src/Common/Game/IGame.cpp @@ -11,41 +11,7 @@ #include -GameVariant::GameVariant(const GameVariantId id, std::string name, const GameEndianness endianness, const GameWordSize wordSize, const GamePlatform platform) - : m_id(id), - m_name(std::move(name)), - m_endianness(endianness), - m_word_size(wordSize), - m_platform(platform) -{ -} - -GameVariantId GameVariant::GetId() const -{ - return m_id; -} - -const std::string& GameVariant::GetName() const -{ - return m_name; -} - -GameEndianness GameVariant::GetEndianness() const -{ - return m_endianness; -} - -GameWordSize GameVariant::GetWordSize() const -{ - return m_word_size; -} - -GamePlatform GameVariant::GetPlatform() const -{ - return m_platform; -} - -IGame* IGame::GetGameById(GameId gameId) +IGame* IGame::GetGameById(const GameId gameId) { static IGame* games[]{ new IW3::Game(), @@ -87,15 +53,6 @@ const std::vector& AbstractGame::GetLanguagePrefixes() const return prefixes; } -const IGameVariant* AbstractGame::GetVariantById(const GameVariantId id) const -{ - const auto& variants = GetVariants(); - - assert(id < variants.size()); - - return variants[id]; -} - asset_type_t AbstractGame::GetAssetTypeCount() const { return m_asset_type_count; diff --git a/src/Common/Game/IGame.h b/src/Common/Game/IGame.h index 2e4011a3..1b19bf4b 100644 --- a/src/Common/Game/IGame.h +++ b/src/Common/Game/IGame.h @@ -6,7 +6,6 @@ #include #include -#include #include #include @@ -23,79 +22,6 @@ enum class GameId : std::uint8_t COUNT }; -typedef std::uint8_t GameVariantId; - -// The full uppercase names are macros in the standard lib -// So unfortunately not usable as values in the enum -enum class GameEndianness : std::uint8_t -{ - /* Little endian */ - LE, - /* Big endian */ - BE -}; - -enum class GameWordSize : std::uint8_t -{ - ARCH_32, - ARCH_64 -}; - -enum class GamePlatform : std::uint8_t -{ - PC, - XBOX, - PS3, - WIIU -}; - -static constexpr const char* GameId_Names[]{ - "IW3", - "IW4", - "IW5", - "QOS", - "T4", - "T5", - "T6", -}; -static_assert(std::extent_v == static_cast(GameId::COUNT)); - -class IGameVariant -{ -public: - IGameVariant() = default; - virtual ~IGameVariant() = default; - IGameVariant(const IGameVariant& other) = default; - IGameVariant(IGameVariant&& other) noexcept = default; - IGameVariant& operator=(const IGameVariant& other) = default; - IGameVariant& operator=(IGameVariant&& other) noexcept = default; - - [[nodiscard]] virtual GameVariantId GetId() const = 0; - [[nodiscard]] virtual const std::string& GetName() const = 0; - [[nodiscard]] virtual GameEndianness GetEndianness() const = 0; - [[nodiscard]] virtual GameWordSize GetWordSize() const = 0; - [[nodiscard]] virtual GamePlatform GetPlatform() const = 0; -}; - -class GameVariant : public IGameVariant -{ -public: - GameVariant(GameVariantId id, std::string name, GameEndianness endianness, GameWordSize wordSize, GamePlatform platform); - - [[nodiscard]] GameVariantId GetId() const override; - [[nodiscard]] const std::string& GetName() const override; - [[nodiscard]] GameEndianness GetEndianness() const override; - [[nodiscard]] GameWordSize GetWordSize() const override; - [[nodiscard]] GamePlatform GetPlatform() const override; - -private: - GameVariantId m_id; - std::string m_name; - GameEndianness m_endianness; - GameWordSize m_word_size; - GamePlatform m_platform; -}; - class IGame { public: @@ -111,9 +37,6 @@ public: [[nodiscard]] virtual const std::string& GetShortName() const = 0; [[nodiscard]] virtual const std::vector& GetLanguagePrefixes() const = 0; - [[nodiscard]] virtual const IGameVariant* GetVariantById(GameVariantId id) const = 0; - [[nodiscard]] virtual const std::vector& GetVariants() const = 0; - [[nodiscard]] virtual asset_type_t GetAssetTypeCount() const = 0; [[nodiscard]] virtual std::optional GetAssetTypeName(asset_type_t assetType) const = 0; [[nodiscard]] virtual std::optional FindAssetTypeByName(const std::string& potentialAssetTypeName) const = 0; @@ -131,8 +54,6 @@ public: [[nodiscard]] const std::vector& GetLanguagePrefixes() const override; - [[nodiscard]] const IGameVariant* GetVariantById(GameVariantId id) const override; - [[nodiscard]] asset_type_t GetAssetTypeCount() const override; [[nodiscard]] std::optional GetAssetTypeName(asset_type_t assetType) const override; [[nodiscard]] std::optional FindAssetTypeByName(const std::string& potentialAssetTypeName) const override; diff --git a/src/Common/Game/IW3/GameIW3.cpp b/src/Common/Game/IW3/GameIW3.cpp index d1ccf75b..e05a927d 100644 --- a/src/Common/Game/IW3/GameIW3.cpp +++ b/src/Common/Game/IW3/GameIW3.cpp @@ -51,12 +51,4 @@ namespace IW3 static std::string shortName = "IW3"; return shortName; } - - const std::vector& Game::GetVariants() const - { - static std::vector variants = { - new GameVariant(std::to_underlying(VariantId::PC), "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), - }; - return variants; - } } // namespace IW3 diff --git a/src/Common/Game/IW3/GameIW3.h b/src/Common/Game/IW3/GameIW3.h index 724e3bdd..0c238743 100644 --- a/src/Common/Game/IW3/GameIW3.h +++ b/src/Common/Game/IW3/GameIW3.h @@ -4,11 +4,6 @@ namespace IW3 { - enum class VariantId : std::uint8_t - { - PC, - }; - class Game final : public AbstractGame { public: @@ -17,6 +12,5 @@ namespace IW3 [[nodiscard]] GameId GetId() const override; [[nodiscard]] const std::string& GetFullName() const override; [[nodiscard]] const std::string& GetShortName() const override; - [[nodiscard]] const std::vector& GetVariants() const override; }; } // namespace IW3 diff --git a/src/Common/Game/IW4/GameIW4.cpp b/src/Common/Game/IW4/GameIW4.cpp index d485d475..4050f474 100644 --- a/src/Common/Game/IW4/GameIW4.cpp +++ b/src/Common/Game/IW4/GameIW4.cpp @@ -54,13 +54,4 @@ namespace IW4 static std::string shortName = "IW4"; return shortName; } - - const std::vector& Game::GetVariants() const - { - static std::vector variants = { - new GameVariant(std::to_underlying(VariantId::PC32), "pc32", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), - new GameVariant(std::to_underlying(VariantId::PC32), "pc64", GameEndianness::LE, GameWordSize::ARCH_64, GamePlatform::PC), - }; - return variants; - } } // namespace IW4 diff --git a/src/Common/Game/IW4/GameIW4.h b/src/Common/Game/IW4/GameIW4.h index 1bf2d8d6..ae94a3be 100644 --- a/src/Common/Game/IW4/GameIW4.h +++ b/src/Common/Game/IW4/GameIW4.h @@ -4,12 +4,6 @@ namespace IW4 { - enum class VariantId : std::uint8_t - { - PC32, - PC64, - }; - class Game final : public AbstractGame { public: @@ -18,6 +12,5 @@ namespace IW4 [[nodiscard]] GameId GetId() const override; [[nodiscard]] const std::string& GetFullName() const override; [[nodiscard]] const std::string& GetShortName() const override; - [[nodiscard]] const std::vector& GetVariants() const override; }; } // namespace IW4 diff --git a/src/Common/Game/IW5/GameIW5.cpp b/src/Common/Game/IW5/GameIW5.cpp index 484535da..5d0b6ff0 100644 --- a/src/Common/Game/IW5/GameIW5.cpp +++ b/src/Common/Game/IW5/GameIW5.cpp @@ -90,13 +90,4 @@ namespace IW5 static std::string shortName = "IW5"; return shortName; } - - const std::vector& Game::GetVariants() const - { - static std::vector variants = { - new GameVariant(std::to_underlying(VariantId::PC32), "pc32", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), - new GameVariant(std::to_underlying(VariantId::PC32), "pc64", GameEndianness::LE, GameWordSize::ARCH_64, GamePlatform::PC), - }; - return variants; - } } // namespace IW5 diff --git a/src/Common/Game/IW5/GameIW5.h b/src/Common/Game/IW5/GameIW5.h index c5399e6a..73c9d765 100644 --- a/src/Common/Game/IW5/GameIW5.h +++ b/src/Common/Game/IW5/GameIW5.h @@ -4,12 +4,6 @@ namespace IW5 { - enum class VariantId : std::uint8_t - { - PC32, - PC64, - }; - class Game final : public AbstractGame { public: @@ -18,6 +12,5 @@ namespace IW5 [[nodiscard]] GameId GetId() const override; [[nodiscard]] const std::string& GetFullName() const override; [[nodiscard]] const std::string& GetShortName() const override; - [[nodiscard]] const std::vector& GetVariants() const override; }; } // namespace IW5 diff --git a/src/Common/Game/QOS/GameQOS.cpp b/src/Common/Game/QOS/GameQOS.cpp index 5bc4e378..5d7dd20c 100644 --- a/src/Common/Game/QOS/GameQOS.cpp +++ b/src/Common/Game/QOS/GameQOS.cpp @@ -85,12 +85,4 @@ namespace QOS static std::string shortName = "QOS"; return shortName; } - - const std::vector& Game::GetVariants() const - { - static std::vector variants = { - new GameVariant(std::to_underlying(VariantId::PC), "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), - }; - return variants; - } } // namespace QOS diff --git a/src/Common/Game/QOS/GameQOS.h b/src/Common/Game/QOS/GameQOS.h index 708e7990..6314e00e 100644 --- a/src/Common/Game/QOS/GameQOS.h +++ b/src/Common/Game/QOS/GameQOS.h @@ -4,11 +4,6 @@ namespace QOS { - enum class VariantId : std::uint8_t - { - PC, - }; - class Game final : public AbstractGame { public: @@ -17,6 +12,5 @@ namespace QOS [[nodiscard]] GameId GetId() const override; [[nodiscard]] const std::string& GetFullName() const override; [[nodiscard]] const std::string& GetShortName() const override; - [[nodiscard]] const std::vector& GetVariants() const override; }; } // namespace QOS diff --git a/src/Common/Game/T4/GameT4.cpp b/src/Common/Game/T4/GameT4.cpp index 605718f6..8066cb09 100644 --- a/src/Common/Game/T4/GameT4.cpp +++ b/src/Common/Game/T4/GameT4.cpp @@ -92,12 +92,4 @@ namespace T4 static std::string shortName = "T4"; return shortName; } - - const std::vector& Game::GetVariants() const - { - static std::vector variants = { - new GameVariant(std::to_underlying(VariantId::PC), "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), - }; - return variants; - } } // namespace T4 diff --git a/src/Common/Game/T4/GameT4.h b/src/Common/Game/T4/GameT4.h index 6dbb5a21..fb7fc691 100644 --- a/src/Common/Game/T4/GameT4.h +++ b/src/Common/Game/T4/GameT4.h @@ -4,11 +4,6 @@ namespace T4 { - enum class VariantId : std::uint8_t - { - PC, - }; - class Game final : public AbstractGame { public: @@ -17,6 +12,5 @@ namespace T4 [[nodiscard]] GameId GetId() const override; [[nodiscard]] const std::string& GetFullName() const override; [[nodiscard]] const std::string& GetShortName() const override; - [[nodiscard]] const std::vector& GetVariants() const override; }; } // namespace T4 diff --git a/src/Common/Game/T5/GameT5.cpp b/src/Common/Game/T5/GameT5.cpp index eb9f2676..b24eec28 100644 --- a/src/Common/Game/T5/GameT5.cpp +++ b/src/Common/Game/T5/GameT5.cpp @@ -76,12 +76,4 @@ namespace T5 return prefixes; } - - const std::vector& Game::GetVariants() const - { - static std::vector variants = { - new GameVariant(std::to_underlying(VariantId::PC), "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), - }; - return variants; - } } // namespace T5 diff --git a/src/Common/Game/T5/GameT5.h b/src/Common/Game/T5/GameT5.h index b005cee1..80aff27c 100644 --- a/src/Common/Game/T5/GameT5.h +++ b/src/Common/Game/T5/GameT5.h @@ -4,11 +4,6 @@ namespace T5 { - enum class VariantId : std::uint8_t - { - PC, - }; - class Game final : public AbstractGame { public: @@ -18,6 +13,5 @@ namespace T5 [[nodiscard]] const std::string& GetFullName() const override; [[nodiscard]] const std::string& GetShortName() const override; [[nodiscard]] const std::vector& GetLanguagePrefixes() const override; - [[nodiscard]] const std::vector& GetVariants() const override; }; } // namespace T5 diff --git a/src/Common/Game/T6/GameT6.cpp b/src/Common/Game/T6/GameT6.cpp index c8f6baca..eacdcbbf 100644 --- a/src/Common/Game/T6/GameT6.cpp +++ b/src/Common/Game/T6/GameT6.cpp @@ -132,12 +132,4 @@ namespace T6 return prefixes; } - - const std::vector& Game::GetVariants() const - { - static std::vector variants = { - new GameVariant(std::to_underlying(VariantId::PC), "pc", GameEndianness::LE, GameWordSize::ARCH_32, GamePlatform::PC), - }; - return variants; - } } // namespace T6 diff --git a/src/Common/Game/T6/GameT6.h b/src/Common/Game/T6/GameT6.h index c12e409e..2bcc9447 100644 --- a/src/Common/Game/T6/GameT6.h +++ b/src/Common/Game/T6/GameT6.h @@ -4,11 +4,6 @@ namespace T6 { - enum class VariantId : std::uint8_t - { - PC, - }; - class Game final : public AbstractGame { public: @@ -18,6 +13,5 @@ namespace T6 [[nodiscard]] const std::string& GetFullName() const override; [[nodiscard]] const std::string& GetShortName() const override; [[nodiscard]] const std::vector& GetLanguagePrefixes() const override; - [[nodiscard]] const std::vector& GetVariants() const override; }; } // namespace T6 diff --git a/src/Linking/Linker.cpp b/src/Linking/Linker.cpp index f253b420..ddd5e0da 100644 --- a/src/Linking/Linker.cpp +++ b/src/Linking/Linker.cpp @@ -268,7 +268,7 @@ namespace if (ignore == targetName) continue; - if (!ReadIgnoreEntries(paths, ignore, context.m_definition->m_game, context.m_ignored_assets)) + if (!ReadIgnoreEntries(paths, ignore, context.m_definition->GetGameId(), context.m_ignored_assets)) { con::error("Failed to read asset listing for ignoring assets of project \"{}\".", ignore); return false; @@ -311,7 +311,7 @@ namespace if (!LoadGdtFilesFromZoneDefinition(context.m_gdt_files, zoneDefinition, &paths.m_gdt_paths.GetSearchPaths())) return nullptr; - return zone_creator::CreateZoneForDefinition(zoneDefinition.m_game, context); + return zone_creator::CreateZoneForDefinition(zoneDefinition.GetGameId(), zoneDefinition.m_variant, context); } static bool WriteZoneToFile(IOutputPath& outPath, const Zone& zone) @@ -338,11 +338,11 @@ namespace bool BuildFastFile(LinkerPathManager& paths, const std::string& projectName, const std::string& targetName, ZoneDefinition& zoneDefinition) const { - const fs::path outDir(paths.m_linker_paths->BuildOutputFolderPath(projectName, zoneDefinition.m_game)); + const fs::path outDir(paths.m_linker_paths->BuildOutputFolderPath(projectName, zoneDefinition.GetGameId())); OutputPathFilesystem outputPath(outDir); - const fs::path cacheDir(paths.m_linker_paths->BuildCacheFolderPath(projectName, zoneDefinition.m_game)); + const fs::path cacheDir(paths.m_linker_paths->BuildCacheFolderPath(projectName, zoneDefinition.GetGameId())); SoundBankWriter::OutputPath = outDir; const auto zone = CreateZoneForDefinition(paths, outDir, cacheDir, targetName, zoneDefinition); @@ -372,7 +372,7 @@ namespace if (!zoneDefinition) return false; - PathGameContext gameContext(paths, projectName, zoneDefinition->m_game); + PathGameContext gameContext(paths, projectName, zoneDefinition->GetGameId()); if (!zoneDefinition->m_assets.empty()) { diff --git a/src/Linking/LinkerPaths.cpp b/src/Linking/LinkerPaths.cpp index 30fea265..e03b56ca 100644 --- a/src/Linking/LinkerPaths.cpp +++ b/src/Linking/LinkerPaths.cpp @@ -207,7 +207,7 @@ namespace return {}; } - [[nodiscard]] std::unique_ptr BuildSearchPathsSpecificToProjectAndGame(const std::string& projectName, GameId game) const override + [[nodiscard]] std::unique_ptr BuildSearchPathsSpecificToProjectAndGame(const std::string& projectName, GameId gameId) const override { SearchPaths searchPaths; std::unordered_set addedSearchPaths; @@ -217,7 +217,7 @@ namespace { if (!curTemplate.CanRender(PROJECT_MASK) && curTemplate.CanRender(GAME_MASK)) { - std::string gameName(GameId_Names[static_cast(game)]); + std::string gameName(IGame::GetGameById(gameId)->GetShortName()); utils::MakeStringLowerCase(gameName); auto renderedTemplate = curTemplate.Render(m_bin_dir, m_base_dir, projectName, gameName); @@ -292,14 +292,14 @@ namespace return m_source_search_paths; } - [[nodiscard]] std::string BuildCacheFolderPath(const std::string& projectName, GameId game) const override + [[nodiscard]] std::string BuildCacheFolderPath(const std::string& projectName, GameId gameId) const override { - return m_cache_template.Render(m_bin_dir, m_base_dir, projectName, GameId_Names[static_cast(game)]); + return m_cache_template.Render(m_bin_dir, m_base_dir, projectName, IGame::GetGameById(gameId)->GetShortName()); } - [[nodiscard]] std::string BuildOutputFolderPath(const std::string& projectName, GameId game) const override + [[nodiscard]] std::string BuildOutputFolderPath(const std::string& projectName, GameId gameId) const override { - return m_out_template.Render(m_bin_dir, m_base_dir, projectName, GameId_Names[static_cast(game)]); + return m_out_template.Render(m_bin_dir, m_base_dir, projectName, IGame::GetGameById(gameId)->GetShortName()); } private: diff --git a/src/Linking/ZoneCreation/ZoneCreator.cpp b/src/Linking/ZoneCreation/ZoneCreator.cpp index c7cb4d5c..9a47fe74 100644 --- a/src/Linking/ZoneCreation/ZoneCreator.cpp +++ b/src/Linking/ZoneCreation/ZoneCreator.cpp @@ -9,9 +9,9 @@ namespace { - std::unique_ptr CreateZone(const ZoneCreationContext& context, const GameId gameId) + std::unique_ptr CreateZone(const ZoneCreationContext& context, const GameVariantId variantId) { - return std::make_unique(context.m_definition->m_name, 0, gameId, GamePlatform::PC); + return std::make_unique(context.m_definition->m_name, 0, variantId); } std::vector CreateGdtList(const ZoneCreationContext& context) @@ -51,9 +51,9 @@ namespace zone_creator lookup.Initialize(gdtFiles); } - std::unique_ptr CreateZoneForDefinition(GameId gameId, ZoneCreationContext& context) + std::unique_ptr CreateZoneForDefinition(const GameId gameId, const GameVariantId variantId, ZoneCreationContext& context) { - auto zone = CreateZone(context, gameId); + auto zone = CreateZone(context, variantId); IgnoreReferencesFromAssets(context); IgnoredAssetLookup ignoredAssetLookup(context.m_ignored_assets); diff --git a/src/Linking/ZoneCreation/ZoneCreator.h b/src/Linking/ZoneCreation/ZoneCreator.h index c95c7cd9..63049ea5 100644 --- a/src/Linking/ZoneCreation/ZoneCreator.h +++ b/src/Linking/ZoneCreation/ZoneCreator.h @@ -5,5 +5,5 @@ namespace zone_creator { - [[nodiscard]] std::unique_ptr CreateZoneForDefinition(GameId game, ZoneCreationContext& context); + [[nodiscard]] std::unique_ptr CreateZoneForDefinition(GameId gameId, GameVariantId variantId, ZoneCreationContext& context); } diff --git a/src/ModMan/Asset/Image/DynamicAssetsImage.cpp b/src/ModMan/Asset/Image/DynamicAssetsImage.cpp index 1a65ef89..926909f2 100644 --- a/src/ModMan/Asset/Image/DynamicAssetsImage.cpp +++ b/src/ModMan/Asset/Image/DynamicAssetsImage.cpp @@ -87,7 +87,7 @@ namespace assert(image); assert(zone); - const auto gameName = GameId_Names[std::to_underlying(zone->m_game_id)]; + const auto gameName = IGame::GetGameById(zone->m_game_id)->GetShortName(); const auto toCommonConverter = ToCommonConverter::GetForGame(zone->m_game_id); if (!toCommonConverter) { diff --git a/src/ModMan/Asset/XModel/DynamicAssetsXModel.cpp b/src/ModMan/Asset/XModel/DynamicAssetsXModel.cpp index db9401e9..3e8a94bf 100644 --- a/src/ModMan/Asset/XModel/DynamicAssetsXModel.cpp +++ b/src/ModMan/Asset/XModel/DynamicAssetsXModel.cpp @@ -63,7 +63,7 @@ namespace assert(model); assert(zone); - const auto gameName = GameId_Names[std::to_underlying(zone->m_game_id)]; + const auto gameName = IGame::GetGameById(zone->m_game_id)->GetShortName(); const auto converter = ToCommonConverter::GetForGame(zone->m_game_id); if (!converter) { diff --git a/src/ModMan/Web/Binds/ZoneBinds.cpp b/src/ModMan/Web/Binds/ZoneBinds.cpp index 3b1f4a1a..a1893a18 100644 --- a/src/ModMan/Web/Binds/ZoneBinds.cpp +++ b/src/ModMan/Web/Binds/ZoneBinds.cpp @@ -68,7 +68,7 @@ namespace .name = loadedZone.GetZone().m_name, .filePath = loadedZone.GetFilePath(), .game = loadedZone.GetZone().m_game_id, - .platform = loadedZone.GetZone().m_platform, + .platform = IGameVariant::GetVariantById(loadedZone.GetZone().m_variant_id)->GetPlatform(), }; } diff --git a/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionAssetList.cpp b/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionAssetList.cpp index 04730010..dc976fdf 100644 --- a/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionAssetList.cpp +++ b/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionAssetList.cpp @@ -16,7 +16,7 @@ SequenceZoneDefinitionAssetList::SequenceZoneDefinitionAssetList() void SequenceZoneDefinitionAssetList::ProcessMatch(ZoneDefinitionParserState* state, SequenceResult& result) const { - if (state->m_definition->m_game == GameId::COUNT) + if (!state->m_game) { const auto& assetListKeywordToken = result.NextCapture(CAPTURE_ASSET_LIST_KEYWORD); throw ParsingException(assetListKeywordToken.GetPos(), "Must define game before using assetlist"); @@ -24,7 +24,7 @@ void SequenceZoneDefinitionAssetList::ProcessMatch(ZoneDefinitionParserState* st const auto& assetListNameToken = result.NextCapture(CAPTURE_ASSET_LIST_NAME); - AssetListReader assetListReader(state->m_search_path, state->m_definition->m_game); + const AssetListReader assetListReader(state->m_search_path, (*state->m_game)->GetId()); const auto maybeAssetList = assetListReader.ReadAssetList(assetListNameToken.FieldValue()); if (!maybeAssetList) diff --git a/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionMetaData.cpp b/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionMetaData.cpp index 46e73455..bccf2c22 100644 --- a/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionMetaData.cpp +++ b/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionMetaData.cpp @@ -7,10 +7,12 @@ #include #include #include +#include namespace { constexpr auto METADATA_GAME = "game"; + constexpr auto METADATA_VARIANT = "variant"; constexpr auto METADATA_GDT = "gdt"; constexpr auto METADATA_NAME = "name"; constexpr auto METADATA_TYPE = "type"; @@ -23,10 +25,32 @@ namespace auto upperGameName = gameName; utils::MakeStringUpperCase(upperGameName); - for (auto i = 0u; i < static_cast(GameId::COUNT); i++) + for (auto curGameIdNum = 0u; curGameIdNum < std::to_underlying(GameId::COUNT); curGameIdNum++) { - if (upperGameName == GameId_Names[i]) - return static_cast(i); + const auto curGameId = static_cast(curGameIdNum); + const auto& curGameName = IGame::GetGameById(curGameId)->GetShortName(); + if (upperGameName == curGameName) + return curGameId; + } + + return std::nullopt; + } + + std::optional GetVariantByName(const GameId gameId, const std::string& variantName) + { + auto lowerVariantName = variantName; + utils::MakeStringLowerCase(lowerVariantName); + + for (auto curVariantIdNum = 0u; curVariantIdNum < std::to_underlying(GameVariantId::COUNT); curVariantIdNum++) + { + const auto curVariantId = static_cast(curVariantIdNum); + const auto* variant = IGameVariant::GetVariantById(curVariantId); + if (variant->GetGameId() != gameId) + continue; + + const auto& curVariantName = variant->GetName(); + if (lowerVariantName == curVariantName) + return curVariantId; } return std::nullopt; @@ -82,11 +106,25 @@ namespace if (!game) throw ParsingException(valueToken.GetPos(), "Unknown game name"); - const auto previousGame = state->m_definition->m_game; - if (previousGame != GameId::COUNT && previousGame != *game) - throw ParsingException(valueToken.GetPos(), std::format("Game was previously defined as: {}", GameId_Names[static_cast(previousGame)])); + if (!state->m_game) + state->SetGame(*game); + else if ((*state->m_game)->GetId() != *game) + throw ParsingException(valueToken.GetPos(), std::format("Game was previously defined as: {}", (*state->m_game)->GetShortName())); + } - state->SetGame(*game); + void ProcessMetaDataVariant(ZoneDefinitionParserState* state, const ZoneDefinitionParserValue& valueToken, const std::string& value) + { + if (!state->m_game) + throw ParsingException(valueToken.GetPos(), "The game must be specified before the variant"); + + const auto variantId = GetVariantByName((*state->m_game)->GetId(), value); + if (!variantId) + throw ParsingException(valueToken.GetPos(), "Unknown variant name"); + + if (!state->m_variant) + state->SetVariant(*variantId); + else if ((*state->m_variant)->GetId() != *variantId) + throw ParsingException(valueToken.GetPos(), std::format("Variant was previously defined as: {}", (*state->m_variant)->GetName())); } void ProcessMetaDataType(ZoneDefinitionParserState* state, const ZoneDefinitionParserValue& keyToken, const ZoneDefinitionParserValue& valueToken) @@ -134,6 +172,10 @@ void SequenceZoneDefinitionMetaData::ProcessMatch(ZoneDefinitionParserState* sta { ProcessMetaDataGame(state, valueToken, value); } + else if (key == METADATA_VARIANT) + { + ProcessMetaDataVariant(state, valueToken, value); + } else if (key == METADATA_GDT) { state->m_definition->m_gdts.emplace_back(value); diff --git a/src/ZoneCommon/Zone/Definition/Parsing/ZoneDefinitionParserState.cpp b/src/ZoneCommon/Zone/Definition/Parsing/ZoneDefinitionParserState.cpp index c3e37460..d0869f75 100644 --- a/src/ZoneCommon/Zone/Definition/Parsing/ZoneDefinitionParserState.cpp +++ b/src/ZoneCommon/Zone/Definition/Parsing/ZoneDefinitionParserState.cpp @@ -2,6 +2,20 @@ #include +namespace +{ + constexpr GameVariantId DEFAULT_VARIANT_FOR_GAME[]{ + GameVariantId::IW3_PC, + GameVariantId::IW4_PC32, + GameVariantId::IW5_PC32, + GameVariantId::QOS_PC, + GameVariantId::T4_PC, + GameVariantId::T5_PC, + GameVariantId::T6_PC, + }; + static_assert(std::size(DEFAULT_VARIANT_FOR_GAME) == std::to_underlying(GameId::COUNT)); +} // namespace + ZoneDefinitionParserState::ZoneDefinitionParserState(std::string targetName, ISearchPath& searchPath, IParserLineStream& underlyingStream) : m_search_path(searchPath), m_underlying_stream(underlyingStream), @@ -14,10 +28,16 @@ ZoneDefinitionParserState::ZoneDefinitionParserState(std::string targetName, ISe void ZoneDefinitionParserState::SetGame(const GameId gameId) { - m_definition->m_game = gameId; + m_definition->m_variant = DEFAULT_VARIANT_FOR_GAME[static_cast(gameId)]; m_game = IGame::GetGameById(gameId); } +void ZoneDefinitionParserState::SetVariant(const GameVariantId variantId) +{ + m_definition->m_variant = variantId; + m_variant = IGameVariant::GetVariantById(variantId); +} + namespace { void AddCurrentObjContainerToDefinitionIfNecessary(ZoneDefinition& zoneDefinition, std::optional& maybeObjContainer) diff --git a/src/ZoneCommon/Zone/Definition/Parsing/ZoneDefinitionParserState.h b/src/ZoneCommon/Zone/Definition/Parsing/ZoneDefinitionParserState.h index 3b938dd8..344234e5 100644 --- a/src/ZoneCommon/Zone/Definition/Parsing/ZoneDefinitionParserState.h +++ b/src/ZoneCommon/Zone/Definition/Parsing/ZoneDefinitionParserState.h @@ -15,6 +15,7 @@ public: ZoneDefinitionParserState(std::string targetName, ISearchPath& searchPath, IParserLineStream& underlyingStream); void SetGame(GameId gameId); + void SetVariant(GameVariantId variantId); void StartIPak(std::string ipakName); void StartIwd(std::string iwdName); @@ -26,6 +27,7 @@ public: std::unordered_set m_inclusions; std::optional m_game; + std::optional m_variant; std::optional m_current_ipak; std::optional m_current_iwd; diff --git a/src/ZoneCommon/Zone/Definition/ZoneDefinition.cpp b/src/ZoneCommon/Zone/Definition/ZoneDefinition.cpp index 41c401da..49f548f8 100644 --- a/src/ZoneCommon/Zone/Definition/ZoneDefinition.cpp +++ b/src/ZoneCommon/Zone/Definition/ZoneDefinition.cpp @@ -34,6 +34,14 @@ void ZoneDefinitionProperties::Include(const ZoneDefinitionProperties& otherProp } ZoneDefinition::ZoneDefinition() - : m_game(GameId::COUNT) + : m_variant(GameVariantId::COUNT) { } + +GameId ZoneDefinition::GetGameId() const +{ + if (m_variant < GameVariantId::COUNT) + return IGameVariant::GetVariantById(m_variant)->GetGameId(); + + return GameId::COUNT; +} diff --git a/src/ZoneCommon/Zone/Definition/ZoneDefinition.h b/src/ZoneCommon/Zone/Definition/ZoneDefinition.h index 0d64f161..744fd1f9 100644 --- a/src/ZoneCommon/Zone/Definition/ZoneDefinition.h +++ b/src/ZoneCommon/Zone/Definition/ZoneDefinition.h @@ -1,5 +1,6 @@ #pragma once +#include "Game/GameVariant.h" #include "Game/IGame.h" #include "Zone/AssetList/AssetList.h" #include "Zone/ZoneTypes.h" @@ -61,8 +62,10 @@ class ZoneDefinition public: ZoneDefinition(); + [[nodiscard]] GameId GetGameId() const; + std::string m_name; - GameId m_game; + GameVariantId m_variant; ZoneDefinitionProperties m_properties; std::vector m_ignores; std::vector m_targets_to_build; diff --git a/src/ZoneCommon/Zone/Zone.cpp b/src/ZoneCommon/Zone/Zone.cpp index be80ce23..94111c26 100644 --- a/src/ZoneCommon/Zone/Zone.cpp +++ b/src/ZoneCommon/Zone/Zone.cpp @@ -2,12 +2,12 @@ #include "ZoneRegistry.h" -Zone::Zone(std::string name, const zone_priority_t priority, const GameId gameId, const GamePlatform platform) +Zone::Zone(std::string name, const zone_priority_t priority, const GameVariantId variantId) : m_name(std::move(name)), m_priority(priority), m_language(GameLanguage::LANGUAGE_NONE), - m_game_id(gameId), - m_platform(platform), + m_game_id(IGameVariant::GetVariantById(variantId)->GetGameId()), + m_variant_id(variantId), m_pools(*this, priority), m_memory(std::make_unique()), m_registered(false) diff --git a/src/ZoneCommon/Zone/Zone.h b/src/ZoneCommon/Zone/Zone.h index 1c34fbf4..8f801e27 100644 --- a/src/ZoneCommon/Zone/Zone.h +++ b/src/ZoneCommon/Zone/Zone.h @@ -1,6 +1,7 @@ #pragma once #include "Game/GameLanguage.h" +#include "Game/GameVariant.h" #include "Game/IGame.h" #include "Pool/AssetPool.h" #include "Zone/ZoneTypes.h" @@ -13,7 +14,7 @@ class Zone { public: - Zone(std::string name, zone_priority_t priority, GameId gameId, GamePlatform platform); + Zone(std::string name, zone_priority_t priority, GameVariantId variantId); ~Zone(); Zone(const Zone& other) = delete; Zone(Zone&& other) noexcept = delete; @@ -28,7 +29,7 @@ public: zone_priority_t m_priority; GameLanguage m_language; GameId m_game_id; - GamePlatform m_platform; + GameVariantId m_variant_id; ZoneScriptStrings m_script_strings; ZoneAssetPools m_pools; diff --git a/src/ZoneLoading/Game/IW3/ZoneLoaderFactoryIW3.cpp b/src/ZoneLoading/Game/IW3/ZoneLoaderFactoryIW3.cpp index 053ba4a1..a3e770b7 100644 --- a/src/ZoneLoading/Game/IW3/ZoneLoaderFactoryIW3.cpp +++ b/src/ZoneLoading/Game/IW3/ZoneLoaderFactoryIW3.cpp @@ -133,9 +133,7 @@ std::optional ZoneLoaderFactory::InspectZoneHeader(Z { return ZoneLoaderInspectionResult{ .m_game_id = GameId::IW3, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, + .m_variant_id = GameVariantId::IW3_PC, .m_is_official = true, .m_is_signed = false, .m_is_encrypted = false, @@ -148,9 +146,7 @@ std::optional ZoneLoaderFactory::InspectZoneHeader(Z { return ZoneLoaderInspectionResult{ .m_game_id = GameId::IW3, - .m_endianness = GameEndianness::BE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::XBOX, + .m_variant_id = GameVariantId::IW3_XBOX, .m_is_official = true, .m_is_signed = false, .m_is_encrypted = false, @@ -160,9 +156,7 @@ std::optional ZoneLoaderFactory::InspectZoneHeader(Z { return ZoneLoaderInspectionResult{ .m_game_id = GameId::IW3, - .m_endianness = GameEndianness::BE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::XBOX, + .m_variant_id = GameVariantId::IW3_XBOX, .m_is_official = true, .m_is_signed = true, .m_is_encrypted = false, @@ -181,8 +175,10 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee if (!inspectResult) return nullptr; + const auto variant = IGameVariant::GetVariantById(inspectResult->m_variant_id); + // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::IW3, inspectResult->m_platform); + auto zone = std::make_unique(fileName, 0, inspectResult->m_variant_id); auto* zonePtr = zone.get(); zone->m_language = GameLanguage::LANGUAGE_NONE; @@ -199,7 +195,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee zoneLoader->AddLoadingStep(step::CreateStepAddProcessor(processor::CreateProcessorInflate(ZoneConstants::AUTHED_CHUNK_SIZE))); - if (inspectResult->m_endianness == GameEndianness::LE) + if (variant->GetEndianness() == GameEndianness::LE) { // Start of the XFile struct zoneLoader->AddLoadingStep(step::CreateStepLoadZoneSizes()); diff --git a/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp b/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp index 5186c48f..202b6a8d 100644 --- a/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp +++ b/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp @@ -53,17 +53,16 @@ namespace if (*reinterpret_cast(&header.m_magic[std::char_traits::length(ZoneConstants::MAGIC_IW4X)]) == ZoneConstants::ZONE_VERSION_IW4x) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::IW4, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::IW4_PC32, + .m_is_official = false, + .m_is_signed = false, + .m_is_encrypted = false, + }; return ZoneLoaderInspectionResultIW4{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::IW4, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, - .m_is_official = false, - .m_is_signed = false, - .m_is_encrypted = false, - }, + .m_generic_result = generic, .m_is_iw4x = true, }; } @@ -73,34 +72,32 @@ namespace if (!memcmp(header.m_magic, ZoneConstants::MAGIC_SIGNED_INFINITY_WARD, std::char_traits::length(ZoneConstants::MAGIC_SIGNED_INFINITY_WARD))) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::IW4, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::IW4_PC32, + .m_is_official = true, + .m_is_signed = true, + .m_is_encrypted = false, + }; return ZoneLoaderInspectionResultIW4{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::IW4, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, - .m_is_official = true, - .m_is_signed = true, - .m_is_encrypted = false, - }, + .m_generic_result = generic, .m_is_iw4x = false, }; } if (!memcmp(header.m_magic, ZoneConstants::MAGIC_UNSIGNED, std::char_traits::length(ZoneConstants::MAGIC_UNSIGNED))) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::IW4, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::IW4_PC32, + .m_is_official = false, + .m_is_signed = false, + .m_is_encrypted = false, + }; return ZoneLoaderInspectionResultIW4{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::IW4, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, - .m_is_official = false, - .m_is_signed = false, - .m_is_encrypted = false, - }, + .m_generic_result = generic, .m_is_iw4x = false, }; } @@ -110,33 +107,29 @@ namespace { if (!memcmp(header.m_magic, ZoneConstants::MAGIC_UNSIGNED, std::char_traits::length(ZoneConstants::MAGIC_UNSIGNED))) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::IW4, + .m_variant_id = GameVariantId::IW4_XBOX, + .m_is_official = false, + .m_is_signed = false, + .m_is_encrypted = false, + }; return ZoneLoaderInspectionResultIW4{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::IW4, - .m_endianness = GameEndianness::BE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::XBOX, - .m_is_official = false, - .m_is_signed = false, - .m_is_encrypted = false, - }, + .m_generic_result = generic, .m_is_iw4x = false, }; } if (!memcmp(header.m_magic, ZoneConstants::MAGIC_SIGNED_INFINITY_WARD, std::char_traits::length(ZoneConstants::MAGIC_SIGNED_INFINITY_WARD))) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::IW4, + .m_variant_id = GameVariantId::IW4_XBOX, + .m_is_official = true, + .m_is_signed = true, + .m_is_encrypted = false, + }; return ZoneLoaderInspectionResultIW4{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::IW4, - .m_endianness = GameEndianness::BE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::XBOX, - .m_is_official = true, - .m_is_signed = true, - .m_is_encrypted = false, - }, + .m_generic_result = generic, .m_is_iw4x = false, }; } @@ -161,18 +154,18 @@ namespace #undef XBLOCK_DEF } - std::unique_ptr SetupRsa(const bool isOfficial, const GamePlatform platform) + std::unique_ptr SetupRsa(const bool isOfficial, const GameVariantId variant) { if (isOfficial) { auto rsa = cryptography::CreateRsa(cryptography::HashingAlgorithm::RSA_HASH_SHA256, cryptography::RsaPaddingMode::RSA_PADDING_PSS); bool keySetSuccessful; - if (platform == GamePlatform::PC) + if (variant == GameVariantId::IW4_PC32 || variant == GameVariantId::IW4_PC64) { keySetSuccessful = rsa->SetKey(ZoneConstants::RSA_PUBLIC_KEY_INFINITY_WARD_PC, sizeof(ZoneConstants::RSA_PUBLIC_KEY_INFINITY_WARD_PC)); } - else if (platform == GamePlatform::XBOX) + else if (variant == GameVariantId::IW4_XBOX) { keySetSuccessful = rsa->SetKey(ZoneConstants::RSA_PUBLIC_KEY_INFINITY_WARD_XENON, sizeof(ZoneConstants::RSA_PUBLIC_KEY_INFINITY_WARD_XENON)); } @@ -206,7 +199,7 @@ namespace return; // If file is signed setup a RSA instance. - auto rsa = SetupRsa(inspectResult.m_generic_result.m_is_official, inspectResult.m_generic_result.m_platform); + auto rsa = SetupRsa(inspectResult.m_generic_result.m_is_official, inspectResult.m_generic_result.m_variant_id); zoneLoader.AddLoadingStep(step::CreateStepVerifyMagic(ZoneConstants::MAGIC_AUTH_HEADER)); zoneLoader.AddLoadingStep(step::CreateStepSkipBytes(4)); // Skip reserved @@ -266,7 +259,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::IW4, inspectResult->m_generic_result.m_platform); + auto zone = std::make_unique(fileName, 0, inspectResult->m_generic_result.m_variant_id); auto* zonePtr = zone.get(); zone->m_language = GameLanguage::LANGUAGE_NONE; @@ -285,7 +278,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee zoneLoader->AddLoadingStep(step::CreateStepSkipBytes(8)); // Xbox fastfiles have an additional header of all included images outside the zone data - if (inspectResult->m_generic_result.m_platform == GamePlatform::XBOX) + if (inspectResult->m_generic_result.m_variant_id == GameVariantId::IW4_XBOX) zoneLoader->AddLoadingStep(step::CreateStepSkipZoneImageHeaders()); // Add steps for loading the auth header which also contain the signature of the zone if it is signed. @@ -299,7 +292,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee zoneLoader->AddLoadingStep(step::CreateStepSkipBytes(1)); } - if (inspectResult->m_generic_result.m_endianness == GameEndianness::LE) + if (inspectResult->m_generic_result.m_variant_id != GameVariantId::IW4_XBOX) { // Start of the XFile struct zoneLoader->AddLoadingStep(step::CreateStepLoadZoneSizes()); diff --git a/src/ZoneLoading/Game/IW5/ZoneLoaderFactoryIW5.cpp b/src/ZoneLoading/Game/IW5/ZoneLoaderFactoryIW5.cpp index 162c8e78..4ebe6de8 100644 --- a/src/ZoneLoading/Game/IW5/ZoneLoaderFactoryIW5.cpp +++ b/src/ZoneLoading/Game/IW5/ZoneLoaderFactoryIW5.cpp @@ -131,9 +131,8 @@ std::optional ZoneLoaderFactory::InspectZoneHeader(Z { return ZoneLoaderInspectionResult{ .m_game_id = GameId::IW5, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::IW5_PC32, .m_is_official = true, .m_is_signed = true, .m_is_encrypted = false, @@ -144,9 +143,8 @@ std::optional ZoneLoaderFactory::InspectZoneHeader(Z { return ZoneLoaderInspectionResult{ .m_game_id = GameId::IW5, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::IW5_PC32, .m_is_official = false, .m_is_signed = false, .m_is_encrypted = false, @@ -165,7 +163,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::IW5, inspectResult->m_platform); + auto zone = std::make_unique(fileName, 0, inspectResult->m_variant_id); auto* zonePtr = zone.get(); zone->m_language = GameLanguage::LANGUAGE_NONE; diff --git a/src/ZoneLoading/Game/QOS/ZoneLoaderFactoryQOS.cpp b/src/ZoneLoading/Game/QOS/ZoneLoaderFactoryQOS.cpp index d9e803ad..8a3e20b7 100644 --- a/src/ZoneLoading/Game/QOS/ZoneLoaderFactoryQOS.cpp +++ b/src/ZoneLoading/Game/QOS/ZoneLoaderFactoryQOS.cpp @@ -2,6 +2,7 @@ #include "ContentLoaderQOS.h" #include "Game/GameLanguage.h" +#include "Game/QOS/GameQOS.h" #include "Game/QOS/QOS.h" #include "Game/QOS/ZoneConstantsQOS.h" #include "Loading/Processor/ProcessorInflate.h" @@ -41,9 +42,7 @@ std::optional ZoneLoaderFactory::InspectZoneHeader(Z { return ZoneLoaderInspectionResult{ .m_game_id = GameId::QOS, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, + .m_variant_id = GameVariantId::QOS_PC, // There is no way to know whether unsigned zones are official. .m_is_official = false, .m_is_signed = false, @@ -62,7 +61,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee if (!inspectResult) return nullptr; - auto zone = std::make_unique(fileName, 0, GameId::QOS, inspectResult->m_platform); + auto zone = std::make_unique(fileName, 0, inspectResult->m_variant_id); auto* zonePtr = zone.get(); zone->m_language = GameLanguage::LANGUAGE_NONE; diff --git a/src/ZoneLoading/Game/T4/ZoneLoaderFactoryT4.cpp b/src/ZoneLoading/Game/T4/ZoneLoaderFactoryT4.cpp index 8e36f946..98f27c5f 100644 --- a/src/ZoneLoading/Game/T4/ZoneLoaderFactoryT4.cpp +++ b/src/ZoneLoading/Game/T4/ZoneLoaderFactoryT4.cpp @@ -2,6 +2,7 @@ #include "ContentLoaderT4.h" #include "Game/GameLanguage.h" +#include "Game/T4/GameT4.h" #include "Game/T4/T4.h" #include "Game/T4/ZoneConstantsT4.h" #include "Loading/Processor/ProcessorInflate.h" @@ -43,9 +44,7 @@ std::optional ZoneLoaderFactory::InspectZoneHeader(Z { return ZoneLoaderInspectionResult{ .m_game_id = GameId::T4, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, + .m_variant_id = GameVariantId::T4_PC, // There is no way to know whether unsigned zones are official. .m_is_official = false, .m_is_signed = false, @@ -65,7 +64,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::T4, inspectResult->m_platform); + auto zone = std::make_unique(fileName, 0, inspectResult->m_variant_id); auto* zonePtr = zone.get(); zone->m_language = GameLanguage::LANGUAGE_NONE; diff --git a/src/ZoneLoading/Game/T5/ZoneLoaderFactoryT5.cpp b/src/ZoneLoading/Game/T5/ZoneLoaderFactoryT5.cpp index 4d53042f..80dc9a66 100644 --- a/src/ZoneLoading/Game/T5/ZoneLoaderFactoryT5.cpp +++ b/src/ZoneLoading/Game/T5/ZoneLoaderFactoryT5.cpp @@ -46,9 +46,7 @@ std::optional ZoneLoaderFactory::InspectZoneHeader(Z { return ZoneLoaderInspectionResult{ .m_game_id = GameId::T5, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, + .m_variant_id = GameVariantId::T5_PC, // There is no way to know whether unsigned zones are official. .m_is_official = false, .m_is_signed = false, @@ -68,7 +66,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::T5, inspectResult->m_platform); + auto zone = std::make_unique(fileName, 0, inspectResult->m_variant_id); auto* zonePtr = zone.get(); zone->m_language = GameLanguage::LANGUAGE_NONE; diff --git a/src/ZoneLoading/Game/T6/ZoneLoaderFactoryT6.cpp b/src/ZoneLoading/Game/T6/ZoneLoaderFactoryT6.cpp index ec14e13c..2e0a8869 100644 --- a/src/ZoneLoading/Game/T6/ZoneLoaderFactoryT6.cpp +++ b/src/ZoneLoading/Game/T6/ZoneLoaderFactoryT6.cpp @@ -54,68 +54,64 @@ namespace { if (!memcmp(header.m_magic, ZoneConstants::MAGIC_SIGNED_TREYARCH, 8)) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::T6, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::T6_PC, + .m_is_official = true, + .m_is_signed = true, + .m_is_encrypted = true, + }; return ZoneLoaderInspectionResultT6{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::T6, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, - .m_is_official = true, - .m_is_signed = true, - .m_is_encrypted = true, - }, + .m_generic_result = generic, .m_compression_type = ZoneCompressionTypeT6::DEFLATE, }; } if (!memcmp(header.m_magic, ZoneConstants::MAGIC_SIGNED_OAT, 8)) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::T6, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::T6_PC, + .m_is_official = false, + .m_is_signed = true, + .m_is_encrypted = true, + }; return ZoneLoaderInspectionResultT6{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::T6, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, - .m_is_official = false, - .m_is_signed = true, - .m_is_encrypted = true, - }, + .m_generic_result = generic, .m_compression_type = ZoneCompressionTypeT6::DEFLATE, }; } if (!memcmp(header.m_magic, ZoneConstants::MAGIC_UNSIGNED, 8)) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::T6, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::T6_PC, + .m_is_official = false, + .m_is_signed = false, + .m_is_encrypted = true, + }; return ZoneLoaderInspectionResultT6{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::T6, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, - .m_is_official = false, - .m_is_signed = false, - .m_is_encrypted = true, - }, + .m_generic_result = generic, .m_compression_type = ZoneCompressionTypeT6::DEFLATE, }; } if (!memcmp(header.m_magic, ZoneConstants::MAGIC_UNSIGNED_SERVER, 8)) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::T6, + // Assume 32bit at first until we may know better later + .m_variant_id = GameVariantId::T6_PC, + .m_is_official = true, + .m_is_signed = false, + .m_is_encrypted = false, + }; return ZoneLoaderInspectionResultT6{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::T6, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PC, - .m_is_official = true, - .m_is_signed = false, - .m_is_encrypted = false, - }, + .m_generic_result = generic, .m_compression_type = ZoneCompressionTypeT6::DEFLATE, }; } @@ -124,34 +120,30 @@ namespace { if (!memcmp(header.m_magic, ZoneConstants::MAGIC_SIGNED_TREYARCH, 8)) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::T6, + .m_variant_id = GameVariantId::T6_XBOX, + .m_is_official = true, + .m_is_signed = true, + .m_is_encrypted = true, + }; return ZoneLoaderInspectionResultT6{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::T6, - .m_endianness = GameEndianness::BE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::XBOX, - .m_is_official = true, - .m_is_signed = true, - .m_is_encrypted = true, - }, + .m_generic_result = generic, .m_compression_type = ZoneCompressionTypeT6::DEFLATE, }; } if (!memcmp(header.m_magic, ZoneConstants::MAGIC_SIGNED_LZX_TREYARCH, 8)) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::T6, + .m_variant_id = GameVariantId::T6_XBOX, + .m_is_official = true, + .m_is_signed = true, + .m_is_encrypted = true, + }; return ZoneLoaderInspectionResultT6{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::T6, - .m_endianness = GameEndianness::BE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::XBOX, - .m_is_official = true, - .m_is_signed = true, - .m_is_encrypted = true, - }, + .m_generic_result = generic, .m_compression_type = ZoneCompressionTypeT6::LZX, }; } @@ -160,36 +152,32 @@ namespace { if (!memcmp(header.m_magic, ZoneConstants::MAGIC_UNSIGNED_SERVER, 8)) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::T6, + .m_variant_id = GameVariantId::T6_PS3, + .m_is_official = true, + .m_is_signed = false, + .m_is_encrypted = false, + }; return ZoneLoaderInspectionResultT6{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::T6, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::PS3, - .m_is_official = true, - .m_is_signed = false, - .m_is_encrypted = false, - }, + .m_generic_result = generic, .m_compression_type = ZoneCompressionTypeT6::DEFLATE, }; } } else if (endianness::FromLittleEndian(header.m_version) == ZoneConstants::ZONE_VERSION_WIIU) { + constexpr ZoneLoaderInspectionResult generic{ + .m_game_id = GameId::T6, + .m_variant_id = GameVariantId::T6_WIIU, + .m_is_official = true, + .m_is_signed = false, + .m_is_encrypted = false, + }; if (!memcmp(header.m_magic, ZoneConstants::MAGIC_UNSIGNED_SERVER, 8)) { return ZoneLoaderInspectionResultT6{ - .m_generic_result = - ZoneLoaderInspectionResult{ - .m_game_id = GameId::T6, - .m_endianness = GameEndianness::LE, - .m_word_size = GameWordSize::ARCH_32, - .m_platform = GamePlatform::WIIU, - .m_is_official = true, - .m_is_signed = false, - .m_is_encrypted = false, - }, + .m_generic_result = generic, .m_compression_type = ZoneCompressionTypeT6::DEFLATE, }; } @@ -269,14 +257,15 @@ namespace return signatureLoadStepPtr; } - ICapturedDataProvider* AddXChunkProcessor(const ZoneLoaderInspectionResultT6& inspectResult, ZoneLoader& zoneLoader, const std::string& fileName) + ICapturedDataProvider* + AddXChunkProcessor(const ZoneLoaderInspectionResultT6& inspectResult, const IGameVariant& variant, ZoneLoader& zoneLoader, const std::string& fileName) { ICapturedDataProvider* result = nullptr; auto xChunkProcessor = processor::CreateProcessorXChunks( - ZoneConstants::STREAM_COUNT, ZoneConstants::XCHUNK_SIZE, inspectResult.m_generic_result.m_endianness, ZoneConstants::VANILLA_BUFFER_SIZE); + ZoneConstants::STREAM_COUNT, ZoneConstants::XCHUNK_SIZE, variant.GetEndianness(), ZoneConstants::VANILLA_BUFFER_SIZE); - const uint8_t (&salsa20Key)[32] = inspectResult.m_generic_result.m_platform == GamePlatform::XBOX ? ZoneConstants::SALSA20_KEY_TREYARCH_XENON - : ZoneConstants::SALSA20_KEY_TREYARCH_PC; + const uint8_t (&salsa20Key)[32] = + variant.GetPlatform() == GamePlatform::XBOX ? ZoneConstants::SALSA20_KEY_TREYARCH_XENON : ZoneConstants::SALSA20_KEY_TREYARCH_PC; if (inspectResult.m_generic_result.m_is_encrypted) { @@ -322,8 +311,10 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee if (!inspectResult) return nullptr; + const auto variant = IGameVariant::GetVariantById(inspectResult->m_generic_result.m_variant_id); + // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::T6, inspectResult->m_generic_result.m_platform); + auto zone = std::make_unique(fileName, 0, inspectResult->m_generic_result.m_variant_id); auto* zonePtr = zone.get(); zone->m_language = GetZoneLanguage(fileName); @@ -342,9 +333,9 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(ZoneDataPee ISignatureProvider* signatureProvider = AddAuthHeaderSteps(inspectResult->m_generic_result.m_is_signed, *zoneLoader, fileName); // Setup loading XChunks from the zone from this point on. - ICapturedDataProvider* signatureDataProvider = AddXChunkProcessor(*inspectResult, *zoneLoader, fileName); + ICapturedDataProvider* signatureDataProvider = AddXChunkProcessor(*inspectResult, *variant, *zoneLoader, fileName); - if (inspectResult->m_generic_result.m_endianness == GameEndianness::LE) + if (variant->GetEndianness() == GameEndianness::LE) { // Start of the XFile struct zoneLoader->AddLoadingStep(step::CreateStepLoadZoneSizes()); diff --git a/src/ZoneLoading/Loading/IZoneLoaderFactory.h b/src/ZoneLoading/Loading/IZoneLoaderFactory.h index cf26557b..3ae2fff2 100644 --- a/src/ZoneLoading/Loading/IZoneLoaderFactory.h +++ b/src/ZoneLoading/Loading/IZoneLoaderFactory.h @@ -13,12 +13,9 @@ struct ZoneLoaderInspectionResult { // The game this zone is created for. GameId m_game_id; - // Whether the zone is meant for a little-endian or big-endian loader. - GameEndianness m_endianness; - // Whether the zone is meant for a 32bit or 64bit loader. - GameWordSize m_word_size; - // The platform this zone is for. - GamePlatform m_platform; + // The id of the game variant of this zone. + // The game variant informs about more architectural background like endianness, word size and platform. + GameVariantId m_variant_id; // Whether this zone is confirmed official. False if not official or unknown. bool m_is_official; // Whether this zone contains a signature confirming the identity of the creator. diff --git a/src/ZoneLoading/Loading/Processor/ProcessorXChunks.h b/src/ZoneLoading/Loading/Processor/ProcessorXChunks.h index 6a876231..b4e2c3a9 100644 --- a/src/ZoneLoading/Loading/Processor/ProcessorXChunks.h +++ b/src/ZoneLoading/Loading/Processor/ProcessorXChunks.h @@ -1,6 +1,6 @@ #pragma once -#include "Game/IGame.h" +#include "Game/GameVariant.h" #include "Loading/StreamProcessor.h" #include "Zone/XChunk/IXChunkProcessor.h" diff --git a/test/ObjCompilingTests/Game/IW3/Techset/TechniqueCompilerIW3Test.cpp b/test/ObjCompilingTests/Game/IW3/Techset/TechniqueCompilerIW3Test.cpp index 78daba7e..720d1ae8 100644 --- a/test/ObjCompilingTests/Game/IW3/Techset/TechniqueCompilerIW3Test.cpp +++ b/test/ObjCompilingTests/Game/IW3/Techset/TechniqueCompilerIW3Test.cpp @@ -56,7 +56,7 @@ namespace TEST_CASE("TechniqueCompilerIW3", "[iw3][techset][compiler]") { - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/IW3/Techset/TechsetCompilerIW3Test.cpp b/test/ObjCompilingTests/Game/IW3/Techset/TechsetCompilerIW3Test.cpp index 773486a5..9b2e0129 100644 --- a/test/ObjCompilingTests/Game/IW3/Techset/TechsetCompilerIW3Test.cpp +++ b/test/ObjCompilingTests/Game/IW3/Techset/TechsetCompilerIW3Test.cpp @@ -31,7 +31,7 @@ namespace TEST_CASE("TechsetCompilerIW3", "[techset][iw3][compiler]") { - Zone zone("test", 0, GameId::IW3, GamePlatform::PC); + Zone zone("test", 0, GameVariantId::IW3_PC); AssetCreatorCollection creators(zone); IgnoredAssetLookup ignoredAssets; AssetCreationContext context(zone, &creators, &ignoredAssets); diff --git a/test/ObjCompilingTests/Game/IW3/Techset/VertexDeclCompilerIW3Test.cpp b/test/ObjCompilingTests/Game/IW3/Techset/VertexDeclCompilerIW3Test.cpp index 6a7d46ab..dbf0ac73 100644 --- a/test/ObjCompilingTests/Game/IW3/Techset/VertexDeclCompilerIW3Test.cpp +++ b/test/ObjCompilingTests/Game/IW3/Techset/VertexDeclCompilerIW3Test.cpp @@ -11,7 +11,7 @@ using namespace std::literals; TEST_CASE("VertexDeclCompilerIW3", "[iw3][techset][compiler]") { - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/IW4/Techset/TechniqueCompilerIW4Test.cpp b/test/ObjCompilingTests/Game/IW4/Techset/TechniqueCompilerIW4Test.cpp index cfa17d11..544643d1 100644 --- a/test/ObjCompilingTests/Game/IW4/Techset/TechniqueCompilerIW4Test.cpp +++ b/test/ObjCompilingTests/Game/IW4/Techset/TechniqueCompilerIW4Test.cpp @@ -56,7 +56,7 @@ namespace TEST_CASE("TechniqueCompilerIW4", "[iw4][techset][compiler]") { - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/IW4/Techset/TechsetCompilerIW4Test.cpp b/test/ObjCompilingTests/Game/IW4/Techset/TechsetCompilerIW4Test.cpp index 2abbca8b..2e3e2b98 100644 --- a/test/ObjCompilingTests/Game/IW4/Techset/TechsetCompilerIW4Test.cpp +++ b/test/ObjCompilingTests/Game/IW4/Techset/TechsetCompilerIW4Test.cpp @@ -28,7 +28,7 @@ namespace TEST_CASE("TechsetCompilerIW4", "[techset][iw4][compiler]") { - Zone zone("test", 0, GameId::IW4, GamePlatform::PC); + Zone zone("test", 0, GameVariantId::IW4_PC32); AssetCreatorCollection creators(zone); IgnoredAssetLookup ignoredAssets; AssetCreationContext context(zone, &creators, &ignoredAssets); diff --git a/test/ObjCompilingTests/Game/IW4/Techset/VertexDeclCompilerIW4Test.cpp b/test/ObjCompilingTests/Game/IW4/Techset/VertexDeclCompilerIW4Test.cpp index 5dc24d04..9c8d57f6 100644 --- a/test/ObjCompilingTests/Game/IW4/Techset/VertexDeclCompilerIW4Test.cpp +++ b/test/ObjCompilingTests/Game/IW4/Techset/VertexDeclCompilerIW4Test.cpp @@ -11,7 +11,7 @@ using namespace std::literals; TEST_CASE("VertexDeclCompilerIW4", "[iw4][techset][compiler]") { - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/IW5/Techset/TechniqueCompilerIW5Test.cpp b/test/ObjCompilingTests/Game/IW5/Techset/TechniqueCompilerIW5Test.cpp index d5a5e34e..c1e32173 100644 --- a/test/ObjCompilingTests/Game/IW5/Techset/TechniqueCompilerIW5Test.cpp +++ b/test/ObjCompilingTests/Game/IW5/Techset/TechniqueCompilerIW5Test.cpp @@ -56,7 +56,7 @@ namespace TEST_CASE("TechniqueCompilerIW5", "[iw5][techset][compiler]") { - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/IW5/Techset/TechsetCompilerIW5Test.cpp b/test/ObjCompilingTests/Game/IW5/Techset/TechsetCompilerIW5Test.cpp index b1b70f73..8b1b527b 100644 --- a/test/ObjCompilingTests/Game/IW5/Techset/TechsetCompilerIW5Test.cpp +++ b/test/ObjCompilingTests/Game/IW5/Techset/TechsetCompilerIW5Test.cpp @@ -28,7 +28,7 @@ namespace TEST_CASE("TechsetCompilerIW5", "[techset][iw5][compiler]") { - Zone zone("test", 0, GameId::IW5, GamePlatform::PC); + Zone zone("test", 0, GameVariantId::IW5_PC32); AssetCreatorCollection creators(zone); IgnoredAssetLookup ignoredAssets; AssetCreationContext context(zone, &creators, &ignoredAssets); diff --git a/test/ObjCompilingTests/Game/IW5/Techset/VertexDeclCompilerIW5Test.cpp b/test/ObjCompilingTests/Game/IW5/Techset/VertexDeclCompilerIW5Test.cpp index bfe11f19..86fa17d3 100644 --- a/test/ObjCompilingTests/Game/IW5/Techset/VertexDeclCompilerIW5Test.cpp +++ b/test/ObjCompilingTests/Game/IW5/Techset/VertexDeclCompilerIW5Test.cpp @@ -1,5 +1,6 @@ #include "Game/IW5/Techset/VertexDeclCompilerIW5.h" +#include "Game/IW5/GameIW5.h" #include "Game/IW5/IW5.h" #include "Utils/MemoryManager.h" @@ -11,7 +12,7 @@ using namespace std::literals; TEST_CASE("VertexDeclCompilerIW5", "[iw5][techset][compiler]") { - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/T5/Techset/TechniqueCompilerT5Test.cpp b/test/ObjCompilingTests/Game/T5/Techset/TechniqueCompilerT5Test.cpp index eaad7588..b261c056 100644 --- a/test/ObjCompilingTests/Game/T5/Techset/TechniqueCompilerT5Test.cpp +++ b/test/ObjCompilingTests/Game/T5/Techset/TechniqueCompilerT5Test.cpp @@ -56,7 +56,7 @@ namespace TEST_CASE("TechniqueCompilerT5", "[t5][techset][compiler]") { - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/T5/Techset/TechsetCompilerT5Test.cpp b/test/ObjCompilingTests/Game/T5/Techset/TechsetCompilerT5Test.cpp index 1da90e49..81ad5bb0 100644 --- a/test/ObjCompilingTests/Game/T5/Techset/TechsetCompilerT5Test.cpp +++ b/test/ObjCompilingTests/Game/T5/Techset/TechsetCompilerT5Test.cpp @@ -28,7 +28,7 @@ namespace TEST_CASE("TechsetCompilerT5", "[techset][t5][compiler]") { - Zone zone("test", 0, GameId::T5, GamePlatform::PC); + Zone zone("test", 0, GameVariantId::T5_PC); AssetCreatorCollection creators(zone); IgnoredAssetLookup ignoredAssets; AssetCreationContext context(zone, &creators, &ignoredAssets); diff --git a/test/ObjCompilingTests/Game/T5/Techset/VertexDeclCompilerT5Test.cpp b/test/ObjCompilingTests/Game/T5/Techset/VertexDeclCompilerT5Test.cpp index a622cbbc..55c48b0c 100644 --- a/test/ObjCompilingTests/Game/T5/Techset/VertexDeclCompilerT5Test.cpp +++ b/test/ObjCompilingTests/Game/T5/Techset/VertexDeclCompilerT5Test.cpp @@ -11,7 +11,7 @@ using namespace std::literals; TEST_CASE("VertexDeclCompilerT5", "[t5][techset][compiler]") { - Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T5_PC); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp b/test/ObjCompilingTests/Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp index 1a41d9e5..7aaa7077 100644 --- a/test/ObjCompilingTests/Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp +++ b/test/ObjCompilingTests/Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp @@ -19,7 +19,7 @@ namespace public: TestContext() : m_memory(), - m_zone("test", 0, GameId::T6, GamePlatform::PC), + m_zone("test", 0, GameVariantId::T6_PC), m_zone_definition(), m_zone_states(m_zone), m_creators(m_zone), diff --git a/test/ObjCompilingTests/Game/T6/Techset/TechniqueCompilerT6Test.cpp b/test/ObjCompilingTests/Game/T6/Techset/TechniqueCompilerT6Test.cpp index 43b0c4aa..b380a7ad 100644 --- a/test/ObjCompilingTests/Game/T6/Techset/TechniqueCompilerT6Test.cpp +++ b/test/ObjCompilingTests/Game/T6/Techset/TechniqueCompilerT6Test.cpp @@ -56,7 +56,7 @@ namespace TEST_CASE("TechniqueCompilerT6", "[t6][techset][compiler]") { - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Game/T6/Techset/TechsetCompilerT6Test.cpp b/test/ObjCompilingTests/Game/T6/Techset/TechsetCompilerT6Test.cpp index 51a38425..ec6a61a9 100644 --- a/test/ObjCompilingTests/Game/T6/Techset/TechsetCompilerT6Test.cpp +++ b/test/ObjCompilingTests/Game/T6/Techset/TechsetCompilerT6Test.cpp @@ -28,7 +28,7 @@ namespace TEST_CASE("TechsetCompilerT6", "[techset][t6][compiler]") { - Zone zone("test", 0, GameId::T6, GamePlatform::PC); + Zone zone("test", 0, GameVariantId::T6_PC); AssetCreatorCollection creators(zone); IgnoredAssetLookup ignoredAssets; AssetCreationContext context(zone, &creators, &ignoredAssets); diff --git a/test/ObjCompilingTests/Game/T6/Techset/VertexDeclCompilerT6Test.cpp b/test/ObjCompilingTests/Game/T6/Techset/VertexDeclCompilerT6Test.cpp index 34734029..7938b532 100644 --- a/test/ObjCompilingTests/Game/T6/Techset/VertexDeclCompilerT6Test.cpp +++ b/test/ObjCompilingTests/Game/T6/Techset/VertexDeclCompilerT6Test.cpp @@ -11,7 +11,7 @@ using namespace std::literals; TEST_CASE("VertexDeclCompilerT6", "[t6][techset][compiler]") { - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); zone.Register(); MemoryManager memory; diff --git a/test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp b/test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp index 1f2d74df..5796fcf7 100644 --- a/test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp +++ b/test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp @@ -20,7 +20,7 @@ namespace { public: TestContext() - : m_zone("test", 0, GameId::T6, GamePlatform::PC), + : m_zone("test", 0, GameVariantId::T6_PC), m_zone_states(m_zone), m_out_dir() { diff --git a/test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp b/test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp index d92899bf..504dbbc0 100644 --- a/test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp +++ b/test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp @@ -20,7 +20,7 @@ namespace { public: TestContext() - : m_zone("test", 0, GameId::T6, GamePlatform::PC), + : m_zone("test", 0, GameVariantId::T6_PC), m_zone_definition(), m_zone_definition_context(m_zone_definition), m_zone_states(m_zone), diff --git a/test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp b/test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp index c9b1ddc4..b3ad3b24 100644 --- a/test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp +++ b/test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp @@ -19,7 +19,7 @@ namespace { public: TestContext() - : m_zone("test", 0, GameId::T6, GamePlatform::PC), + : m_zone("test", 0, GameVariantId::T6_PC), m_zone_definition(), m_zone_definition_context(m_zone_definition), m_zone_states(m_zone), diff --git a/test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp b/test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp index a15cc0c4..1ddfa776 100644 --- a/test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp +++ b/test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp @@ -23,7 +23,7 @@ namespace { public: TestContext() - : m_zone("test", 0, GameId::T6, GamePlatform::PC), + : m_zone("test", 0, GameVariantId::T6_PC), m_zone_states(m_zone), m_out_dir() { diff --git a/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderEmbeddedIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderEmbeddedIW3Test.cpp index d479c727..3e385f3f 100644 --- a/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderEmbeddedIW3Test.cpp +++ b/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderEmbeddedIW3Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderExternalIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderExternalIW3Test.cpp index 4041f4b6..03d62b4c 100644 --- a/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderExternalIW3Test.cpp +++ b/test/ObjLoadingTests/Game/IW3/Image/ImageLoaderExternalIW3Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp index 28806ca1..9ced200b 100644 --- a/test/ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp +++ b/test/ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp @@ -274,7 +274,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW3/Menu/LoaderMenuListIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/Menu/LoaderMenuListIW3Test.cpp index 88368cb3..dbf8d35c 100644 --- a/test/ObjLoadingTests/Game/IW3/Menu/LoaderMenuListIW3Test.cpp +++ b/test/ObjLoadingTests/Game/IW3/Menu/LoaderMenuListIW3Test.cpp @@ -20,7 +20,7 @@ namespace { public: MenuLoadingTestHelper() - : m_zone("MockZone", 0, GameId::IW3, GamePlatform::PC), + : m_zone("MockZone", 0, GameVariantId::IW3_PC), m_creator_collection(m_zone), m_context(m_zone, &m_creator_collection, &m_ignored_asset_lookup) { diff --git a/test/ObjLoadingTests/Game/IW3/PhysPreset/RawLoaderPhysPresetIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/PhysPreset/RawLoaderPhysPresetIW3Test.cpp index 6bfa3b7d..bd63939e 100644 --- a/test/ObjLoadingTests/Game/IW3/PhysPreset/RawLoaderPhysPresetIW3Test.cpp +++ b/test/ObjLoadingTests/Game/IW3/PhysPreset/RawLoaderPhysPresetIW3Test.cpp @@ -21,7 +21,7 @@ namespace MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("physic/test_phys_preset", RAW_PHYS_PRESET); - Zone loadingZone("LoadingZone", 0, GameId::IW3, GamePlatform::PC); + Zone loadingZone("LoadingZone", 0, GameVariantId::IW3_PC); AssetCreatorCollection creatorCollection(loadingZone); IgnoredAssetLookup ignoredAssetLookup; AssetCreationContext loadingContext(loadingZone, &creatorCollection, &ignoredAssetLookup); diff --git a/test/ObjLoadingTests/Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp index 16d2517a..980e0858 100644 --- a/test/ObjLoadingTests/Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp +++ b/test/ObjLoadingTests/Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp @@ -18,7 +18,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderEmbeddedIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderEmbeddedIW4Test.cpp index 36e75618..409cc6f1 100644 --- a/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderEmbeddedIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderEmbeddedIW4Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderExternalIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderExternalIW4Test.cpp index 93cccc16..1b9e3ccf 100644 --- a/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderExternalIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/Image/ImageLoaderExternalIW4Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp index fcb765de..3e5aded2 100644 --- a/test/ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp @@ -277,7 +277,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp index ee63968c..a570fae7 100644 --- a/test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp @@ -30,7 +30,7 @@ namespace test::game::iw4::menu::parsing::it public: MenuParsingItHelper() - : m_zone("MockZone", 0, GameId::IW4, GamePlatform::PC), + : m_zone("MockZone", 0, GameVariantId::IW4_PC32), m_creator_collection(m_zone), m_ignored_asset_lookup(), m_context(m_zone, &m_creator_collection, &m_ignored_asset_lookup) diff --git a/test/ObjLoadingTests/Game/IW4/PhysPreset/RawLoaderPhysPresetIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/PhysPreset/RawLoaderPhysPresetIW4Test.cpp index dc90e7b6..dab3a4c7 100644 --- a/test/ObjLoadingTests/Game/IW4/PhysPreset/RawLoaderPhysPresetIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/PhysPreset/RawLoaderPhysPresetIW4Test.cpp @@ -21,7 +21,7 @@ namespace MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("physic/test_phys_preset", RAW_PHYS_PRESET); - Zone loadingZone("LoadingZone", 0, GameId::IW4, GamePlatform::PC); + Zone loadingZone("LoadingZone", 0, GameVariantId::IW4_PC32); AssetCreatorCollection creatorCollection(loadingZone); IgnoredAssetLookup ignoredAssetLookup; AssetCreationContext loadingContext(loadingZone, &creatorCollection, &ignoredAssetLookup); diff --git a/test/ObjLoadingTests/Game/IW4/StringTable/LoaderStringTableIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/StringTable/LoaderStringTableIW4Test.cpp index 1585b4ea..451d2734 100644 --- a/test/ObjLoadingTests/Game/IW4/StringTable/LoaderStringTableIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/StringTable/LoaderStringTableIW4Test.cpp @@ -20,7 +20,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW4/Vehicle/RawLoaderVehicleIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Vehicle/RawLoaderVehicleIW4Test.cpp index 96f81413..1a41a6ae 100644 --- a/test/ObjLoadingTests/Game/IW4/Vehicle/RawLoaderVehicleIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/Vehicle/RawLoaderVehicleIW4Test.cpp @@ -85,7 +85,7 @@ tag_trophy_04_fx)" MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("vehicles/test_vehicle", RAW_VEHICLE); - Zone zone("LoadingZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("LoadingZone", 0, GameVariantId::IW4_PC32); auto* physPresetInfo = GivenTestPhysPreset("vehicle_tank", zone); auto* weaponInfo = GivenTestWeapon("sp/bradley_turret", zone); diff --git a/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderEmbeddedIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderEmbeddedIW5Test.cpp index 647306db..9c41d6cf 100644 --- a/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderEmbeddedIW5Test.cpp +++ b/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderEmbeddedIW5Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderExternalIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderExternalIW5Test.cpp index 96e45649..8fbafba3 100644 --- a/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderExternalIW5Test.cpp +++ b/test/ObjLoadingTests/Game/IW5/Image/ImageLoaderExternalIW5Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp index 67a12e83..c3bec058 100644 --- a/test/ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp +++ b/test/ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp @@ -301,7 +301,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW5/PhysPreset/RawLoaderPhysPresetIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/PhysPreset/RawLoaderPhysPresetIW5Test.cpp index 0529e2b0..517d6906 100644 --- a/test/ObjLoadingTests/Game/IW5/PhysPreset/RawLoaderPhysPresetIW5Test.cpp +++ b/test/ObjLoadingTests/Game/IW5/PhysPreset/RawLoaderPhysPresetIW5Test.cpp @@ -24,7 +24,7 @@ namespace MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("physic/test_phys_preset", RAW_PHYS_PRESET); - Zone loadingZone("LoadingZone", 0, GameId::IW5, GamePlatform::PC); + Zone loadingZone("LoadingZone", 0, GameVariantId::IW5_PC32); AssetCreatorCollection creatorCollection(loadingZone); IgnoredAssetLookup ignoredAssetLookup; AssetCreationContext loadingContext(loadingZone, &creatorCollection, &ignoredAssetLookup); diff --git a/test/ObjLoadingTests/Game/IW5/StringTable/LoaderStringTableIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/StringTable/LoaderStringTableIW5Test.cpp index 7b94170c..c59cb547 100644 --- a/test/ObjLoadingTests/Game/IW5/StringTable/LoaderStringTableIW5Test.cpp +++ b/test/ObjLoadingTests/Game/IW5/StringTable/LoaderStringTableIW5Test.cpp @@ -19,7 +19,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW5/Vehicle/RawLoaderVehicleIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/Vehicle/RawLoaderVehicleIW5Test.cpp index 4479125a..be130ddd 100644 --- a/test/ObjLoadingTests/Game/IW5/Vehicle/RawLoaderVehicleIW5Test.cpp +++ b/test/ObjLoadingTests/Game/IW5/Vehicle/RawLoaderVehicleIW5Test.cpp @@ -111,7 +111,7 @@ tag_trophy_04_fx\trophyExplodeFx\testfx1\trophyFlashFx\testfx2)" MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("vehicles/test_vehicle", RAW_VEHICLE); - Zone zone("LoadingZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("LoadingZone", 0, GameVariantId::IW5_PC32); auto* physPresetInfo = GivenTestPhysPreset("vehicle_tank", zone); auto* weaponInfo = GivenTestWeapon("sp/bradley_turret", zone); diff --git a/test/ObjLoadingTests/Game/T4/Menu/LoaderMenuListT4Test.cpp b/test/ObjLoadingTests/Game/T4/Menu/LoaderMenuListT4Test.cpp index a5428a0b..0db40d01 100644 --- a/test/ObjLoadingTests/Game/T4/Menu/LoaderMenuListT4Test.cpp +++ b/test/ObjLoadingTests/Game/T4/Menu/LoaderMenuListT4Test.cpp @@ -20,7 +20,7 @@ namespace { public: MenuLoadingTestHelper() - : m_zone("MockZone", 0, GameId::T4, GamePlatform::PC), + : m_zone("MockZone", 0, GameVariantId::T4_PC), m_creator_collection(m_zone), m_context(m_zone, &m_creator_collection, &m_ignored_asset_lookup) { diff --git a/test/ObjLoadingTests/Game/T4/PhysPreset/RawLoaderPhysPresetT4Test.cpp b/test/ObjLoadingTests/Game/T4/PhysPreset/RawLoaderPhysPresetT4Test.cpp index 5a6c8b2e..178c9ace 100644 --- a/test/ObjLoadingTests/Game/T4/PhysPreset/RawLoaderPhysPresetT4Test.cpp +++ b/test/ObjLoadingTests/Game/T4/PhysPreset/RawLoaderPhysPresetT4Test.cpp @@ -22,7 +22,7 @@ namespace MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("physic/test_phys_preset", RAW_PHYS_PRESET); - Zone loadingZone("LoadingZone", 0, GameId::T4, GamePlatform::PC); + Zone loadingZone("LoadingZone", 0, GameVariantId::T4_PC); AssetCreatorCollection creatorCollection(loadingZone); IgnoredAssetLookup ignoredAssetLookup; AssetCreationContext loadingContext(loadingZone, &creatorCollection, &ignoredAssetLookup); diff --git a/test/ObjLoadingTests/Game/T4/StringTable/LoaderStringTableT4Test.cpp b/test/ObjLoadingTests/Game/T4/StringTable/LoaderStringTableT4Test.cpp index 95c35eb6..cff93c34 100644 --- a/test/ObjLoadingTests/Game/T4/StringTable/LoaderStringTableT4Test.cpp +++ b/test/ObjLoadingTests/Game/T4/StringTable/LoaderStringTableT4Test.cpp @@ -19,7 +19,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T5/Image/ImageLoaderEmbeddedT5Test.cpp b/test/ObjLoadingTests/Game/T5/Image/ImageLoaderEmbeddedT5Test.cpp index 70aef769..0052b643 100644 --- a/test/ObjLoadingTests/Game/T5/Image/ImageLoaderEmbeddedT5Test.cpp +++ b/test/ObjLoadingTests/Game/T5/Image/ImageLoaderEmbeddedT5Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T5_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T5/Image/ImageLoaderExternalT5Test.cpp b/test/ObjLoadingTests/Game/T5/Image/ImageLoaderExternalT5Test.cpp index 6f30c048..24efaf50 100644 --- a/test/ObjLoadingTests/Game/T5/Image/ImageLoaderExternalT5Test.cpp +++ b/test/ObjLoadingTests/Game/T5/Image/ImageLoaderExternalT5Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T5_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp b/test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp index ce0d8fa5..dadaf544 100644 --- a/test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp +++ b/test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp @@ -358,7 +358,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T5_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T5/PhysPreset/RawLoaderPhysPresetT5Test.cpp b/test/ObjLoadingTests/Game/T5/PhysPreset/RawLoaderPhysPresetT5Test.cpp index 75299849..4ae827cb 100644 --- a/test/ObjLoadingTests/Game/T5/PhysPreset/RawLoaderPhysPresetT5Test.cpp +++ b/test/ObjLoadingTests/Game/T5/PhysPreset/RawLoaderPhysPresetT5Test.cpp @@ -24,7 +24,7 @@ namespace MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("physic/test_phys_preset", RAW_PHYS_PRESET); - Zone loadingZone("LoadingZone", 0, GameId::T5, GamePlatform::PC); + Zone loadingZone("LoadingZone", 0, GameVariantId::T5_PC); AssetCreatorCollection creatorCollection(loadingZone); IgnoredAssetLookup ignoredAssetLookup; AssetCreationContext loadingContext(loadingZone, &creatorCollection, &ignoredAssetLookup); diff --git a/test/ObjLoadingTests/Game/T5/StringTable/LoaderStringTableT5Test.cpp b/test/ObjLoadingTests/Game/T5/StringTable/LoaderStringTableT5Test.cpp index 86ce69ad..b2326bc4 100644 --- a/test/ObjLoadingTests/Game/T5/StringTable/LoaderStringTableT5Test.cpp +++ b/test/ObjLoadingTests/Game/T5/StringTable/LoaderStringTableT5Test.cpp @@ -19,7 +19,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T5_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp b/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp index a75adfe2..0d1215cb 100644 --- a/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp @@ -79,7 +79,7 @@ namespace ] })FONT_ICON"); - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T6/Image/ImageLoaderEmbeddedT6Test.cpp b/test/ObjLoadingTests/Game/T6/Image/ImageLoaderEmbeddedT6Test.cpp index 33b2ba0d..1a002d2c 100644 --- a/test/ObjLoadingTests/Game/T6/Image/ImageLoaderEmbeddedT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/Image/ImageLoaderEmbeddedT6Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/_testimage.dds", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T6/Image/ImageLoaderExternalT6Test.cpp b/test/ObjLoadingTests/Game/T6/Image/ImageLoaderExternalT6Test.cpp index b83f0042..53261740 100644 --- a/test/ObjLoadingTests/Game/T6/Image/ImageLoaderExternalT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/Image/ImageLoaderExternalT6Test.cpp @@ -32,7 +32,7 @@ namespace searchPath.AddFileData("images/testimage.iwi", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp b/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp index 24340f67..a86fac3d 100644 --- a/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp @@ -241,7 +241,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T6/PhysPreset/RawLoaderPhysPresetT6Test.cpp b/test/ObjLoadingTests/Game/T6/PhysPreset/RawLoaderPhysPresetT6Test.cpp index 1e088adb..ef908693 100644 --- a/test/ObjLoadingTests/Game/T6/PhysPreset/RawLoaderPhysPresetT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/PhysPreset/RawLoaderPhysPresetT6Test.cpp @@ -24,7 +24,7 @@ namespace MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("physic/test_phys_preset", RAW_PHYS_PRESET); - Zone loadingZone("LoadingZone", 0, GameId::T6, GamePlatform::PC); + Zone loadingZone("LoadingZone", 0, GameVariantId::T6_PC); AssetCreatorCollection creatorCollection(loadingZone); IgnoredAssetLookup ignoredAssetLookup; AssetCreationContext loadingContext(loadingZone, &creatorCollection, &ignoredAssetLookup); diff --git a/test/ObjLoadingTests/Game/T6/StringTable/LoaderStringTableT6Test.cpp b/test/ObjLoadingTests/Game/T6/StringTable/LoaderStringTableT6Test.cpp index ec8c0500..44a8f62f 100644 --- a/test/ObjLoadingTests/Game/T6/StringTable/LoaderStringTableT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/StringTable/LoaderStringTableT6Test.cpp @@ -19,7 +19,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjWritingTests/Game/IW3/Material/MaterialJsonDumperIW3Test.cpp b/test/ObjWritingTests/Game/IW3/Material/MaterialJsonDumperIW3Test.cpp index 8759ce94..c938ae64 100644 --- a/test/ObjWritingTests/Game/IW3/Material/MaterialJsonDumperIW3Test.cpp +++ b/test/ObjWritingTests/Game/IW3/Material/MaterialJsonDumperIW3Test.cpp @@ -550,7 +550,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/IW3/Menu/MenuDumperIW3Test.cpp b/test/ObjWritingTests/Game/IW3/Menu/MenuDumperIW3Test.cpp index a6b61b28..83a6fa95 100644 --- a/test/ObjWritingTests/Game/IW3/Menu/MenuDumperIW3Test.cpp +++ b/test/ObjWritingTests/Game/IW3/Menu/MenuDumperIW3Test.cpp @@ -212,7 +212,7 @@ namespace menu.itemCount = static_cast(std::size(items)); menu.items = items; - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); MockSearchPath mockObjPath; @@ -377,7 +377,7 @@ namespace menu.itemCount = static_cast(std::size(items)); menu.items = items; - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); MockSearchPath mockObjPath; @@ -426,7 +426,7 @@ namespace menuList.menuCount = static_cast(std::size(menus)); menuList.menus = menus; - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENULIST, menuList.name, &menuList)); @@ -531,7 +531,7 @@ namespace menu.itemCount = static_cast(std::size(items)); menu.items = items; - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/IW3/Menu/MenuListDumperIW3Test.cpp b/test/ObjWritingTests/Game/IW3/Menu/MenuListDumperIW3Test.cpp index 17998094..e79e63d4 100644 --- a/test/ObjWritingTests/Game/IW3/Menu/MenuListDumperIW3Test.cpp +++ b/test/ObjWritingTests/Game/IW3/Menu/MenuListDumperIW3Test.cpp @@ -29,7 +29,7 @@ namespace menuList.menuCount = static_cast(std::size(menus)); menuList.menus = menus; - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENULIST, menuList.name, &menuList)); MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/IW3/PhysPreset/PhysPresetInfoStringDumperIW3Test.cpp b/test/ObjWritingTests/Game/IW3/PhysPreset/PhysPresetInfoStringDumperIW3Test.cpp index a73833e5..a0be7500 100644 --- a/test/ObjWritingTests/Game/IW3/PhysPreset/PhysPresetInfoStringDumperIW3Test.cpp +++ b/test/ObjWritingTests/Game/IW3/PhysPreset/PhysPresetInfoStringDumperIW3Test.cpp @@ -32,7 +32,7 @@ namespace std::string DumpPhysPreset(PhysPreset& physPreset) { - Zone dumpingZone("DumpingZone", 0, GameId::IW3, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::IW3_PC); dumpingZone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_PHYSPRESET, physPreset.name, &physPreset)); MockSearchPath dumpingObjPath; diff --git a/test/ObjWritingTests/Game/IW3/Techset/TechsetDumperIW3Test.cpp b/test/ObjWritingTests/Game/IW3/Techset/TechsetDumperIW3Test.cpp index a58f2d7b..af9894d7 100644 --- a/test/ObjWritingTests/Game/IW3/Techset/TechsetDumperIW3Test.cpp +++ b/test/ObjWritingTests/Game/IW3/Techset/TechsetDumperIW3Test.cpp @@ -255,7 +255,7 @@ namespace TEST_CASE("TechsetDumperIW3", "[iw3][techset][dumper]") { - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); zone.Register(); MemoryManager memory; diff --git a/test/ObjWritingTests/Game/IW4/Material/MaterialJsonDumperIW4Test.cpp b/test/ObjWritingTests/Game/IW4/Material/MaterialJsonDumperIW4Test.cpp index 571838c4..7036fbcf 100644 --- a/test/ObjWritingTests/Game/IW4/Material/MaterialJsonDumperIW4Test.cpp +++ b/test/ObjWritingTests/Game/IW4/Material/MaterialJsonDumperIW4Test.cpp @@ -531,7 +531,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4Test.cpp b/test/ObjWritingTests/Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4Test.cpp index 84fd7f3c..ffe29e7a 100644 --- a/test/ObjWritingTests/Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4Test.cpp +++ b/test/ObjWritingTests/Game/IW4/PhysPreset/PhysPresetInfoStringDumperIW4Test.cpp @@ -33,7 +33,7 @@ namespace std::string DumpPhysPreset(PhysPreset& physPreset) { - Zone dumpingZone("DumpingZone", 0, GameId::IW4, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::IW4_PC32); dumpingZone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_PHYSPRESET, physPreset.name, &physPreset)); MockSearchPath dumpingObjPath; diff --git a/test/ObjWritingTests/Game/IW4/Techset/TechsetDumperIW4Test.cpp b/test/ObjWritingTests/Game/IW4/Techset/TechsetDumperIW4Test.cpp index 9725ff19..89c67d65 100644 --- a/test/ObjWritingTests/Game/IW4/Techset/TechsetDumperIW4Test.cpp +++ b/test/ObjWritingTests/Game/IW4/Techset/TechsetDumperIW4Test.cpp @@ -214,7 +214,7 @@ namespace TEST_CASE("TechsetDumperIW4", "[iw4][techset][dumper]") { - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); zone.Register(); MemoryManager memory; diff --git a/test/ObjWritingTests/Game/IW4/Vehicle/VehicleDumperIW4Test.cpp b/test/ObjWritingTests/Game/IW4/Vehicle/VehicleDumperIW4Test.cpp index 01935866..b1e393bd 100644 --- a/test/ObjWritingTests/Game/IW4/Vehicle/VehicleDumperIW4Test.cpp +++ b/test/ObjWritingTests/Game/IW4/Vehicle/VehicleDumperIW4Test.cpp @@ -64,7 +64,7 @@ namespace std::string DumpVehicle(VehicleDef& vehicle) { - Zone dumpingZone("DumpingZone", 0, GameId::IW4, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::IW4_PC32); vehicle.trophyTags[0] = dumpingZone.m_script_strings.AddOrGetScriptString("tag_trophy_left"); vehicle.trophyTags[1] = dumpingZone.m_script_strings.AddOrGetScriptString("tag_trophy_right"); dumpingZone.m_pools.AddAsset(ASSET_TYPE_VEHICLE, vehicle.name, &vehicle, {}, {}, {}); diff --git a/test/ObjWritingTests/Game/IW5/Material/MaterialJsonDumperIW5Test.cpp b/test/ObjWritingTests/Game/IW5/Material/MaterialJsonDumperIW5Test.cpp index 205a1ad3..9bb3439f 100644 --- a/test/ObjWritingTests/Game/IW5/Material/MaterialJsonDumperIW5Test.cpp +++ b/test/ObjWritingTests/Game/IW5/Material/MaterialJsonDumperIW5Test.cpp @@ -584,7 +584,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/IW5/PhysPreset/PhysPresetInfoStringDumperIW5Test.cpp b/test/ObjWritingTests/Game/IW5/PhysPreset/PhysPresetInfoStringDumperIW5Test.cpp index 968727ff..0b58f69d 100644 --- a/test/ObjWritingTests/Game/IW5/PhysPreset/PhysPresetInfoStringDumperIW5Test.cpp +++ b/test/ObjWritingTests/Game/IW5/PhysPreset/PhysPresetInfoStringDumperIW5Test.cpp @@ -39,7 +39,7 @@ namespace std::string DumpPhysPreset(PhysPreset& physPreset) { - Zone dumpingZone("DumpingZone", 0, GameId::IW5, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::IW5_PC32); dumpingZone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_PHYSPRESET, physPreset.name, &physPreset)); MockSearchPath dumpingObjPath; diff --git a/test/ObjWritingTests/Game/IW5/Techset/TechsetDumperIW5Test.cpp b/test/ObjWritingTests/Game/IW5/Techset/TechsetDumperIW5Test.cpp index dd8053e9..26461747 100644 --- a/test/ObjWritingTests/Game/IW5/Techset/TechsetDumperIW5Test.cpp +++ b/test/ObjWritingTests/Game/IW5/Techset/TechsetDumperIW5Test.cpp @@ -267,7 +267,7 @@ namespace TEST_CASE("TechsetDumperIW5", "[iw5][techset][dumper]") { - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); zone.Register(); MemoryManager memory; diff --git a/test/ObjWritingTests/Game/IW5/Vehicle/VehicleDumperIW5Test.cpp b/test/ObjWritingTests/Game/IW5/Vehicle/VehicleDumperIW5Test.cpp index e497790f..5b4220dd 100644 --- a/test/ObjWritingTests/Game/IW5/Vehicle/VehicleDumperIW5Test.cpp +++ b/test/ObjWritingTests/Game/IW5/Vehicle/VehicleDumperIW5Test.cpp @@ -77,7 +77,7 @@ namespace std::string DumpVehicle(VehicleDef& vehicle) { - Zone dumpingZone("DumpingZone", 0, GameId::IW5, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::IW5_PC32); vehicle.trophyTags[0] = dumpingZone.m_script_strings.AddOrGetScriptString("tag_trophy_iw5"); vehicle.audioOriginTag = dumpingZone.m_script_strings.AddOrGetScriptString("tag_audio_origin"); vehicle.audioOriginTagAlt = dumpingZone.m_script_strings.AddOrGetScriptString("tag_audio_origin_alt"); diff --git a/test/ObjWritingTests/Game/T4/Menu/MenuDumperT4Test.cpp b/test/ObjWritingTests/Game/T4/Menu/MenuDumperT4Test.cpp index 25a15769..a7af9f2a 100644 --- a/test/ObjWritingTests/Game/T4/Menu/MenuDumperT4Test.cpp +++ b/test/ObjWritingTests/Game/T4/Menu/MenuDumperT4Test.cpp @@ -212,7 +212,7 @@ namespace menu.itemCount = static_cast(std::size(items)); menu.items = items; - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); MockSearchPath mockObjPath; @@ -377,7 +377,7 @@ namespace menu.itemCount = static_cast(std::size(items)); menu.items = items; - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); MockSearchPath mockObjPath; @@ -426,7 +426,7 @@ namespace menuList.menuCount = static_cast(std::size(menus)); menuList.menus = menus; - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENULIST, menuList.name, &menuList)); @@ -531,7 +531,7 @@ namespace menu.itemCount = static_cast(std::size(items)); menu.items = items; - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); MockSearchPath mockObjPath; @@ -628,7 +628,7 @@ namespace menu.itemCount = static_cast(std::size(items)); menu.items = items; - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENU, menu.window.name, &menu)); MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/T4/Menu/MenuListDumperT4Test.cpp b/test/ObjWritingTests/Game/T4/Menu/MenuListDumperT4Test.cpp index 9ddb7ad9..0c581ee9 100644 --- a/test/ObjWritingTests/Game/T4/Menu/MenuListDumperT4Test.cpp +++ b/test/ObjWritingTests/Game/T4/Menu/MenuListDumperT4Test.cpp @@ -29,7 +29,7 @@ namespace menuList.menuCount = static_cast(std::size(menus)); menuList.menus = menus; - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MENULIST, menuList.name, &menuList)); MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/T4/PhysPreset/PhysPresetInfoStringDumperT4Test.cpp b/test/ObjWritingTests/Game/T4/PhysPreset/PhysPresetInfoStringDumperT4Test.cpp index 63b527f9..7e2ac08b 100644 --- a/test/ObjWritingTests/Game/T4/PhysPreset/PhysPresetInfoStringDumperT4Test.cpp +++ b/test/ObjWritingTests/Game/T4/PhysPreset/PhysPresetInfoStringDumperT4Test.cpp @@ -33,7 +33,7 @@ namespace std::string DumpPhysPreset(PhysPreset& physPreset) { - Zone dumpingZone("DumpingZone", 0, GameId::T4, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::T4_PC); dumpingZone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_PHYSPRESET, physPreset.name, &physPreset)); MockSearchPath dumpingObjPath; diff --git a/test/ObjWritingTests/Game/T4/Sound/LoadedSoundDumperT4Test.cpp b/test/ObjWritingTests/Game/T4/Sound/LoadedSoundDumperT4Test.cpp index 26796c3d..32bededb 100644 --- a/test/ObjWritingTests/Game/T4/Sound/LoadedSoundDumperT4Test.cpp +++ b/test/ObjWritingTests/Game/T4/Sound/LoadedSoundDumperT4Test.cpp @@ -53,7 +53,7 @@ namespace TEST_CASE("LoadedSoundDumperT4: Can dump PCM WAV loaded sound", "[t4][loaded-sound][assetdumper]") { - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); MockSearchPath mockObjPath; MockOutputPath mockOutput; AssetDumpingContext context(zone, "", mockOutput, mockObjPath, std::nullopt); diff --git a/test/ObjWritingTests/Game/T4/XModel/XModelGltfWriterT4Test.cpp b/test/ObjWritingTests/Game/T4/XModel/XModelGltfWriterT4Test.cpp index f08de9c8..6eb08302 100644 --- a/test/ObjWritingTests/Game/T4/XModel/XModelGltfWriterT4Test.cpp +++ b/test/ObjWritingTests/Game/T4/XModel/XModelGltfWriterT4Test.cpp @@ -42,7 +42,7 @@ namespace "tag_clip", }; - Zone zone("MockZone", 0, GameId::T4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T4_PC); std::array boneNames{}; for (auto boneIndex = 0u; boneIndex < boneNameValues.size(); boneIndex++) diff --git a/test/ObjWritingTests/Game/T5/Material/MaterialJsonDumperT5Test.cpp b/test/ObjWritingTests/Game/T5/Material/MaterialJsonDumperT5Test.cpp index f1639f1c..c863156b 100644 --- a/test/ObjWritingTests/Game/T5/Material/MaterialJsonDumperT5Test.cpp +++ b/test/ObjWritingTests/Game/T5/Material/MaterialJsonDumperT5Test.cpp @@ -613,7 +613,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T5_PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/T5/PhysPreset/PhysPresetInfoStringDumperT5Test.cpp b/test/ObjWritingTests/Game/T5/PhysPreset/PhysPresetInfoStringDumperT5Test.cpp index 8cad1ed0..6a81f23d 100644 --- a/test/ObjWritingTests/Game/T5/PhysPreset/PhysPresetInfoStringDumperT5Test.cpp +++ b/test/ObjWritingTests/Game/T5/PhysPreset/PhysPresetInfoStringDumperT5Test.cpp @@ -43,7 +43,7 @@ namespace std::string DumpPhysPreset(PhysPreset& physPreset) { - Zone dumpingZone("DumpingZone", 0, GameId::T5, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::T5_PC); dumpingZone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_PHYSPRESET, physPreset.name, &physPreset)); MockSearchPath dumpingObjPath; diff --git a/test/ObjWritingTests/Game/T5/Techset/TechsetDumperT5Test.cpp b/test/ObjWritingTests/Game/T5/Techset/TechsetDumperT5Test.cpp index 75ec3fdd..b2bb5ff7 100644 --- a/test/ObjWritingTests/Game/T5/Techset/TechsetDumperT5Test.cpp +++ b/test/ObjWritingTests/Game/T5/Techset/TechsetDumperT5Test.cpp @@ -430,7 +430,7 @@ namespace TEST_CASE("TechsetDumperT5", "[t5][techset][dumper]") { - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); zone.Register(); MemoryManager memory; diff --git a/test/ObjWritingTests/Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp b/test/ObjWritingTests/Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp index 9d901f19..80fa8708 100644 --- a/test/ObjWritingTests/Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp +++ b/test/ObjWritingTests/Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp @@ -140,7 +140,7 @@ namespace ] })FONT_ICON"); - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/T6/Material/MaterialJsonDumperT6Test.cpp b/test/ObjWritingTests/Game/T6/Material/MaterialJsonDumperT6Test.cpp index b3e2509b..42091f3b 100644 --- a/test/ObjWritingTests/Game/T6/Material/MaterialJsonDumperT6Test.cpp +++ b/test/ObjWritingTests/Game/T6/Material/MaterialJsonDumperT6Test.cpp @@ -461,7 +461,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/T6/PhysPreset/PhysPresetInfoStringDumperT6Test.cpp b/test/ObjWritingTests/Game/T6/PhysPreset/PhysPresetInfoStringDumperT6Test.cpp index 4ff2e751..e30f3ab8 100644 --- a/test/ObjWritingTests/Game/T6/PhysPreset/PhysPresetInfoStringDumperT6Test.cpp +++ b/test/ObjWritingTests/Game/T6/PhysPreset/PhysPresetInfoStringDumperT6Test.cpp @@ -43,7 +43,7 @@ namespace std::string DumpPhysPreset(PhysPreset& physPreset) { - Zone dumpingZone("DumpingZone", 0, GameId::T6, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::T6_PC); dumpingZone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_PHYSPRESET, physPreset.name, &physPreset)); MockSearchPath dumpingObjPath; diff --git a/test/ObjWritingTests/Game/T6/Techset/TechsetDumperT6Test.cpp b/test/ObjWritingTests/Game/T6/Techset/TechsetDumperT6Test.cpp index 9c2c8c04..d6feb5aa 100644 --- a/test/ObjWritingTests/Game/T6/Techset/TechsetDumperT6Test.cpp +++ b/test/ObjWritingTests/Game/T6/Techset/TechsetDumperT6Test.cpp @@ -274,7 +274,7 @@ namespace TEST_CASE("TechsetDumperT6", "[t6][techset][dumper]") { - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); zone.Register(); MemoryManager memory; diff --git a/test/SystemTests/Game/IW3/SimpleZoneIW3.cpp b/test/SystemTests/Game/IW3/SimpleZoneIW3.cpp index a8c49ac9..c98b0ff4 100644 --- a/test/SystemTests/Game/IW3/SimpleZoneIW3.cpp +++ b/test/SystemTests/Game/IW3/SimpleZoneIW3.cpp @@ -53,7 +53,7 @@ namespace auto zone = std::move(*maybeZone); REQUIRE(zone->m_game_id == GameId::IW3); - REQUIRE(zone->m_platform == GamePlatform::PC); + REQUIRE(zone->m_variant_id == GameVariantId::IW3_PC); REQUIRE(zone->m_name == "SimpleZoneIW3"); REQUIRE(zone->m_pools.GetTotalAssetCount() == 1); REQUIRE(zone->m_pools.GetAsset("SimpleZone.txt")); diff --git a/test/SystemTests/Game/IW3/XAnimIW3.cpp b/test/SystemTests/Game/IW3/XAnimIW3.cpp index 7c11c0b7..4581377b 100644 --- a/test/SystemTests/Game/IW3/XAnimIW3.cpp +++ b/test/SystemTests/Game/IW3/XAnimIW3.cpp @@ -31,7 +31,7 @@ namespace searchPath.AddFileData("xanim/test_anim", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW3_PC); AssetCreatorCollection creatorCollection(zone); IgnoredAssetLookup ignoredAssetLookup; MemoryManager memoryManager; diff --git a/test/SystemTests/Game/IW4/MapEntsIW4.cpp b/test/SystemTests/Game/IW4/MapEntsIW4.cpp index b80a6a09..c8a3018b 100644 --- a/test/SystemTests/Game/IW4/MapEntsIW4.cpp +++ b/test/SystemTests/Game/IW4/MapEntsIW4.cpp @@ -30,7 +30,7 @@ namespace mapEnts.stages = &stage; mapEnts.stageCount = 1; - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); zone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_MAP_ENTS, mapEnts.name, &mapEnts)); MockSearchPath mockObjPath; diff --git a/test/SystemTests/Game/IW4/SimpleZoneIW4.cpp b/test/SystemTests/Game/IW4/SimpleZoneIW4.cpp index a672e133..a6b924cb 100644 --- a/test/SystemTests/Game/IW4/SimpleZoneIW4.cpp +++ b/test/SystemTests/Game/IW4/SimpleZoneIW4.cpp @@ -53,7 +53,7 @@ namespace auto zone = std::move(*maybeZone); REQUIRE(zone->m_game_id == GameId::IW4); - REQUIRE(zone->m_platform == GamePlatform::PC); + REQUIRE(zone->m_variant_id == GameVariantId::IW4_PC32); REQUIRE(zone->m_name == "SimpleZoneIW4"); REQUIRE(zone->m_pools.GetTotalAssetCount() == 1); REQUIRE(zone->m_pools.GetAsset("SimpleZone.txt")); diff --git a/test/SystemTests/Game/IW4/TracerIW4.cpp b/test/SystemTests/Game/IW4/TracerIW4.cpp index e2f5ef40..c52359db 100644 --- a/test/SystemTests/Game/IW4/TracerIW4.cpp +++ b/test/SystemTests/Game/IW4/TracerIW4.cpp @@ -49,7 +49,7 @@ namespace std::string DumpTracer(TracerDef& tracerDef) { - Zone dumpingZone("DumpingZone", 0, GameId::IW4, GamePlatform::PC); + Zone dumpingZone("DumpingZone", 0, GameVariantId::IW4_PC32); dumpingZone.m_pools.AddAsset(std::make_unique>(ASSET_TYPE_TRACER, tracerDef.name, &tracerDef)); MockSearchPath dumpingObjPath; @@ -112,7 +112,7 @@ namespace MockSearchPath loadingSearchPath; loadingSearchPath.AddFileData("tracer/test_tracer", DumpTracer(*testTracer.tracer)); - Zone loadingZone("LoadingZone", 0, GameId::IW4, GamePlatform::PC); + Zone loadingZone("LoadingZone", 0, GameVariantId::IW4_PC32); auto loadingMaterial = std::make_unique(); loadingMaterial->info.name = MATERIAL_NAME; auto* loadingMaterialInfo = diff --git a/test/SystemTests/Game/IW4/XAnimIW4.cpp b/test/SystemTests/Game/IW4/XAnimIW4.cpp index e8ea1338..72233be0 100644 --- a/test/SystemTests/Game/IW4/XAnimIW4.cpp +++ b/test/SystemTests/Game/IW4/XAnimIW4.cpp @@ -40,7 +40,7 @@ namespace searchPath.AddFileData(std::format("xanim/{}", animName), std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW4_PC32); AssetCreatorCollection creatorCollection(zone); IgnoredAssetLookup ignoredAssetLookup; MemoryManager memoryManager; diff --git a/test/SystemTests/Game/IW4/XModelBoundsIW4.cpp b/test/SystemTests/Game/IW4/XModelBoundsIW4.cpp index 45fa89bf..013c3167 100644 --- a/test/SystemTests/Game/IW4/XModelBoundsIW4.cpp +++ b/test/SystemTests/Game/IW4/XModelBoundsIW4.cpp @@ -45,7 +45,7 @@ namespace searchPath.AddFileData("triangle.glb", modelData.str()); searchPath.AddFileData("xmodel/triangle.json", metadata.dump()); searchPath.AddFileData("partclassification.csv", ""); - Zone zone("bounds", 0, GameId::IW4, GamePlatform::PC); + Zone zone("bounds", 0, GameVariantId::IW4_PC32); AssetCreatorCollection creators(zone); GdtLookup gdt; IObjLoader::GetObjLoaderForGame(GameId::IW4)->ConfigureCreatorCollection(creators, zone, searchPath, gdt); diff --git a/test/SystemTests/Game/IW4/XModelTangentsIW4.cpp b/test/SystemTests/Game/IW4/XModelTangentsIW4.cpp index 13f6ccd1..68d026b4 100644 --- a/test/SystemTests/Game/IW4/XModelTangentsIW4.cpp +++ b/test/SystemTests/Game/IW4/XModelTangentsIW4.cpp @@ -43,7 +43,7 @@ namespace searchPath.AddFileData("triangle.glb", modelData.str()); searchPath.AddFileData("xmodel/triangle.json", metadata.dump()); searchPath.AddFileData("partclassification.csv", ""); - Zone zone("tangents", 0, GameId::IW4, GamePlatform::PC); + Zone zone("tangents", 0, GameVariantId::IW4_PC32); AssetCreatorCollection creators(zone); GdtLookup gdt; IObjLoader::GetObjLoaderForGame(GameId::IW4)->ConfigureCreatorCollection(creators, zone, searchPath, gdt); diff --git a/test/SystemTests/Game/IW5/SimpleZoneIW5.cpp b/test/SystemTests/Game/IW5/SimpleZoneIW5.cpp index a4af5b4d..1bfd6630 100644 --- a/test/SystemTests/Game/IW5/SimpleZoneIW5.cpp +++ b/test/SystemTests/Game/IW5/SimpleZoneIW5.cpp @@ -54,7 +54,7 @@ namespace auto zone = std::move(*maybeZone); REQUIRE(zone->m_game_id == GameId::IW5); - REQUIRE(zone->m_platform == GamePlatform::PC); + REQUIRE(zone->m_variant_id == GameVariantId::IW5_PC32); REQUIRE(zone->m_name == "SimpleZoneIW5"); REQUIRE(zone->m_pools.GetTotalAssetCount() == 1); REQUIRE(zone->m_pools.GetAsset("SimpleZone.txt")); diff --git a/test/SystemTests/Game/IW5/XAnimIW5.cpp b/test/SystemTests/Game/IW5/XAnimIW5.cpp index dce5786f..2b5b2c62 100644 --- a/test/SystemTests/Game/IW5/XAnimIW5.cpp +++ b/test/SystemTests/Game/IW5/XAnimIW5.cpp @@ -40,7 +40,7 @@ namespace searchPath.AddFileData(std::format("xanim/{}", animName), std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::IW5_PC32); AssetCreatorCollection creatorCollection(zone); IgnoredAssetLookup ignoredAssetLookup; MemoryManager memoryManager; diff --git a/test/SystemTests/Game/T5/SimpleZoneT5.cpp b/test/SystemTests/Game/T5/SimpleZoneT5.cpp index 080f6eb9..79a0773a 100644 --- a/test/SystemTests/Game/T5/SimpleZoneT5.cpp +++ b/test/SystemTests/Game/T5/SimpleZoneT5.cpp @@ -53,7 +53,7 @@ namespace auto zone = std::move(*maybeZone); REQUIRE(zone->m_game_id == GameId::T5); - REQUIRE(zone->m_platform == GamePlatform::PC); + REQUIRE(zone->m_variant_id == GameVariantId::T5_PC); REQUIRE(zone->m_name == "SimpleZoneT5"); REQUIRE(zone->m_pools.GetTotalAssetCount() == 1); REQUIRE(zone->m_pools.GetAsset("SimpleZone.txt")); diff --git a/test/SystemTests/Game/T5/XAnimT5.cpp b/test/SystemTests/Game/T5/XAnimT5.cpp index ce4e0dbb..76cbcfae 100644 --- a/test/SystemTests/Game/T5/XAnimT5.cpp +++ b/test/SystemTests/Game/T5/XAnimT5.cpp @@ -31,7 +31,7 @@ namespace searchPath.AddFileData("xanim/test_anim", std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T5_PC); AssetCreatorCollection creatorCollection(zone); IgnoredAssetLookup ignoredAssetLookup; MemoryManager memoryManager; diff --git a/test/SystemTests/Game/T6/ExtendAndDereferenceT6.cpp b/test/SystemTests/Game/T6/ExtendAndDereferenceT6.cpp index 57b25763..dfdb8d32 100644 --- a/test/SystemTests/Game/T6/ExtendAndDereferenceT6.cpp +++ b/test/SystemTests/Game/T6/ExtendAndDereferenceT6.cpp @@ -102,7 +102,7 @@ namespace auto zone = std::move(*maybeZone); REQUIRE(zone->m_game_id == GameId::T6); - REQUIRE(zone->m_platform == GamePlatform::PC); + REQUIRE(zone->m_variant_id == GameVariantId::T6_PC); REQUIRE(zone->m_name == "CombinedZoneT6"); REQUIRE(zone->m_pools.GetTotalAssetCount() == 2); REQUIRE(zone->m_pools.GetAsset("trivial_floatz_2992w610")); diff --git a/test/SystemTests/Game/T6/ReuseGlobalAssetPoolsAssetsT6.cpp b/test/SystemTests/Game/T6/ReuseGlobalAssetPoolsAssetsT6.cpp index 3e98e1b1..af44ad2e 100644 --- a/test/SystemTests/Game/T6/ReuseGlobalAssetPoolsAssetsT6.cpp +++ b/test/SystemTests/Game/T6/ReuseGlobalAssetPoolsAssetsT6.cpp @@ -105,7 +105,7 @@ namespace auto zone = std::move(*maybeZone); REQUIRE(zone->m_game_id == GameId::T6); - REQUIRE(zone->m_platform == GamePlatform::PC); + REQUIRE(zone->m_variant_id == GameVariantId::T6_PC); REQUIRE(zone->m_name == "TestZone"); REQUIRE(zone->m_pools.GetTotalAssetCount() == 3); REQUIRE(zone->m_pools.GetAsset("Suzanne2")); diff --git a/test/SystemTests/Game/T6/SimpleZoneT6.cpp b/test/SystemTests/Game/T6/SimpleZoneT6.cpp index c9e9b678..cac5d5b1 100644 --- a/test/SystemTests/Game/T6/SimpleZoneT6.cpp +++ b/test/SystemTests/Game/T6/SimpleZoneT6.cpp @@ -53,7 +53,7 @@ namespace auto zone = std::move(*maybeZone); REQUIRE(zone->m_game_id == GameId::T6); - REQUIRE(zone->m_platform == GamePlatform::PC); + REQUIRE(zone->m_variant_id == GameVariantId::T6_PC); REQUIRE(zone->m_name == "SimpleZoneT6"); REQUIRE(zone->m_pools.GetTotalAssetCount() == 1); REQUIRE(zone->m_pools.GetAsset("SimpleZone.txt")); diff --git a/test/SystemTests/Game/T6/XAnimT6.cpp b/test/SystemTests/Game/T6/XAnimT6.cpp index 06ce4bad..8039818a 100644 --- a/test/SystemTests/Game/T6/XAnimT6.cpp +++ b/test/SystemTests/Game/T6/XAnimT6.cpp @@ -40,7 +40,7 @@ namespace searchPath.AddFileData(std::format("xanim/{}", animName), std::string(data.get(), fileSize)); - Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); + Zone zone("MockZone", 0, GameVariantId::T6_PC); AssetCreatorCollection creatorCollection(zone); IgnoredAssetLookup ignoredAssetLookup; MemoryManager memoryManager; diff --git a/test/UnlinkingTests/UnlinkerArgsTests.cpp b/test/UnlinkingTests/UnlinkerArgsTests.cpp index 52266840..83d0b8c4 100644 --- a/test/UnlinkingTests/UnlinkerArgsTests.cpp +++ b/test/UnlinkingTests/UnlinkerArgsTests.cpp @@ -19,7 +19,7 @@ namespace REQUIRE(shouldContinue); REQUIRE(args.m_output_folder == UnlinkerArgs::DEFAULT_OUTPUT_FOLDER); - const Zone zone("test_zone", 0, GameId::IW4, GamePlatform::PC); + const Zone zone("test_zone", 0, GameVariantId::IW4_PC32); REQUIRE(args.GetOutputFolderPathForZone(zone) == "zone_dump/iw4/test_zone"); } @@ -28,7 +28,7 @@ namespace UnlinkerArgs args; args.m_output_folder = "zone_dump/custom"; - const Zone zone("test_zone", 0, GameId::IW4, GamePlatform::PC); + const Zone zone("test_zone", 0, GameVariantId::IW4_PC32); REQUIRE(args.GetOutputFolderPathForZone(zone) == "zone_dump/custom"); } @@ -38,7 +38,7 @@ namespace UnlinkerArgs args; args.m_output_folder = "zone_dump/?game?/?game?/?zone?"; - const Zone zone("test_zone", 0, GameId::IW4, GamePlatform::PC); + const Zone zone("test_zone", 0, GameVariantId::IW4_PC32); REQUIRE(args.GetOutputFolderPathForZone(zone) == "zone_dump/iw4/iw4/test_zone"); } diff --git a/test/ZoneCommonTests/Zone/Definition/ZoneDefinitionStreamTests.cpp b/test/ZoneCommonTests/Zone/Definition/ZoneDefinitionStreamTests.cpp index 3a17e0c8..23c77dfc 100644 --- a/test/ZoneCommonTests/Zone/Definition/ZoneDefinitionStreamTests.cpp +++ b/test/ZoneCommonTests/Zone/Definition/ZoneDefinitionStreamTests.cpp @@ -26,7 +26,7 @@ menu,demo_ingame const auto result = inputStream.ReadDefinition(); REQUIRE(result); - REQUIRE(result->m_game == GameId::T6); + REQUIRE(result->m_variant == GameVariantId::T6_PC); REQUIRE(result->m_name == "common_mp"); REQUIRE(result->m_assets.size() == 3u); @@ -58,7 +58,7 @@ material,demo_material const auto result = inputStream.ReadDefinition(); REQUIRE(result); - REQUIRE(result->m_game == GameId::T6); + REQUIRE(result->m_variant == GameVariantId::T6_PC); REQUIRE(result->m_name == "test"); REQUIRE(result->m_assets.size() == 1u); }