mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-26 14:21:49 +00:00
chore: use IObjLoader directly instead of indirection of ObjLoading
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include "AssetLoading/AssetLoadingContext.h"
|
||||
#include "Game/IW3/GameAssetPoolIW3.h"
|
||||
#include "Game/IW3/GameIW3.h"
|
||||
#include "IObjLoader.h"
|
||||
#include "ObjLoading.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
@ -53,13 +54,14 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto assetLoadingContext = std::make_unique<AssetLoadingContext>(*zone, *context.m_asset_search_path, CreateGdtList(context));
|
||||
ApplyIgnoredAssets(context, *assetLoadingContext);
|
||||
|
||||
const auto* objLoader = IObjLoader::GetObjLoaderForGame(GameId::IW3);
|
||||
for (const auto& assetEntry : context.m_definition->m_assets)
|
||||
{
|
||||
if (!ObjLoading::LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
if (!objLoader->LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ObjLoading::FinalizeAssetsForZone(*assetLoadingContext);
|
||||
objLoader->FinalizeAssetsForZone(*assetLoadingContext);
|
||||
|
||||
return zone;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "Game/IW4/GameAssetPoolIW4.h"
|
||||
#include "Game/IW4/GameIW4.h"
|
||||
#include "IObjLoader.h"
|
||||
#include "ObjLoading.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
@ -52,13 +53,14 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto assetLoadingContext = std::make_unique<AssetLoadingContext>(*zone, *context.m_asset_search_path, CreateGdtList(context));
|
||||
ApplyIgnoredAssets(context, *assetLoadingContext);
|
||||
|
||||
const auto* objLoader = IObjLoader::GetObjLoaderForGame(GameId::IW4);
|
||||
for (const auto& assetEntry : context.m_definition->m_assets)
|
||||
{
|
||||
if (!ObjLoading::LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
if (!objLoader->LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ObjLoading::FinalizeAssetsForZone(*assetLoadingContext);
|
||||
objLoader->FinalizeAssetsForZone(*assetLoadingContext);
|
||||
|
||||
return zone;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "Game/IW5/GameAssetPoolIW5.h"
|
||||
#include "Game/IW5/GameIW5.h"
|
||||
#include "IObjLoader.h"
|
||||
#include "ObjLoading.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
@ -52,13 +53,14 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto assetLoadingContext = std::make_unique<AssetLoadingContext>(*zone, *context.m_asset_search_path, CreateGdtList(context));
|
||||
ApplyIgnoredAssets(context, *assetLoadingContext);
|
||||
|
||||
const auto* objLoader = IObjLoader::GetObjLoaderForGame(GameId::IW5);
|
||||
for (const auto& assetEntry : context.m_definition->m_assets)
|
||||
{
|
||||
if (!ObjLoading::LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
if (!objLoader->LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ObjLoading::FinalizeAssetsForZone(*assetLoadingContext);
|
||||
objLoader->FinalizeAssetsForZone(*assetLoadingContext);
|
||||
|
||||
return zone;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "AssetLoading/AssetLoadingContext.h"
|
||||
#include "Game/T5/GameAssetPoolT5.h"
|
||||
#include "Game/T5/GameT5.h"
|
||||
#include "IObjLoader.h"
|
||||
#include "ObjLoading.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
@ -53,13 +54,14 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto assetLoadingContext = std::make_unique<AssetLoadingContext>(*zone, *context.m_asset_search_path, CreateGdtList(context));
|
||||
ApplyIgnoredAssets(context, *assetLoadingContext);
|
||||
|
||||
const auto* objLoader = IObjLoader::GetObjLoaderForGame(GameId::T5);
|
||||
for (const auto& assetEntry : context.m_definition->m_assets)
|
||||
{
|
||||
if (!ObjLoading::LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
if (!objLoader->LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ObjLoading::FinalizeAssetsForZone(*assetLoadingContext);
|
||||
objLoader->FinalizeAssetsForZone(*assetLoadingContext);
|
||||
|
||||
return zone;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "Game/T6/GameAssetPoolT6.h"
|
||||
#include "Game/T6/GameT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "IObjLoader.h"
|
||||
#include "ObjLoading.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
@ -106,13 +107,14 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
|
||||
HandleMetadata(zone.get(), context);
|
||||
|
||||
const auto* objLoader = IObjLoader::GetObjLoaderForGame(GameId::T6);
|
||||
for (const auto& assetEntry : context.m_definition->m_assets)
|
||||
{
|
||||
if (!ObjLoading::LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
if (!objLoader->LoadAssetForZone(*assetLoadingContext, assetEntry.m_asset_type, assetEntry.m_asset_name))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ObjLoading::FinalizeAssetsForZone(*assetLoadingContext);
|
||||
objLoader->FinalizeAssetsForZone(*assetLoadingContext);
|
||||
|
||||
return zone;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "ZoneCreator.h"
|
||||
|
||||
#include "AssetLoading/AssetLoadingContext.h"
|
||||
#include "Game/IW3/ZoneCreatorIW3.h"
|
||||
#include "Game/IW4/ZoneCreatorIW4.h"
|
||||
#include "Game/IW5/ZoneCreatorIW5.h"
|
||||
|
Reference in New Issue
Block a user