2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 16:52:35 +00:00

refactor: introduce subasset loading

This commit is contained in:
Jan Laupetin
2026-02-05 16:25:00 +00:00
parent 1be411b371
commit aa47ffa629
255 changed files with 1668 additions and 3132 deletions
@@ -1,7 +1,6 @@
#include "MaterialConstantZoneStateIW4.h"
#include "Game/IW4/CommonIW4.h"
#include "Game/IW4/GameAssetPoolIW4.h"
#include "Game/IW4/GameIW4.h"
#include "ObjWriting.h"
#include "Zone/ZoneRegistry.h"
@@ -205,18 +204,14 @@ namespace IW4
{
for (const auto* zone : ZoneRegistry::GetRegistryForGame(GameId::IW4)->Zones())
{
const auto* assetPools = dynamic_cast<const GameAssetPoolIW4*>(zone->m_pools.get());
if (!assetPools)
return;
for (const auto* vertexShaderAsset : *assetPools->m_material_vertex_shader)
for (const auto* vertexShaderAsset : zone->m_pools.PoolAssets<AssetVertexShader>())
{
const auto* vertexShader = vertexShaderAsset->Asset();
if (ShouldDumpFromStruct(vertexShader))
ExtractNamesFromShader(vertexShader->prog.loadDef.program, static_cast<size_t>(vertexShader->prog.loadDef.programSize) * sizeof(uint32_t));
}
for (const auto* pixelShaderAsset : *assetPools->m_material_pixel_shader)
for (const auto* pixelShaderAsset : zone->m_pools.PoolAssets<AssetPixelShader>())
{
const auto* pixelShader = pixelShaderAsset->Asset();
if (ShouldDumpFromStruct(pixelShader))
@@ -1109,11 +1109,6 @@ namespace
namespace material
{
DecompilingGdtDumperIW4::DecompilingGdtDumperIW4(const AssetPool<AssetMaterial::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DecompilingGdtDumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetMaterial::Type>& asset)
{
if (!context.m_gdt)
@@ -7,9 +7,6 @@ namespace material
{
class DecompilingGdtDumperIW4 final : public AbstractAssetDumper<IW4::AssetMaterial>
{
public:
explicit DecompilingGdtDumperIW4(const AssetPool<IW4::AssetMaterial::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetMaterial::Type>& asset) override;
};