mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-01-11 11:11:50 +00:00
refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
#include <format>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::image;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -37,7 +36,7 @@ namespace
|
||||
|
||||
std::unique_ptr<Texture> LoadImageFromIwi(const GfxImage& image, ISearchPath& searchPath)
|
||||
{
|
||||
const auto imageFileName = std::format("images/{}.iwi", image.name);
|
||||
const auto imageFileName = image::GetFileNameForAsset(image.name, ".iwi");
|
||||
const auto filePathImage = searchPath.Open(imageFileName);
|
||||
if (!filePathImage.IsOpen())
|
||||
{
|
||||
@@ -57,9 +56,9 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::image
|
||||
namespace image
|
||||
{
|
||||
Dumper::Dumper()
|
||||
DumperIW4::DumperIW4()
|
||||
{
|
||||
switch (ObjWriting::Configuration.ImageOutputFormat)
|
||||
{
|
||||
@@ -76,12 +75,12 @@ namespace IW4::image
|
||||
}
|
||||
}
|
||||
|
||||
bool Dumper::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto texture = LoadImageData(context.m_obj_search_path, *image);
|
||||
@@ -96,4 +95,4 @@ namespace IW4::image
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, texture.get());
|
||||
}
|
||||
} // namespace IW4::image
|
||||
} // namespace image
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4::image
|
||||
namespace image
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<GfxImage>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::GfxImage>
|
||||
{
|
||||
public:
|
||||
Dumper();
|
||||
DumperIW4();
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::GfxImage>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::GfxImage>* asset) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<IImageWriter> m_writer;
|
||||
};
|
||||
} // namespace IW4::image
|
||||
} // namespace image
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace IW4;
|
||||
using namespace ::leaderboard;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -76,14 +75,14 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
bool JsonDumper::ShouldDump(XAssetInfo<LeaderboardDef>* asset)
|
||||
bool JsonDumperIW4::ShouldDump(XAssetInfo<LeaderboardDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void JsonDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<LeaderboardDef>* asset)
|
||||
void JsonDumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<LeaderboardDef>* asset)
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile(GetJsonFileNameForAsset(asset->m_name));
|
||||
|
||||
@@ -93,4 +92,4 @@ namespace IW4::leaderboard
|
||||
Dumper dumper(*assetFile);
|
||||
dumper.Dump(*asset->Asset());
|
||||
}
|
||||
} // namespace IW4::leaderboard
|
||||
} // namespace leaderboard
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
class JsonDumper final : public AbstractAssetDumper<LeaderboardDef>
|
||||
class JsonDumperIW4 final : public AbstractAssetDumper<IW4::LeaderboardDef>
|
||||
{
|
||||
protected:
|
||||
[[nodiscard]] bool ShouldDump(XAssetInfo<LeaderboardDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LeaderboardDef>* asset) override;
|
||||
[[nodiscard]] bool ShouldDump(XAssetInfo<IW4::LeaderboardDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::LeaderboardDef>* asset) override;
|
||||
};
|
||||
} // namespace IW4::leaderboard
|
||||
} // namespace leaderboard
|
||||
|
||||
@@ -5,16 +5,15 @@
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::light_def;
|
||||
|
||||
namespace IW4::light_def
|
||||
namespace light_def
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<GfxLightDef>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<GfxLightDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxLightDef>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxLightDef>* asset)
|
||||
{
|
||||
const auto* lightDef = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(GetFileNameForAsset(asset->m_name));
|
||||
@@ -30,4 +29,4 @@ namespace IW4::light_def
|
||||
|
||||
stream << lightDef->attenuation.samplerState << imageName << static_cast<char>(lightDef->lmapLookupStart);
|
||||
}
|
||||
} // namespace IW4::light_def
|
||||
} // namespace light_def
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::light_def
|
||||
namespace light_def
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<GfxLightDef>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::GfxLightDef>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxLightDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxLightDef>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::GfxLightDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::GfxLightDef>* asset) override;
|
||||
};
|
||||
} // namespace IW4::light_def
|
||||
} // namespace light_def
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
namespace IW4::localize
|
||||
namespace localize
|
||||
{
|
||||
void Dumper::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
|
||||
void DumperIW4::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
|
||||
{
|
||||
if (pool->m_asset_lookup.empty())
|
||||
return;
|
||||
@@ -41,4 +41,4 @@ namespace IW4::localize
|
||||
std::cerr << std::format("Could not create string file for dumping localized strings of zone '{}'\n", context.m_zone.m_name);
|
||||
}
|
||||
}
|
||||
} // namespace IW4::localize
|
||||
} // namespace localize
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::localize
|
||||
namespace localize
|
||||
{
|
||||
class Dumper final : public IAssetDumper<LocalizeEntry>
|
||||
class DumperIW4 final : public IAssetDumper<IW4::LocalizeEntry>
|
||||
{
|
||||
public:
|
||||
void DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool) override;
|
||||
void DumpPool(AssetDumpingContext& context, AssetPool<IW4::LocalizeEntry>* pool) override;
|
||||
};
|
||||
} // namespace IW4::localize
|
||||
} // namespace localize
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
namespace IW4::addon_map_ents
|
||||
namespace addon_map_ents
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<AddonMapEnts>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<AddonMapEnts>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset)
|
||||
{
|
||||
const auto* addonMapEnts = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -24,4 +24,4 @@ namespace IW4::addon_map_ents
|
||||
|
||||
stream.write(addonMapEnts->entityString, std::max(addonMapEnts->numEntityChars - 1, 0));
|
||||
}
|
||||
} // namespace IW4::addon_map_ents
|
||||
} // namespace addon_map_ents
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::addon_map_ents
|
||||
namespace addon_map_ents
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<AddonMapEnts>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::AddonMapEnts>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<AddonMapEnts>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::AddonMapEnts>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::AddonMapEnts>* asset) override;
|
||||
};
|
||||
} // namespace IW4::addon_map_ents
|
||||
} // namespace addon_map_ents
|
||||
|
||||
@@ -1108,14 +1108,14 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::material
|
||||
namespace material
|
||||
{
|
||||
bool DecompilingGdtDumper::ShouldDump(XAssetInfo<Material>* asset)
|
||||
bool DecompilingGdtDumperIW4::ShouldDump(XAssetInfo<Material>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void DecompilingGdtDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<Material>* asset)
|
||||
void DecompilingGdtDumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<Material>* asset)
|
||||
{
|
||||
if (!context.m_gdt)
|
||||
return;
|
||||
@@ -1123,4 +1123,4 @@ namespace IW4::material
|
||||
MaterialGdtDumper dumper(*asset->Asset());
|
||||
context.m_gdt->WriteEntry(dumper.CreateGdtEntry());
|
||||
}
|
||||
} // namespace IW4::material
|
||||
} // namespace material
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::material
|
||||
namespace material
|
||||
{
|
||||
class DecompilingGdtDumper final : public AbstractAssetDumper<Material>
|
||||
class DecompilingGdtDumperIW4 final : public AbstractAssetDumper<IW4::Material>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<Material>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<Material>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::Material>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::Material>* asset) override;
|
||||
};
|
||||
} // namespace IW4::material
|
||||
} // namespace material
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
#include <string>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::menu;
|
||||
|
||||
namespace
|
||||
{
|
||||
std::string GetPathForMenu(MenuDumpingZoneState* zoneState, XAssetInfo<menuDef_t>* asset)
|
||||
std::string GetPathForMenu(menu::MenuDumpingZoneState* zoneState, XAssetInfo<menuDef_t>* asset)
|
||||
{
|
||||
const auto menuDumpingState = zoneState->m_menu_dumping_state_map.find(asset->Asset());
|
||||
|
||||
@@ -25,14 +24,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::menu
|
||||
namespace menu
|
||||
{
|
||||
bool MenuDumper::ShouldDump(XAssetInfo<menuDef_t>* asset)
|
||||
bool MenuDumperIW4::ShouldDump(XAssetInfo<menuDef_t>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void MenuDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<menuDef_t>* asset)
|
||||
void MenuDumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<menuDef_t>* asset)
|
||||
{
|
||||
const auto* menu = asset->Asset();
|
||||
auto* zoneState = context.GetZoneAssetDumperState<MenuDumpingZoneState>();
|
||||
@@ -42,7 +41,7 @@ namespace IW4::menu
|
||||
// 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)
|
||||
CreateDumpingStateForMenuList(zoneState, menuListAsset->Asset());
|
||||
CreateDumpingStateForMenuListIW4(zoneState, menuListAsset->Asset());
|
||||
}
|
||||
|
||||
const auto menuFilePath = GetPathForMenu(zoneState, asset);
|
||||
@@ -51,10 +50,10 @@ namespace IW4::menu
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto menuWriter = CreateMenuWriter(*assetFile);
|
||||
auto menuWriter = CreateMenuWriterIW4(*assetFile);
|
||||
|
||||
menuWriter->Start();
|
||||
menuWriter->WriteMenu(*menu);
|
||||
menuWriter->End();
|
||||
}
|
||||
} // namespace IW4::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Menu/MenuDumpingZoneState.h"
|
||||
|
||||
namespace IW4::menu
|
||||
namespace menu
|
||||
{
|
||||
class MenuDumper final : public AbstractAssetDumper<menuDef_t>
|
||||
class MenuDumperIW4 final : public AbstractAssetDumper<IW4::menuDef_t>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<menuDef_t>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<menuDef_t>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::menuDef_t>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::menuDef_t>* asset) override;
|
||||
};
|
||||
} // namespace IW4::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::menu;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -45,7 +44,7 @@ namespace
|
||||
return result;
|
||||
}
|
||||
|
||||
void DumpFunctions(IW4::menu::IWriterIW4& menuDumper, const MenuList* menuList)
|
||||
void DumpFunctions(menu::IWriterIW4& menuDumper, const MenuList* menuList)
|
||||
{
|
||||
const auto allSupportingData = GetAllUniqueExpressionSupportingData(menuList);
|
||||
auto functionIndex = 0u;
|
||||
@@ -73,7 +72,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void DumpMenus(IW4::menu::IWriterIW4& menuDumper, ::menu::MenuDumpingZoneState* zoneState, const MenuList* menuList)
|
||||
void DumpMenus(menu::IWriterIW4& menuDumper, menu::MenuDumpingZoneState* zoneState, const MenuList* menuList)
|
||||
{
|
||||
for (auto menuNum = 0; menuNum < menuList->menuCount; menuNum++)
|
||||
{
|
||||
@@ -108,9 +107,9 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::menu
|
||||
namespace menu
|
||||
{
|
||||
void CreateDumpingStateForMenuList(::menu::MenuDumpingZoneState* zoneState, const MenuList* menuList)
|
||||
void CreateDumpingStateForMenuListIW4(MenuDumpingZoneState* zoneState, const MenuList* menuList)
|
||||
{
|
||||
if (menuList->menuCount <= 0 || menuList->menus == nullptr || menuList->name == nullptr)
|
||||
return;
|
||||
@@ -148,12 +147,12 @@ namespace IW4::menu
|
||||
}
|
||||
}
|
||||
|
||||
bool MenuListDumper::ShouldDump(XAssetInfo<MenuList>* asset)
|
||||
bool MenuListDumperIW4::ShouldDump(XAssetInfo<MenuList>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void MenuListDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<MenuList>* asset)
|
||||
void MenuListDumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<MenuList>* asset)
|
||||
{
|
||||
const auto* menuList = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -163,7 +162,7 @@ namespace IW4::menu
|
||||
|
||||
auto* zoneState = context.GetZoneAssetDumperState<MenuDumpingZoneState>();
|
||||
|
||||
auto menuWriter = CreateMenuWriter(*assetFile);
|
||||
auto menuWriter = CreateMenuWriterIW4(*assetFile);
|
||||
|
||||
menuWriter->Start();
|
||||
|
||||
@@ -175,13 +174,13 @@ namespace IW4::menu
|
||||
menuWriter->End();
|
||||
}
|
||||
|
||||
void MenuListDumper::DumpPool(AssetDumpingContext& context, AssetPool<MenuList>* pool)
|
||||
void MenuListDumperIW4::DumpPool(AssetDumpingContext& context, AssetPool<MenuList>* pool)
|
||||
{
|
||||
auto* zoneState = context.GetZoneAssetDumperState<MenuDumpingZoneState>();
|
||||
|
||||
for (auto* asset : *pool)
|
||||
CreateDumpingStateForMenuList(zoneState, asset->Asset());
|
||||
CreateDumpingStateForMenuListIW4(zoneState, asset->Asset());
|
||||
|
||||
AbstractAssetDumper<MenuList>::DumpPool(context, pool);
|
||||
}
|
||||
} // namespace IW4::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
#include "Game/IW4/Menu/MenuDumperIW4.h"
|
||||
#include "Menu/MenuDumpingZoneState.h"
|
||||
|
||||
namespace IW4::menu
|
||||
namespace menu
|
||||
{
|
||||
void CreateDumpingStateForMenuList(::menu::MenuDumpingZoneState* zoneState, const MenuList* menuList);
|
||||
void CreateDumpingStateForMenuListIW4(MenuDumpingZoneState* zoneState, const IW4::MenuList* menuList);
|
||||
|
||||
class MenuListDumper final : public AbstractAssetDumper<MenuList>
|
||||
class MenuListDumperIW4 final : public AbstractAssetDumper<IW4::MenuList>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<MenuList>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MenuList>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::MenuList>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::MenuList>* asset) override;
|
||||
|
||||
public:
|
||||
void DumpPool(AssetDumpingContext& context, AssetPool<MenuList>* pool) override;
|
||||
void DumpPool(AssetDumpingContext& context, AssetPool<IW4::MenuList>* pool) override;
|
||||
};
|
||||
} // namespace IW4::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace
|
||||
return statementEnd;
|
||||
}
|
||||
|
||||
class MenuWriter final : public ::menu::AbstractBaseWriter, public IW4::menu::IWriterIW4
|
||||
class MenuWriter final : public ::menu::AbstractBaseWriter, public menu::IWriterIW4
|
||||
{
|
||||
public:
|
||||
explicit MenuWriter(std::ostream& stream)
|
||||
@@ -948,10 +948,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW4::menu
|
||||
namespace menu
|
||||
{
|
||||
std::unique_ptr<IWriterIW4> CreateMenuWriter(std::ostream& stream)
|
||||
std::unique_ptr<IWriterIW4> CreateMenuWriterIW4(std::ostream& stream)
|
||||
{
|
||||
return std::make_unique<MenuWriter>(stream);
|
||||
}
|
||||
} // namespace IW4::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace IW4::menu
|
||||
namespace menu
|
||||
{
|
||||
class IWriterIW4 : public ::menu::IWriter
|
||||
class IWriterIW4 : public IWriter
|
||||
{
|
||||
public:
|
||||
virtual void WriteFunctionDef(const std::string& functionName, const Statement_s* statement) = 0;
|
||||
virtual void WriteMenu(const menuDef_t& menu) = 0;
|
||||
virtual void WriteFunctionDef(const std::string& functionName, const IW4::Statement_s* statement) = 0;
|
||||
virtual void WriteMenu(const IW4::menuDef_t& menu) = 0;
|
||||
};
|
||||
|
||||
std::unique_ptr<IWriterIW4> CreateMenuWriter(std::ostream& stream);
|
||||
} // namespace IW4::menu
|
||||
std::unique_ptr<IWriterIW4> CreateMenuWriterIW4(std::ostream& stream);
|
||||
} // namespace menu
|
||||
|
||||
@@ -39,21 +39,21 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
|
||||
|
||||
const auto* assetPools = dynamic_cast<GameAssetPoolIW4*>(context.m_zone.m_pools.get());
|
||||
|
||||
DUMP_ASSET_POOL(phys_preset::InfoStringDumper, m_phys_preset, ASSET_TYPE_PHYSPRESET)
|
||||
DUMP_ASSET_POOL(phys_collmap::Dumper, m_phys_collmap, ASSET_TYPE_PHYSCOLLMAP)
|
||||
DUMP_ASSET_POOL(phys_preset::InfoStringDumperIW4, m_phys_preset, ASSET_TYPE_PHYSPRESET)
|
||||
DUMP_ASSET_POOL(phys_collmap::DumperIW4, m_phys_collmap, ASSET_TYPE_PHYSCOLLMAP)
|
||||
// DUMP_ASSET_POOL(AssetDumperXAnimParts, m_xanim_parts, ASSET_TYPE_XANIMPARTS)
|
||||
DUMP_ASSET_POOL(xmodel::Dumper, m_xmodel, ASSET_TYPE_XMODEL)
|
||||
DUMP_ASSET_POOL(material::JsonDumper, m_material, ASSET_TYPE_MATERIAL)
|
||||
DUMP_ASSET_POOL(xmodel::DumperIW4, m_xmodel, ASSET_TYPE_XMODEL)
|
||||
DUMP_ASSET_POOL(material::JsonDumperIW4, m_material, ASSET_TYPE_MATERIAL)
|
||||
#ifdef EXPERIMENTAL_MATERIAL_COMPILATION
|
||||
DUMP_ASSET_POOL(material::DecompilingGdtDumper, m_material, ASSET_TYPE_MATERIAL)
|
||||
DUMP_ASSET_POOL(material::DecompilingGdtDumperIW4, m_material, ASSET_TYPE_MATERIAL)
|
||||
#endif
|
||||
DUMP_ASSET_POOL(shader::PixelShaderDumper, m_material_pixel_shader, ASSET_TYPE_PIXELSHADER)
|
||||
DUMP_ASSET_POOL(shader::VertexShaderDumper, m_material_vertex_shader, ASSET_TYPE_VERTEXSHADER)
|
||||
DUMP_ASSET_POOL(techset::Dumper, m_technique_set, ASSET_TYPE_TECHNIQUE_SET)
|
||||
DUMP_ASSET_POOL(image::Dumper, m_image, ASSET_TYPE_IMAGE)
|
||||
DUMP_ASSET_POOL(shader::PixelShaderDumperIW4, m_material_pixel_shader, ASSET_TYPE_PIXELSHADER)
|
||||
DUMP_ASSET_POOL(shader::VertexShaderDumperIW4, m_material_vertex_shader, ASSET_TYPE_VERTEXSHADER)
|
||||
DUMP_ASSET_POOL(techset::DumperIW4, m_technique_set, ASSET_TYPE_TECHNIQUE_SET)
|
||||
DUMP_ASSET_POOL(image::DumperIW4, m_image, ASSET_TYPE_IMAGE)
|
||||
// DUMP_ASSET_POOL(AssetDumpersnd_alias_list_t, m_sound, ASSET_TYPE_SOUND)
|
||||
DUMP_ASSET_POOL(sound_curve::Dumper, m_sound_curve, ASSET_TYPE_SOUND_CURVE)
|
||||
DUMP_ASSET_POOL(sound::LoadedSoundDumper, m_loaded_sound, ASSET_TYPE_LOADED_SOUND)
|
||||
DUMP_ASSET_POOL(sound_curve::DumperIW4, m_sound_curve, ASSET_TYPE_SOUND_CURVE)
|
||||
DUMP_ASSET_POOL(sound::LoadedSoundDumperIW4, m_loaded_sound, ASSET_TYPE_LOADED_SOUND)
|
||||
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP_MP)
|
||||
// DUMP_ASSET_POOL(AssetDumperComWorld, m_com_world, ASSET_TYPE_COMWORLD)
|
||||
// DUMP_ASSET_POOL(AssetDumperGameWorldSp, m_game_world_sp, ASSET_TYPE_GAMEWORLD_SP)
|
||||
@@ -61,22 +61,22 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
|
||||
// DUMP_ASSET_POOL(AssetDumperMapEnts, m_map_ents, ASSET_TYPE_MAP_ENTS)
|
||||
// DUMP_ASSET_POOL(AssetDumperFxWorld, m_fx_world, ASSET_TYPE_FXWORLD)
|
||||
// DUMP_ASSET_POOL(AssetDumperGfxWorld, m_gfx_world, ASSET_TYPE_GFXWORLD)
|
||||
DUMP_ASSET_POOL(light_def::Dumper, m_gfx_light_def, ASSET_TYPE_LIGHT_DEF)
|
||||
DUMP_ASSET_POOL(light_def::DumperIW4, m_gfx_light_def, ASSET_TYPE_LIGHT_DEF)
|
||||
// DUMP_ASSET_POOL(AssetDumperFont_s, m_font, ASSET_TYPE_FONT)
|
||||
DUMP_ASSET_POOL(menu::MenuListDumper, m_menu_list, ASSET_TYPE_MENULIST)
|
||||
DUMP_ASSET_POOL(menu::MenuDumper, m_menu_def, ASSET_TYPE_MENU)
|
||||
DUMP_ASSET_POOL(localize::Dumper, m_localize, ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
DUMP_ASSET_POOL(weapon::Dumper, m_weapon, ASSET_TYPE_WEAPON)
|
||||
DUMP_ASSET_POOL(menu::MenuListDumperIW4, m_menu_list, ASSET_TYPE_MENULIST)
|
||||
DUMP_ASSET_POOL(menu::MenuDumperIW4, m_menu_def, ASSET_TYPE_MENU)
|
||||
DUMP_ASSET_POOL(localize::DumperIW4, m_localize, ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
DUMP_ASSET_POOL(weapon::DumperIW4, m_weapon, ASSET_TYPE_WEAPON)
|
||||
// DUMP_ASSET_POOL(AssetDumperSndDriverGlobals, m_snd_driver_globals, ASSET_TYPE_SNDDRIVER_GLOBALS)
|
||||
// DUMP_ASSET_POOL(AssetDumperFxEffectDef, m_fx, ASSET_TYPE_FX)
|
||||
// DUMP_ASSET_POOL(AssetDumperFxImpactTable, m_fx_impact_table, ASSET_TYPE_IMPACT_FX)
|
||||
DUMP_ASSET_POOL(raw_file::Dumper, m_raw_file, ASSET_TYPE_RAWFILE)
|
||||
DUMP_ASSET_POOL(string_table::Dumper, m_string_table, ASSET_TYPE_STRINGTABLE)
|
||||
DUMP_ASSET_POOL(leaderboard::JsonDumper, m_leaderboard, ASSET_TYPE_LEADERBOARD)
|
||||
DUMP_ASSET_POOL(structured_data_def::Dumper, m_structed_data_def_set, ASSET_TYPE_STRUCTURED_DATA_DEF)
|
||||
DUMP_ASSET_POOL(tracer::Dumper, m_tracer, ASSET_TYPE_TRACER)
|
||||
DUMP_ASSET_POOL(vehicle::Dumper, m_vehicle, ASSET_TYPE_VEHICLE)
|
||||
DUMP_ASSET_POOL(addon_map_ents::Dumper, m_addon_map_ents, ASSET_TYPE_ADDON_MAP_ENTS)
|
||||
DUMP_ASSET_POOL(raw_file::DumperIW4, m_raw_file, ASSET_TYPE_RAWFILE)
|
||||
DUMP_ASSET_POOL(string_table::DumperIW4, m_string_table, ASSET_TYPE_STRINGTABLE)
|
||||
DUMP_ASSET_POOL(leaderboard::JsonDumperIW4, m_leaderboard, ASSET_TYPE_LEADERBOARD)
|
||||
DUMP_ASSET_POOL(structured_data_def::DumperIW4, m_structed_data_def_set, ASSET_TYPE_STRUCTURED_DATA_DEF)
|
||||
DUMP_ASSET_POOL(tracer::DumperIW4, m_tracer, ASSET_TYPE_TRACER)
|
||||
DUMP_ASSET_POOL(vehicle::DumperIW4, m_vehicle, ASSET_TYPE_VEHICLE)
|
||||
DUMP_ASSET_POOL(addon_map_ents::DumperIW4, m_addon_map_ents, ASSET_TYPE_ADDON_MAP_ENTS)
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
@@ -7,19 +7,18 @@
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::phys_collmap;
|
||||
|
||||
namespace IW4::phys_collmap
|
||||
namespace phys_collmap
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<PhysCollmap>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<PhysCollmap>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysCollmap>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysCollmap>* asset)
|
||||
{
|
||||
const auto* physCollmap = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(GetFileNameForAssetName(asset->m_name));
|
||||
const auto assetFile = context.OpenAssetFile(phys_collmap::GetFileNameForAssetName(asset->m_name));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
@@ -80,4 +79,4 @@ namespace IW4::phys_collmap
|
||||
|
||||
mapFileDumper.EndEntity();
|
||||
}
|
||||
} // namespace IW4::phys_collmap
|
||||
} // namespace phys_collmap
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::phys_collmap
|
||||
namespace phys_collmap
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<PhysCollmap>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::PhysCollmap>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<PhysCollmap>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysCollmap>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::PhysCollmap>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::PhysCollmap>* asset) override;
|
||||
};
|
||||
} // namespace IW4::phys_collmap
|
||||
} // namespace phys_collmap
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::phys_preset;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -79,14 +78,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
bool InfoStringDumper::ShouldDump(XAssetInfo<PhysPreset>* asset)
|
||||
bool InfoStringDumperIW4::ShouldDump(XAssetInfo<IW4::PhysPreset>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void InfoStringDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysPreset>* asset)
|
||||
void InfoStringDumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::PhysPreset>* asset)
|
||||
{
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
@@ -109,4 +108,4 @@ namespace IW4::phys_preset
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
} // namespace IW4::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW4::phys_preset
|
||||
namespace phys_preset
|
||||
{
|
||||
class InfoStringDumper final : public AbstractAssetDumper<PhysPreset>
|
||||
class InfoStringDumperIW4 final : public AbstractAssetDumper<IW4::PhysPreset>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<PhysPreset>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<PhysPreset>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::PhysPreset>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::PhysPreset>* asset) override;
|
||||
};
|
||||
} // namespace IW4::phys_preset
|
||||
} // namespace phys_preset
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
namespace IW4::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
const auto* rawFile = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -67,4 +67,4 @@ namespace IW4::raw_file
|
||||
stream.write(rawFile->data.buffer, rawFile->len);
|
||||
}
|
||||
}
|
||||
} // namespace IW4::raw_file
|
||||
} // namespace raw_file
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<RawFile>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::RawFile>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::RawFile>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::RawFile>* asset) override;
|
||||
};
|
||||
} // namespace IW4::raw_file
|
||||
} // namespace raw_file
|
||||
|
||||
@@ -3,19 +3,18 @@
|
||||
#include "Shader/ShaderCommon.h"
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::shader;
|
||||
|
||||
namespace IW4::shader
|
||||
namespace shader
|
||||
{
|
||||
bool PixelShaderDumper::ShouldDump(XAssetInfo<MaterialPixelShader>* asset)
|
||||
bool PixelShaderDumperIW4::ShouldDump(XAssetInfo<IW4::MaterialPixelShader>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void PixelShaderDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<MaterialPixelShader>* asset)
|
||||
void PixelShaderDumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::MaterialPixelShader>* asset)
|
||||
{
|
||||
const auto* pixelShader = asset->Asset();
|
||||
const auto shaderFile = context.OpenAssetFile(GetFileNameForPixelShaderAssetName(asset->m_name));
|
||||
const auto shaderFile = context.OpenAssetFile(shader::GetFileNameForPixelShaderAssetName(asset->m_name));
|
||||
|
||||
if (!shaderFile)
|
||||
return;
|
||||
@@ -23,4 +22,4 @@ namespace IW4::shader
|
||||
shaderFile->write(reinterpret_cast<const char*>(pixelShader->prog.loadDef.program),
|
||||
static_cast<std::streamsize>(pixelShader->prog.loadDef.programSize) * 4u);
|
||||
}
|
||||
} // namespace IW4::shader
|
||||
} // namespace shader
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::shader
|
||||
namespace shader
|
||||
{
|
||||
class PixelShaderDumper final : public AbstractAssetDumper<MaterialPixelShader>
|
||||
class PixelShaderDumperIW4 final : public AbstractAssetDumper<IW4::MaterialPixelShader>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<MaterialPixelShader>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MaterialPixelShader>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::MaterialPixelShader>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::MaterialPixelShader>* asset) override;
|
||||
};
|
||||
} // namespace IW4::shader
|
||||
} // namespace shader
|
||||
|
||||
@@ -3,19 +3,18 @@
|
||||
#include "Shader/ShaderCommon.h"
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::shader;
|
||||
|
||||
namespace IW4::shader
|
||||
namespace shader
|
||||
{
|
||||
bool VertexShaderDumper::ShouldDump(XAssetInfo<MaterialVertexShader>* asset)
|
||||
bool VertexShaderDumperIW4::ShouldDump(XAssetInfo<IW4::MaterialVertexShader>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void VertexShaderDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<MaterialVertexShader>* asset)
|
||||
void VertexShaderDumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::MaterialVertexShader>* asset)
|
||||
{
|
||||
const auto* vertexShader = asset->Asset();
|
||||
const auto shaderFile = context.OpenAssetFile(GetFileNameForVertexShaderAssetName(asset->m_name));
|
||||
const auto shaderFile = context.OpenAssetFile(shader::GetFileNameForVertexShaderAssetName(asset->m_name));
|
||||
|
||||
if (!shaderFile)
|
||||
return;
|
||||
@@ -23,4 +22,4 @@ namespace IW4::shader
|
||||
shaderFile->write(reinterpret_cast<const char*>(vertexShader->prog.loadDef.program),
|
||||
static_cast<std::streamsize>(vertexShader->prog.loadDef.programSize) * 4u);
|
||||
}
|
||||
} // namespace IW4::shader
|
||||
} // namespace shader
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::shader
|
||||
namespace shader
|
||||
{
|
||||
class VertexShaderDumper final : public AbstractAssetDumper<MaterialVertexShader>
|
||||
class VertexShaderDumperIW4 final : public AbstractAssetDumper<IW4::MaterialVertexShader>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<MaterialVertexShader>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MaterialVertexShader>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::MaterialVertexShader>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::MaterialVertexShader>* asset) override;
|
||||
};
|
||||
} // namespace IW4::shader
|
||||
} // namespace shader
|
||||
|
||||
@@ -22,14 +22,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::sound
|
||||
namespace sound
|
||||
{
|
||||
bool LoadedSoundDumper::ShouldDump(XAssetInfo<LoadedSound>* asset)
|
||||
bool LoadedSoundDumperIW4::ShouldDump(XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void LoadedSoundDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset)
|
||||
void LoadedSoundDumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
const auto* loadedSound = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(std::format("sound/{}", asset->m_name));
|
||||
@@ -49,4 +49,4 @@ namespace IW4::sound
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // namespace IW4::sound
|
||||
} // namespace sound
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::sound
|
||||
namespace sound
|
||||
{
|
||||
class LoadedSoundDumper final : public AbstractAssetDumper<LoadedSound>
|
||||
class LoadedSoundDumperIW4 final : public AbstractAssetDumper<IW4::LoadedSound>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<LoadedSound>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::LoadedSound>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::LoadedSound>* asset) override;
|
||||
};
|
||||
} // namespace IW4::sound
|
||||
} // namespace sound
|
||||
|
||||
@@ -6,16 +6,15 @@
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::sound_curve;
|
||||
|
||||
namespace IW4::sound_curve
|
||||
namespace sound_curve
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<SndCurve>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<SndCurve>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<SndCurve>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<SndCurve>* asset)
|
||||
{
|
||||
const auto* sndCurve = asset->Asset();
|
||||
|
||||
@@ -32,4 +31,4 @@ namespace IW4::sound_curve
|
||||
for (auto i = 0u; i < knotCount; i++)
|
||||
dumper.WriteKnot(sndCurve->knots[i][0], sndCurve->knots[i][1]);
|
||||
}
|
||||
} // namespace IW4::sound_curve
|
||||
} // namespace sound_curve
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::sound_curve
|
||||
namespace sound_curve
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<SndCurve>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::SndCurve>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<SndCurve>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<SndCurve>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::SndCurve>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::SndCurve>* asset) override;
|
||||
};
|
||||
} // namespace IW4::sound_curve
|
||||
} // namespace sound_curve
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
namespace IW4::string_table
|
||||
namespace string_table
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -39,4 +39,4 @@ namespace IW4::string_table
|
||||
csv.NextRow();
|
||||
}
|
||||
}
|
||||
} // namespace IW4::string_table
|
||||
} // namespace string_table
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::string_table
|
||||
namespace string_table
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<StringTable>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::StringTable>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::StringTable>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::StringTable>* asset) override;
|
||||
};
|
||||
} // namespace IW4::string_table
|
||||
} // namespace string_table
|
||||
|
||||
@@ -183,14 +183,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::structured_data_def
|
||||
namespace structured_data_def
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<StructuredDataDefSet>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<StructuredDataDefSet>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<StructuredDataDefSet>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<StructuredDataDefSet>* asset)
|
||||
{
|
||||
const auto* set = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -205,4 +205,4 @@ namespace IW4::structured_data_def
|
||||
dumper.DumpDef(*def);
|
||||
}
|
||||
}
|
||||
} // namespace IW4::structured_data_def
|
||||
} // namespace structured_data_def
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace IW4::structured_data_def
|
||||
namespace structured_data_def
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<StructuredDataDefSet>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::StructuredDataDefSet>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StructuredDataDefSet>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StructuredDataDefSet>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::StructuredDataDefSet>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::StructuredDataDefSet>* asset) override;
|
||||
};
|
||||
} // namespace IW4::structured_data_def
|
||||
} // namespace structured_data_def
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::techset;
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
@@ -533,14 +532,14 @@ namespace IW4
|
||||
};
|
||||
} // namespace IW4
|
||||
|
||||
namespace IW4::techset
|
||||
namespace techset
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<MaterialTechniqueSet>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<MaterialTechniqueSet>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<MaterialTechniqueSet>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<MaterialTechniqueSet>* asset)
|
||||
{
|
||||
const auto* techset = asset->Asset();
|
||||
|
||||
@@ -566,4 +565,4 @@ namespace IW4::techset
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace IW4::techset
|
||||
} // namespace techset
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4::techset
|
||||
namespace techset
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<MaterialTechniqueSet>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::MaterialTechniqueSet>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<MaterialTechniqueSet>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MaterialTechniqueSet>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::MaterialTechniqueSet>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::MaterialTechniqueSet>* asset) override;
|
||||
};
|
||||
} // namespace IW4::techset
|
||||
} // namespace techset
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::tracer;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -51,14 +50,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::tracer
|
||||
namespace tracer
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<TracerDef>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<TracerDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset)
|
||||
{
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
@@ -81,4 +80,4 @@ namespace IW4::tracer
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
} // namespace IW4::tracer
|
||||
} // namespace tracer
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW4::tracer
|
||||
namespace tracer
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<TracerDef>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::TracerDef>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<TracerDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<TracerDef>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::TracerDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::TracerDef>* asset) override;
|
||||
};
|
||||
} // namespace IW4::tracer
|
||||
} // namespace tracer
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::vehicle;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -92,14 +91,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::vehicle
|
||||
namespace vehicle
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<VehicleDef>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
@@ -122,4 +121,4 @@ namespace IW4::vehicle
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
} // namespace IW4::vehicle
|
||||
} // namespace vehicle
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW4::vehicle
|
||||
namespace vehicle
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<VehicleDef>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::VehicleDef>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<VehicleDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<VehicleDef>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::VehicleDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::VehicleDef>* asset) override;
|
||||
};
|
||||
} // namespace IW4::vehicle
|
||||
} // namespace vehicle
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <type_traits>
|
||||
|
||||
using namespace IW4;
|
||||
using namespace ::weapon;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -404,14 +403,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW4::weapon
|
||||
namespace weapon
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<WeaponCompleteDef>* asset)
|
||||
bool DumperIW4::ShouldDump(XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
void DumperIW4::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
@@ -436,4 +435,4 @@ namespace IW4::weapon
|
||||
|
||||
DumpAccuracyGraphs(context, asset);
|
||||
}
|
||||
} // namespace IW4::weapon
|
||||
} // namespace weapon
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW4::weapon
|
||||
namespace weapon
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<WeaponCompleteDef>
|
||||
class DumperIW4 final : public AbstractAssetDumper<IW4::WeaponCompleteDef>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW4::WeaponCompleteDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW4::WeaponCompleteDef>* asset) override;
|
||||
};
|
||||
} // namespace IW4::weapon
|
||||
} // namespace weapon
|
||||
|
||||
Reference in New Issue
Block a user