mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-10-24 12:38:10 +00:00
refactor: use variants in zone instead of only game
This commit is contained in:
138 files changed
+542
-549
No files matched your search
@@ -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<IW3::AssetRawFile>("SimpleZone.txt"));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<XAssetInfo<MapEnts>>(ASSET_TYPE_MAP_ENTS, mapEnts.name, &mapEnts));
|
||||
|
||||
MockSearchPath mockObjPath;
|
||||
|
||||
@@ -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<IW4::AssetRawFile>("SimpleZone.txt"));
|
||||
|
||||
@@ -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<XAssetInfo<TracerDef>>(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<Material>();
|
||||
loadingMaterial->info.name = MATERIAL_NAME;
|
||||
auto* loadingMaterialInfo =
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<IW5::AssetRawFile>("SimpleZone.txt"));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<T5::AssetRawFile>("SimpleZone.txt"));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<T6::AssetTechniqueSet>("trivial_floatz_2992w610"));
|
||||
|
||||
@@ -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<T6::AssetMaterial>("Suzanne2"));
|
||||
|
||||
@@ -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<T6::AssetRawFile>("SimpleZone.txt"));
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user