refactor: adapt iw4 and iw5 content writer and zone writer factory for both pc variants

This commit is contained in:
Jan Laupetin committed 2026-10-22 20:01:07 +02:00
1 parent 53c279ff4c
commit 8b16e81355
12 files changed
+142 -37

No files matched your search

@@ -1,4 +1,6 @@
>game,IW4
>variant,pc32
>name,SimpleZoneIW4
rawfile,SimpleZone.txt
@@ -0,0 +1,6 @@
>game,IW4
>variant,pc64
>name,SimpleZoneIW4
rawfile,SimpleZone.txt
+13 -3
View File
@@ -15,7 +15,7 @@ using namespace std::literals;
namespace
{
TEST_CASE("Simple Zone(IW4)", "[iw4][system][simple]")
void PerformTest(const std::string& zoneFileName, GameVariantId expectedGameVariantId)
{
const auto assetSearchPath = (oat::paths::GetSystemTestsDirectory() / "Game/IW4/Simple").string();
const auto sourceSearchPath = (oat::paths::GetSystemTestsDirectory() / "Game/IW4/Simple").string();
@@ -30,7 +30,7 @@ namespace
sourceSearchPath.c_str(),
"--output-folder",
outputPath.c_str(),
"SimpleZoneIW4",
zoneFileName.c_str(),
};
LinkerArgs args;
@@ -53,9 +53,19 @@ namespace
auto zone = std::move(*maybeZone);
REQUIRE(zone->m_game_id == GameId::IW4);
REQUIRE(zone->m_variant_id == GameVariantId::IW4_PC32);
REQUIRE(zone->m_variant_id == expectedGameVariantId);
REQUIRE(zone->m_name == "SimpleZoneIW4");
REQUIRE(zone->m_pools.GetTotalAssetCount() == 1);
REQUIRE(zone->m_pools.GetAsset<IW4::AssetRawFile>("SimpleZone.txt"));
}
TEST_CASE("Simple Zone(IW4|pc32)", "[iw4][pc32][system][simple]")
{
PerformTest("SimpleZoneIW4_32", GameVariantId::IW4_PC32);
}
TEST_CASE("Simple Zone(IW4|pc64)", "[iw4][pc64][system][simple]")
{
PerformTest("SimpleZoneIW4_64", GameVariantId::IW4_PC64);
}
} // namespace
@@ -1,4 +1,6 @@
>game,IW5
>variant,pc32
>name,SimpleZoneIW5
rawfile,SimpleZone.txt
@@ -0,0 +1,6 @@
>game,IW5
>variant,pc64
>name,SimpleZoneIW5
rawfile,SimpleZone.txt
+13 -3
View File
@@ -16,7 +16,7 @@ using namespace std::literals;
namespace
{
TEST_CASE("Simple Zone(IW5)", "[iw5][system][simple]")
void PerformTest(const std::string& zoneFileName, GameVariantId expectedGameVariantId)
{
const auto assetSearchPath = (oat::paths::GetSystemTestsDirectory() / "Game/IW5/Simple").string();
const auto sourceSearchPath = (oat::paths::GetSystemTestsDirectory() / "Game/IW5/Simple").string();
@@ -31,7 +31,7 @@ namespace
sourceSearchPath.c_str(),
"--output-folder",
outputPath.c_str(),
"SimpleZoneIW5",
zoneFileName.c_str(),
};
LinkerArgs args;
@@ -54,9 +54,19 @@ namespace
auto zone = std::move(*maybeZone);
REQUIRE(zone->m_game_id == GameId::IW5);
REQUIRE(zone->m_variant_id == GameVariantId::IW5_PC32);
REQUIRE(zone->m_variant_id == expectedGameVariantId);
REQUIRE(zone->m_name == "SimpleZoneIW5");
REQUIRE(zone->m_pools.GetTotalAssetCount() == 1);
REQUIRE(zone->m_pools.GetAsset<IW5::AssetRawFile>("SimpleZone.txt"));
}
TEST_CASE("Simple Zone(IW5|pc32)", "[iw5][pc32][system][simple]")
{
PerformTest("SimpleZoneIW5_32", GameVariantId::IW5_PC32);
}
TEST_CASE("Simple Zone(IW5|pc64)", "[iw5][pc64][system][simple]")
{
PerformTest("SimpleZoneIW5_64", GameVariantId::IW5_PC64);
}
} // namespace