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
@@ -61,8 +61,7 @@ namespace
namespace image
{
DumperIW4::DumperIW4(const AssetPool<AssetImage::Type>& pool)
: AbstractAssetDumper(pool)
DumperIW4::DumperIW4()
{
switch (ObjWriting::Configuration.ImageOutputFormat)
{
@@ -11,7 +11,7 @@ namespace image
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetImage>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetImage::Type>& pool);
DumperIW4();
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetImage::Type>& asset) override;
@@ -77,11 +77,6 @@ namespace
namespace leaderboard
{
JsonDumperIW4::JsonDumperIW4(const AssetPool<AssetLeaderboard::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void JsonDumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetLeaderboard::Type>& asset)
{
const auto assetFile = context.OpenAssetFile(GetJsonFileNameForAsset(asset.m_name));
@@ -7,9 +7,6 @@ namespace leaderboard
{
class JsonDumperIW4 final : public AbstractAssetDumper<IW4::AssetLeaderboard>
{
public:
explicit JsonDumperIW4(const AssetPool<IW4::AssetLeaderboard::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetLeaderboard::Type>& asset) override;
};
@@ -6,11 +6,6 @@ using namespace IW4;
namespace light_def
{
DumperIW4::DumperIW4(const AssetPool<AssetLightDef::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetLightDef::Type>& asset)
{
const auto* lightDef = asset.Asset();
@@ -7,9 +7,6 @@ namespace light_def
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetLightDef>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetLightDef::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetLightDef::Type>& asset) override;
};
@@ -10,14 +10,10 @@ using namespace IW4;
namespace localize
{
DumperIW4::DumperIW4(const AssetPool<AssetLocalize::Type>& pool)
: AbstractSingleProgressAssetDumper(pool)
{
}
void DumperIW4::Dump(AssetDumpingContext& context)
{
if (m_pool.m_asset_lookup.empty())
auto localizeAssets = context.m_zone.m_pools.PoolAssets<AssetLocalize>();
if (localizeAssets.empty())
return;
const auto language = LocalizeCommon::GetNameOfLanguage(context.m_zone.m_language);
@@ -34,7 +30,7 @@ namespace localize
stringFileDumper.SetNotes("");
for (const auto* localizeEntry : m_pool)
for (const auto* localizeEntry : localizeAssets)
{
stringFileDumper.WriteLocalizeEntry(localizeEntry->m_name, localizeEntry->Asset()->value);
}
@@ -8,8 +8,6 @@ namespace localize
class DumperIW4 final : public AbstractSingleProgressAssetDumper<IW4::AssetLocalize>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetLocalize::Type>& pool);
void Dump(AssetDumpingContext& context) override;
};
} // namespace localize
@@ -7,11 +7,6 @@ using namespace IW4;
namespace addon_map_ents
{
DumperIW4::DumperIW4(const AssetPool<AssetAddonMapEnts::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetAddonMapEnts::Type>& asset)
{
const auto* addonMapEnts = asset.Asset();
@@ -7,9 +7,6 @@ namespace addon_map_ents
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetAddonMapEnts>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetAddonMapEnts::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetAddonMapEnts::Type>& asset) override;
};
@@ -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;
};
@@ -1,6 +1,5 @@
#include "MenuDumperIW4.h"
#include "Game/IW4/GameAssetPoolIW4.h"
#include "MenuListDumperIW4.h"
#include "MenuWriterIW4.h"
#include "ObjWriting.h"
@@ -25,11 +24,6 @@ namespace
namespace menu
{
MenuDumperIW4::MenuDumperIW4(const AssetPool<AssetMenu::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void MenuDumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetMenu::Type>& asset)
{
const auto* menu = asset.Asset();
@@ -38,8 +32,8 @@ namespace menu
if (!ObjWriting::ShouldHandleAssetType(ASSET_TYPE_MENULIST))
{
// Make sure menu paths based on menu lists are created
const auto* gameAssetPool = dynamic_cast<GameAssetPoolIW4*>(asset.m_zone->m_pools.get());
for (auto* menuListAsset : *gameAssetPool->m_menu_list)
auto menuListAssets = context.m_zone.m_pools.PoolAssets<AssetMenuList>();
for (auto* menuListAsset : menuListAssets)
CreateDumpingStateForMenuListIW4(zoneState, menuListAsset->Asset());
}
@@ -7,9 +7,6 @@ namespace menu
{
class MenuDumperIW4 final : public AbstractAssetDumper<IW4::AssetMenu>
{
public:
explicit MenuDumperIW4(const AssetPool<IW4::AssetMenu::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetMenu::Type>& asset) override;
};
@@ -147,11 +147,6 @@ namespace menu
}
}
MenuListDumperIW4::MenuListDumperIW4(const AssetPool<AssetMenuList::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void MenuListDumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetMenuList::Type>& asset)
{
const auto* menuList = asset.Asset();
@@ -178,7 +173,8 @@ namespace menu
{
auto* zoneState = context.GetZoneAssetDumperState<MenuDumpingZoneState>();
for (const auto* asset : m_pool)
auto menuListAssets = context.m_zone.m_pools.PoolAssets<AssetMenuList>();
for (const auto* asset : menuListAssets)
CreateDumpingStateForMenuListIW4(zoneState, asset->Asset());
AbstractAssetDumper::Dump(context);
@@ -11,8 +11,6 @@ namespace menu
class MenuListDumperIW4 final : public AbstractAssetDumper<IW4::AssetMenuList>
{
public:
explicit MenuListDumperIW4(const AssetPool<IW4::AssetMenuList::Type>& pool);
void Dump(AssetDumpingContext& context) override;
protected:
+37 -64
View File
@@ -1,6 +1,5 @@
#include "ObjWriterIW4.h"
#include "Game/IW4/GameAssetPoolIW4.h"
#include "Game/IW4/Material/MaterialJsonDumperIW4.h"
#include "Game/IW4/XModel/XModelDumperIW4.h"
#include "Image/ImageDumperIW4.h"
@@ -11,7 +10,6 @@
#include "Material/MaterialDecompilingDumperIW4.h"
#include "Menu/MenuDumperIW4.h"
#include "Menu/MenuListDumperIW4.h"
#include "ObjWriting.h"
#include "PhysCollmap/PhysCollmapDumperIW4.h"
#include "PhysPreset/PhysPresetInfoStringDumperIW4.h"
#include "RawFile/RawFileDumperIW4.h"
@@ -28,69 +26,44 @@
using namespace IW4;
bool ObjWriter::DumpZone(AssetDumpingContext& context) const
void ObjWriter::RegisterAssetDumpers(AssetDumpingContext& context)
{
#define REGISTER_DUMPER(dumperType, poolName) \
if (assetPools->poolName && ObjWriting::ShouldHandleAssetType(dumperType::AssetType_t::EnumEntry)) \
{ \
dumpers.emplace_back(std::make_unique<dumperType>(*assetPools->poolName)); \
}
const auto* assetPools = dynamic_cast<GameAssetPoolIW4*>(context.m_zone.m_pools.get());
std::vector<std::unique_ptr<IAssetDumper>> dumpers;
REGISTER_DUMPER(phys_preset::InfoStringDumperIW4, m_phys_preset)
REGISTER_DUMPER(phys_collmap::DumperIW4, m_phys_collmap)
// REGISTER_DUMPER(AssetDumperXAnimParts, m_xanim_parts)
REGISTER_DUMPER(xmodel::DumperIW4, m_xmodel)
REGISTER_DUMPER(material::JsonDumperIW4, m_material)
RegisterAssetDumper(std::make_unique<phys_preset::InfoStringDumperIW4>());
RegisterAssetDumper(std::make_unique<phys_collmap::DumperIW4>());
// REGISTER_DUMPER(AssetDumperXAnimParts)
RegisterAssetDumper(std::make_unique<xmodel::DumperIW4>());
RegisterAssetDumper(std::make_unique<material::JsonDumperIW4>());
#ifdef EXPERIMENTAL_MATERIAL_COMPILATION
DUMP_ASSET_POOL(material::DecompilingGdtDumperIW4, m_material)
RegisterAssetDumper(std::make_unique<material::DecompilingGdtDumperIW4>());
#endif
REGISTER_DUMPER(shader::PixelShaderDumperIW4, m_material_pixel_shader)
REGISTER_DUMPER(shader::VertexShaderDumperIW4, m_material_vertex_shader)
REGISTER_DUMPER(techset::DumperIW4, m_technique_set)
REGISTER_DUMPER(image::DumperIW4, m_image)
// REGISTER_DUMPER(AssetDumpersnd_alias_list_t, m_sound)
REGISTER_DUMPER(sound_curve::DumperIW4, m_sound_curve)
REGISTER_DUMPER(sound::LoadedSoundDumperIW4, m_loaded_sound)
// REGISTER_DUMPER(AssetDumperClipMap, m_clip_map)
// REGISTER_DUMPER(AssetDumperComWorld, m_com_world)
// REGISTER_DUMPER(AssetDumperGameWorldSp, m_game_world_sp)
// REGISTER_DUMPER(AssetDumperGameWorldMp, m_game_world_mp)
// REGISTER_DUMPER(AssetDumperMapEnts, m_map_ents)
// REGISTER_DUMPER(AssetDumperFxWorld, m_fx_world)
// REGISTER_DUMPER(AssetDumperGfxWorld, m_gfx_world)
REGISTER_DUMPER(light_def::DumperIW4, m_gfx_light_def)
// REGISTER_DUMPER(AssetDumperFont_s, m_font)
REGISTER_DUMPER(menu::MenuListDumperIW4, m_menu_list)
REGISTER_DUMPER(menu::MenuDumperIW4, m_menu_def)
REGISTER_DUMPER(localize::DumperIW4, m_localize)
REGISTER_DUMPER(weapon::DumperIW4, m_weapon)
// REGISTER_DUMPER(AssetDumperSndDriverGlobals, m_snd_driver_globals)
// REGISTER_DUMPER(AssetDumperFxEffectDef, m_fx)
// REGISTER_DUMPER(AssetDumperFxImpactTable, m_fx_impact_table)
REGISTER_DUMPER(raw_file::DumperIW4, m_raw_file)
REGISTER_DUMPER(string_table::DumperIW4, m_string_table)
REGISTER_DUMPER(leaderboard::JsonDumperIW4, m_leaderboard)
REGISTER_DUMPER(structured_data_def::DumperIW4, m_structed_data_def_set)
REGISTER_DUMPER(tracer::DumperIW4, m_tracer)
REGISTER_DUMPER(vehicle::DumperIW4, m_vehicle)
REGISTER_DUMPER(addon_map_ents::DumperIW4, m_addon_map_ents)
if (context.ShouldTrackProgress())
{
size_t totalProgress = 0uz;
for (const auto& dumper : dumpers)
totalProgress += dumper->GetProgressTotalCount();
context.SetTotalProgress(totalProgress);
}
for (const auto& dumper : dumpers)
dumper->Dump(context);
return true;
#undef REGISTER_DUMPER
RegisterAssetDumper(std::make_unique<shader::PixelShaderDumperIW4>());
RegisterAssetDumper(std::make_unique<shader::VertexShaderDumperIW4>());
RegisterAssetDumper(std::make_unique<techset::DumperIW4>());
RegisterAssetDumper(std::make_unique<image::DumperIW4>());
// REGISTER_DUMPER(AssetDumpersnd_alias_list_t)
RegisterAssetDumper(std::make_unique<sound_curve::DumperIW4>());
RegisterAssetDumper(std::make_unique<sound::LoadedSoundDumperIW4>());
// REGISTER_DUMPER(AssetDumperClipMap)
// REGISTER_DUMPER(AssetDumperComWorld)
// REGISTER_DUMPER(AssetDumperGameWorldSp)
// REGISTER_DUMPER(AssetDumperGameWorldMp)
// REGISTER_DUMPER(AssetDumperMapEnts)
// REGISTER_DUMPER(AssetDumperFxWorld)
// REGISTER_DUMPER(AssetDumperGfxWorld)
RegisterAssetDumper(std::make_unique<light_def::DumperIW4>());
// REGISTER_DUMPER(AssetDumperFont_s)
RegisterAssetDumper(std::make_unique<menu::MenuListDumperIW4>());
RegisterAssetDumper(std::make_unique<menu::MenuDumperIW4>());
RegisterAssetDumper(std::make_unique<localize::DumperIW4>());
RegisterAssetDumper(std::make_unique<weapon::DumperIW4>());
// REGISTER_DUMPER(AssetDumperSndDriverGlobals)
// REGISTER_DUMPER(AssetDumperFxEffectDef)
// REGISTER_DUMPER(AssetDumperFxImpactTable)
RegisterAssetDumper(std::make_unique<raw_file::DumperIW4>());
RegisterAssetDumper(std::make_unique<string_table::DumperIW4>());
RegisterAssetDumper(std::make_unique<leaderboard::JsonDumperIW4>());
RegisterAssetDumper(std::make_unique<structured_data_def::DumperIW4>());
RegisterAssetDumper(std::make_unique<tracer::DumperIW4>());
RegisterAssetDumper(std::make_unique<vehicle::DumperIW4>());
RegisterAssetDumper(std::make_unique<addon_map_ents::DumperIW4>());
}
+4 -3
View File
@@ -1,11 +1,12 @@
#pragma once
#include "IObjWriter.h"
#include "ObjWriter.h"
namespace IW4
{
class ObjWriter final : public IObjWriter
{
public:
bool DumpZone(AssetDumpingContext& context) const override;
protected:
void RegisterAssetDumpers(AssetDumpingContext& context) override;
};
} // namespace IW4
@@ -10,11 +10,6 @@ using namespace IW4;
namespace phys_collmap
{
DumperIW4::DumperIW4(const AssetPool<AssetPhysCollMap::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetPhysCollMap::Type>& asset)
{
const auto* physCollmap = asset.Asset();
@@ -7,9 +7,6 @@ namespace phys_collmap
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetPhysCollMap>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetPhysCollMap::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetPhysCollMap::Type>& asset) override;
};
@@ -80,11 +80,6 @@ namespace
namespace phys_preset
{
InfoStringDumperIW4::InfoStringDumperIW4(const AssetPool<AssetPhysPreset::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void InfoStringDumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetPhysPreset::Type>& asset)
{
// Only dump raw when no gdt available
@@ -7,9 +7,6 @@ namespace phys_preset
{
class InfoStringDumperIW4 final : public AbstractAssetDumper<IW4::AssetPhysPreset>
{
public:
explicit InfoStringDumperIW4(const AssetPool<IW4::AssetPhysPreset::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetPhysPreset::Type>& asset) override;
};
@@ -10,11 +10,6 @@ using namespace IW4;
namespace raw_file
{
DumperIW4::DumperIW4(const AssetPool<AssetRawFile::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetRawFile::Type>& asset)
{
const auto* rawFile = asset.Asset();
@@ -7,9 +7,6 @@ namespace raw_file
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetRawFile>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetRawFile::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetRawFile::Type>& asset) override;
};
@@ -6,11 +6,6 @@ using namespace IW4;
namespace shader
{
PixelShaderDumperIW4::PixelShaderDumperIW4(const AssetPool<AssetPixelShader::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void PixelShaderDumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetPixelShader::Type>& asset)
{
const auto* pixelShader = asset.Asset();
@@ -7,9 +7,6 @@ namespace shader
{
class PixelShaderDumperIW4 final : public AbstractAssetDumper<IW4::AssetPixelShader>
{
public:
explicit PixelShaderDumperIW4(const AssetPool<IW4::AssetPixelShader::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetPixelShader::Type>& asset) override;
};
@@ -6,11 +6,6 @@ using namespace IW4;
namespace shader
{
VertexShaderDumperIW4::VertexShaderDumperIW4(const AssetPool<AssetVertexShader::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void VertexShaderDumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetVertexShader::Type>& asset)
{
const auto* vertexShader = asset.Asset();
@@ -7,9 +7,6 @@ namespace shader
{
class VertexShaderDumperIW4 final : public AbstractAssetDumper<IW4::AssetVertexShader>
{
public:
explicit VertexShaderDumperIW4(const AssetPool<IW4::AssetVertexShader::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetVertexShader::Type>& asset) override;
};
@@ -25,11 +25,6 @@ namespace
namespace sound
{
LoadedSoundDumperIW4::LoadedSoundDumperIW4(const AssetPool<AssetLoadedSound::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void LoadedSoundDumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetLoadedSound::Type>& asset)
{
const auto* loadedSound = asset.Asset();
@@ -7,9 +7,6 @@ namespace sound
{
class LoadedSoundDumperIW4 final : public AbstractAssetDumper<IW4::AssetLoadedSound>
{
public:
explicit LoadedSoundDumperIW4(const AssetPool<IW4::AssetLoadedSound::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetLoadedSound::Type>& asset) override;
};
@@ -7,11 +7,6 @@ using namespace IW4;
namespace sound_curve
{
DumperIW4::DumperIW4(const AssetPool<AssetSoundCurve::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetSoundCurve::Type>& asset)
{
const auto* sndCurve = asset.Asset();
@@ -7,9 +7,6 @@ namespace sound_curve
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetSoundCurve>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetSoundCurve::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetSoundCurve::Type>& asset) override;
};
@@ -6,11 +6,6 @@ using namespace IW4;
namespace string_table
{
DumperIW4::DumperIW4(const AssetPool<AssetStringTable::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetStringTable::Type>& asset)
{
const auto* stringTable = asset.Asset();
@@ -7,9 +7,6 @@ namespace string_table
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetStringTable>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetStringTable::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetStringTable::Type>& asset) override;
};
@@ -187,11 +187,6 @@ namespace
namespace structured_data_def
{
DumperIW4::DumperIW4(const AssetPool<AssetStructuredDataDef::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetStructuredDataDef::Type>& asset)
{
const auto* set = asset.Asset();
@@ -7,9 +7,6 @@ namespace structured_data_def
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetStructuredDataDef>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetStructuredDataDef::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetStructuredDataDef::Type>& asset) override;
};
@@ -250,7 +250,8 @@ namespace
if (vertexShader->name[0] == ',')
{
const auto loadedVertexShaderFromOtherZone = GlobalAssetPool<MaterialVertexShader>::GetAssetByName(&vertexShader->name[1]);
const auto loadedVertexShaderFromOtherZone =
GameGlobalAssetPools::GetGlobalPoolsForGame(GameId::IW4)->GetAsset<AssetVertexShader>(&vertexShader->name[1]);
if (loadedVertexShaderFromOtherZone == nullptr)
{
@@ -305,7 +306,8 @@ namespace
if (pixelShader->name[0] == ',')
{
const auto loadedPixelShaderFromOtherZone = GlobalAssetPool<MaterialPixelShader>::GetAssetByName(&pixelShader->name[1]);
const auto loadedPixelShaderFromOtherZone =
GameGlobalAssetPools::GetGlobalPoolsForGame(GameId::IW4)->GetAsset<AssetPixelShader>(&pixelShader->name[1]);
if (loadedPixelShaderFromOtherZone == nullptr)
{
@@ -377,7 +379,8 @@ namespace
if (vertexDecl->name && vertexDecl->name[0] == ',')
{
const auto loadedVertexDeclFromOtherZone = GlobalAssetPool<MaterialVertexDeclaration>::GetAssetByName(&vertexDecl->name[1]);
const auto loadedVertexDeclFromOtherZone =
GameGlobalAssetPools::GetGlobalPoolsForGame(GameId::IW4)->GetAsset<AssetVertexDecl>(&vertexDecl->name[1]);
if (loadedVertexDeclFromOtherZone == nullptr)
{
@@ -488,11 +491,6 @@ namespace
namespace techset
{
DumperIW4::DumperIW4(const AssetPool<AssetTechniqueSet::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetTechniqueSet::Type>& asset)
{
const auto* techniqueSet = asset.Asset();
@@ -7,9 +7,6 @@ namespace techset
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetTechniqueSet>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetTechniqueSet::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetTechniqueSet::Type>& asset) override;
};
@@ -52,11 +52,6 @@ namespace
namespace tracer
{
DumperIW4::DumperIW4(const AssetPool<AssetTracer::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetTracer::Type>& asset)
{
// Only dump raw when no gdt available
@@ -7,9 +7,6 @@ namespace tracer
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetTracer>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetTracer::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetTracer::Type>& asset) override;
};
@@ -93,11 +93,6 @@ namespace
namespace vehicle
{
DumperIW4::DumperIW4(const AssetPool<AssetVehicle::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetVehicle::Type>& asset)
{
// Only dump raw when no gdt available
@@ -7,9 +7,6 @@ namespace vehicle
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetVehicle>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetVehicle::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetVehicle::Type>& asset) override;
};
@@ -405,11 +405,6 @@ namespace
namespace weapon
{
DumperIW4::DumperIW4(const AssetPool<AssetWeapon::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void DumperIW4::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetWeapon::Type>& asset)
{
// Only dump raw when no gdt available
@@ -7,9 +7,6 @@ namespace weapon
{
class DumperIW4 final : public AbstractAssetDumper<IW4::AssetWeapon>
{
public:
explicit DumperIW4(const AssetPool<IW4::AssetWeapon::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW4::AssetWeapon::Type>& asset) override;
};