refactor: introduce subasset loading

This commit is contained in:
Jan Laupetin
2026-02-05 18:17:15 +01:00
parent 1be411b371
commit aa47ffa629
255 changed files with 1668 additions and 3132 deletions
@@ -1,7 +1,5 @@
#include "MenuDumperIW5.h"
#include "Game/IW5/GameAssetPoolIW5.h"
#include "Game/IW5/Menu/MenuDumperIW5.h"
#include "MenuWriterIW5.h"
#include "ObjWriting.h"
@@ -18,8 +16,8 @@ namespace
const MenuList* GetParentMenuList(const XAssetInfo<menuDef_t>& asset)
{
const auto* menu = asset.Asset();
const auto* gameAssetPool = dynamic_cast<GameAssetPoolIW5*>(asset.m_zone->m_pools.get());
for (const auto* menuList : *gameAssetPool->m_menu_list)
auto zoneMenuListPool = asset.m_zone->m_pools.PoolAssets<AssetMenuList>();
for (const auto* menuList : zoneMenuListPool)
{
const auto* menuListAsset = menuList->Asset();
@@ -51,11 +49,6 @@ namespace
namespace menu
{
MenuDumperIW5::MenuDumperIW5(const AssetPool<AssetMenu::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void MenuDumperIW5::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetMenu::Type>& asset)
{
const auto* menu = asset.Asset();
@@ -7,9 +7,6 @@ namespace menu
{
class MenuDumperIW5 final : public AbstractAssetDumper<IW5::AssetMenu>
{
public:
explicit MenuDumperIW5(const AssetPool<IW5::AssetMenu::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW5::AssetMenu::Type>& asset) override;
};
@@ -106,11 +106,6 @@ namespace
namespace menu
{
MenuListDumperIW5::MenuListDumperIW5(const AssetPool<AssetMenuList::Type>& pool)
: AbstractAssetDumper(pool)
{
}
void MenuListDumperIW5::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetMenuList::Type>& asset)
{
const auto* menuList = asset.Asset();
@@ -7,9 +7,6 @@ namespace menu
{
class MenuListDumperIW5 final : public AbstractAssetDumper<IW5::AssetMenuList>
{
public:
explicit MenuListDumperIW5(const AssetPool<IW5::AssetMenuList::Type>& pool);
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<IW5::AssetMenuList::Type>& asset) override;
};