mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-07-26 18:00:38 +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 IW5;
|
||||
using namespace ::image;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -38,7 +37,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())
|
||||
{
|
||||
@@ -58,9 +57,9 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW5::image
|
||||
namespace image
|
||||
{
|
||||
Dumper::Dumper()
|
||||
DumperIW5::DumperIW5()
|
||||
{
|
||||
switch (ObjWriting::Configuration.ImageOutputFormat)
|
||||
{
|
||||
@@ -77,12 +76,12 @@ namespace IW5::image
|
||||
}
|
||||
}
|
||||
|
||||
bool Dumper::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
bool DumperIW5::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
void DumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto texture = LoadImageData(context.m_obj_search_path, *image);
|
||||
@@ -97,4 +96,4 @@ namespace IW5::image
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, texture.get());
|
||||
}
|
||||
} // namespace IW5::image
|
||||
} // namespace image
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5::image
|
||||
namespace image
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<GfxImage>
|
||||
class DumperIW5 final : public AbstractAssetDumper<IW5::GfxImage>
|
||||
{
|
||||
public:
|
||||
Dumper();
|
||||
DumperIW5();
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::GfxImage>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::GfxImage>* asset) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<IImageWriter> m_writer;
|
||||
};
|
||||
} // namespace IW5::image
|
||||
} // namespace image
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace IW5;
|
||||
using namespace ::leaderboard;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -93,14 +92,14 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
bool JsonDumper::ShouldDump(XAssetInfo<LeaderboardDef>* asset)
|
||||
bool JsonDumperIW5::ShouldDump(XAssetInfo<LeaderboardDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void JsonDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<LeaderboardDef>* asset)
|
||||
void JsonDumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<LeaderboardDef>* asset)
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile(GetJsonFileNameForAsset(asset->m_name));
|
||||
|
||||
@@ -110,4 +109,4 @@ namespace IW5::leaderboard
|
||||
Dumper dumper(*assetFile);
|
||||
dumper.Dump(*asset->Asset());
|
||||
}
|
||||
} // namespace IW5::leaderboard
|
||||
} // namespace leaderboard
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::leaderboard
|
||||
namespace leaderboard
|
||||
{
|
||||
class JsonDumper final : public AbstractAssetDumper<LeaderboardDef>
|
||||
class JsonDumperIW5 final : public AbstractAssetDumper<IW5::LeaderboardDef>
|
||||
{
|
||||
protected:
|
||||
[[nodiscard]] bool ShouldDump(XAssetInfo<LeaderboardDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LeaderboardDef>* asset) override;
|
||||
[[nodiscard]] bool ShouldDump(XAssetInfo<IW5::LeaderboardDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::LeaderboardDef>* asset) override;
|
||||
};
|
||||
} // namespace IW5::leaderboard
|
||||
} // namespace leaderboard
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
namespace IW5::localize
|
||||
namespace localize
|
||||
{
|
||||
void Dumper::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
|
||||
void DumperIW5::DumpPool(AssetDumpingContext& context, AssetPool<IW5::LocalizeEntry>* pool)
|
||||
{
|
||||
if (pool->m_asset_lookup.empty())
|
||||
return;
|
||||
@@ -41,4 +41,4 @@ namespace IW5::localize
|
||||
std::cerr << std::format("Could not create string file for dumping localized strings of zone '{}'\n", context.m_zone.m_name);
|
||||
}
|
||||
}
|
||||
} // namespace IW5::localize
|
||||
} // namespace localize
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::localize
|
||||
namespace localize
|
||||
{
|
||||
class Dumper final : public IAssetDumper<LocalizeEntry>
|
||||
class DumperIW5 final : public IAssetDumper<IW5::LocalizeEntry>
|
||||
{
|
||||
public:
|
||||
void DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool) override;
|
||||
void DumpPool(AssetDumpingContext& context, AssetPool<IW5::LocalizeEntry>* pool) override;
|
||||
};
|
||||
} // namespace IW5::localize
|
||||
} // namespace localize
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
namespace IW5::addon_map_ents
|
||||
namespace addon_map_ents
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<AddonMapEnts>* asset)
|
||||
bool DumperIW5::ShouldDump(XAssetInfo<AddonMapEnts>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset)
|
||||
void DumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset)
|
||||
{
|
||||
const auto* addonMapEnts = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -23,4 +23,4 @@ namespace IW5::addon_map_ents
|
||||
auto& stream = *assetFile;
|
||||
stream.write(addonMapEnts->entityString, std::max(addonMapEnts->numEntityChars - 1, 0));
|
||||
}
|
||||
} // namespace IW5::addon_map_ents
|
||||
} // namespace addon_map_ents
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::addon_map_ents
|
||||
namespace addon_map_ents
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<AddonMapEnts>
|
||||
class DumperIW5 final : public AbstractAssetDumper<IW5::AddonMapEnts>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<AddonMapEnts>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<AddonMapEnts>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::AddonMapEnts>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::AddonMapEnts>* asset) override;
|
||||
};
|
||||
} // namespace IW5::addon_map_ents
|
||||
} // namespace addon_map_ents
|
||||
|
||||
@@ -49,14 +49,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW5::menu
|
||||
namespace menu
|
||||
{
|
||||
bool MenuDumper::ShouldDump(XAssetInfo<menuDef_t>* asset)
|
||||
bool MenuDumperIW5::ShouldDump(XAssetInfo<menuDef_t>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void MenuDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<menuDef_t>* asset)
|
||||
void MenuDumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<menuDef_t>* asset)
|
||||
{
|
||||
const auto* menu = asset->Asset();
|
||||
const auto menuFilePath = GetPathForMenu(asset);
|
||||
@@ -74,10 +74,10 @@ namespace IW5::menu
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto menuWriter = CreateMenuWriter(*assetFile);
|
||||
auto menuWriter = CreateMenuWriterIW5(*assetFile);
|
||||
|
||||
menuWriter->Start();
|
||||
menuWriter->WriteMenu(*menu);
|
||||
menuWriter->End();
|
||||
}
|
||||
} // namespace IW5::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "Game/IW5/Menu/MenuDumperIW5.h"
|
||||
|
||||
namespace IW5::menu
|
||||
namespace menu
|
||||
{
|
||||
class MenuDumper final : public AbstractAssetDumper<menuDef_t>
|
||||
class MenuDumperIW5 final : public AbstractAssetDumper<IW5::menuDef_t>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<menuDef_t>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<menuDef_t>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::menuDef_t>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::menuDef_t>* asset) override;
|
||||
};
|
||||
} // namespace IW5::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace
|
||||
return result;
|
||||
}
|
||||
|
||||
void DumpFunctions(IW5::menu::IWriterIW5& menuDumper, const MenuList* menuList)
|
||||
void DumpFunctions(menu::IWriterIW5& menuDumper, const MenuList* menuList)
|
||||
{
|
||||
const auto allSupportingData = GetAllUniqueExpressionSupportingData(menuList);
|
||||
auto functionIndex = 0u;
|
||||
@@ -70,7 +70,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void DumpMenus(IW5::menu::IWriterIW5& menuDumper, const MenuList* menuList)
|
||||
void DumpMenus(menu::IWriterIW5& menuDumper, const MenuList* menuList)
|
||||
{
|
||||
const fs::path p(menuList->name);
|
||||
|
||||
@@ -104,14 +104,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW5::menu
|
||||
namespace menu
|
||||
{
|
||||
bool MenuListDumper::ShouldDump(XAssetInfo<MenuList>* asset)
|
||||
bool MenuListDumperIW5::ShouldDump(XAssetInfo<MenuList>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void MenuListDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<MenuList>* asset)
|
||||
void MenuListDumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<MenuList>* asset)
|
||||
{
|
||||
const auto* menuList = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -119,7 +119,7 @@ namespace IW5::menu
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto menuWriter = CreateMenuWriter(*assetFile);
|
||||
auto menuWriter = CreateMenuWriterIW5(*assetFile);
|
||||
|
||||
menuWriter->Start();
|
||||
|
||||
@@ -130,4 +130,4 @@ namespace IW5::menu
|
||||
|
||||
menuWriter->End();
|
||||
}
|
||||
} // namespace IW5::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::menu
|
||||
namespace menu
|
||||
{
|
||||
class MenuListDumper final : public AbstractAssetDumper<MenuList>
|
||||
class MenuListDumperIW5 final : public AbstractAssetDumper<IW5::MenuList>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<MenuList>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MenuList>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::MenuList>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::MenuList>* asset) override;
|
||||
};
|
||||
} // namespace IW5::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace
|
||||
|
||||
namespace
|
||||
{
|
||||
class MenuWriter final : public ::menu::AbstractBaseWriter, public IW5::menu::IWriterIW5
|
||||
class MenuWriter final : public menu::AbstractBaseWriter, public menu::IWriterIW5
|
||||
{
|
||||
public:
|
||||
explicit MenuWriter(std::ostream& stream)
|
||||
@@ -948,10 +948,10 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::menu
|
||||
namespace menu
|
||||
{
|
||||
std::unique_ptr<IWriterIW5> CreateMenuWriter(std::ostream& stream)
|
||||
std::unique_ptr<IWriterIW5> CreateMenuWriterIW5(std::ostream& stream)
|
||||
{
|
||||
return std::make_unique<MenuWriter>(stream);
|
||||
}
|
||||
} // namespace IW5::menu
|
||||
} // namespace menu
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace IW5::menu
|
||||
namespace menu
|
||||
{
|
||||
class IWriterIW5 : public ::menu::IWriter
|
||||
class IWriterIW5 : 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 IW5::Statement_s* statement) = 0;
|
||||
virtual void WriteMenu(const IW5::menuDef_t& menu) = 0;
|
||||
};
|
||||
|
||||
std::unique_ptr<IWriterIW5> CreateMenuWriter(std::ostream& stream);
|
||||
} // namespace IW5::menu
|
||||
std::unique_ptr<IWriterIW5> CreateMenuWriterIW5(std::ostream& stream);
|
||||
} // namespace menu
|
||||
|
||||
@@ -33,16 +33,16 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
|
||||
// DUMP_ASSET_POOL(AssetDumperPhysCollmap, m_phys_collmap, ASSET_TYPE_PHYSCOLLMAP)
|
||||
// DUMP_ASSET_POOL(AssetDumperXAnimParts, m_xanim_parts, ASSET_TYPE_XANIMPARTS)
|
||||
// DUMP_ASSET_POOL(AssetDumperXModelSurfs, m_xmodel_surfs, ASSET_TYPE_XMODEL_SURFS)
|
||||
DUMP_ASSET_POOL(xmodel::Dumper, m_xmodel, ASSET_TYPE_XMODEL)
|
||||
DUMP_ASSET_POOL(material::JsonDumper, m_material, ASSET_TYPE_MATERIAL)
|
||||
DUMP_ASSET_POOL(xmodel::DumperIW5, m_xmodel, ASSET_TYPE_XMODEL)
|
||||
DUMP_ASSET_POOL(material::JsonDumperIW5, m_material, ASSET_TYPE_MATERIAL)
|
||||
// DUMP_ASSET_POOL(AssetDumperMaterialPixelShader, m_material_pixel_shader, ASSET_TYPE_PIXELSHADER)
|
||||
// DUMP_ASSET_POOL(AssetDumperMaterialVertexShader, m_material_vertex_shader, ASSET_TYPE_VERTEXSHADER)
|
||||
// DUMP_ASSET_POOL(AssetDumperMaterialVertexDeclaration, m_material_vertex_decl, ASSET_TYPE_VERTEXDECL)
|
||||
// DUMP_ASSET_POOL(AssetDumperMaterialTechniqueSet, m_technique_set, ASSET_TYPE_TECHNIQUE_SET)
|
||||
DUMP_ASSET_POOL(image::Dumper, m_image, ASSET_TYPE_IMAGE)
|
||||
DUMP_ASSET_POOL(image::DumperIW5, m_image, ASSET_TYPE_IMAGE)
|
||||
// DUMP_ASSET_POOL(AssetDumpersnd_alias_list_t, m_sound, ASSET_TYPE_SOUND)
|
||||
// DUMP_ASSET_POOL(AssetDumperSndCurve, m_sound_curve, ASSET_TYPE_SOUND_CURVE)
|
||||
DUMP_ASSET_POOL(sound::LoadedSoundDumper, m_loaded_sound, ASSET_TYPE_LOADED_SOUND)
|
||||
DUMP_ASSET_POOL(sound::LoadedSoundDumperIW5, m_loaded_sound, ASSET_TYPE_LOADED_SOUND)
|
||||
// DUMP_ASSET_POOL(AssetDumperclipMap_t, m_clip_map, ASSET_TYPE_CLIPMAP)
|
||||
// DUMP_ASSET_POOL(AssetDumperComWorld, m_com_world, ASSET_TYPE_COMWORLD)
|
||||
// DUMP_ASSET_POOL(AssetDumperGlassWorld, m_glass_world, ASSET_TYPE_GLASSWORLD)
|
||||
@@ -53,22 +53,22 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
|
||||
// DUMP_ASSET_POOL(AssetDumperGfxWorld, m_gfx_world, ASSET_TYPE_GFXWORLD)
|
||||
// DUMP_ASSET_POOL(AssetDumperGfxLightDef, 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(attachment::JsonDumper, m_attachment, ASSET_TYPE_ATTACHMENT)
|
||||
DUMP_ASSET_POOL(weapon::Dumper, m_weapon, ASSET_TYPE_WEAPON)
|
||||
DUMP_ASSET_POOL(menu::MenuListDumperIW5, m_menu_list, ASSET_TYPE_MENULIST)
|
||||
DUMP_ASSET_POOL(menu::MenuDumperIW5, m_menu_def, ASSET_TYPE_MENU)
|
||||
DUMP_ASSET_POOL(localize::DumperIW5, m_localize, ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
DUMP_ASSET_POOL(attachment::JsonDumperIW5, m_attachment, ASSET_TYPE_ATTACHMENT)
|
||||
DUMP_ASSET_POOL(weapon::DumperIW5, m_weapon, ASSET_TYPE_WEAPON)
|
||||
// DUMP_ASSET_POOL(AssetDumperFxEffectDef, m_fx, ASSET_TYPE_FX)
|
||||
// DUMP_ASSET_POOL(AssetDumperFxImpactTable, m_fx_impact_table, ASSET_TYPE_IMPACT_FX)
|
||||
// DUMP_ASSET_POOL(AssetDumperSurfaceFxTable, m_surface_fx_table, ASSET_TYPE_SURFACE_FX)
|
||||
DUMP_ASSET_POOL(raw_file::Dumper, m_raw_file, ASSET_TYPE_RAWFILE)
|
||||
DUMP_ASSET_POOL(script::Dumper, m_script_file, ASSET_TYPE_SCRIPTFILE)
|
||||
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(raw_file::DumperIW5, m_raw_file, ASSET_TYPE_RAWFILE)
|
||||
DUMP_ASSET_POOL(script::DumperIW5, m_script_file, ASSET_TYPE_SCRIPTFILE)
|
||||
DUMP_ASSET_POOL(string_table::DumperIW5, m_string_table, ASSET_TYPE_STRINGTABLE)
|
||||
DUMP_ASSET_POOL(leaderboard::JsonDumperIW5, m_leaderboard, ASSET_TYPE_LEADERBOARD)
|
||||
// DUMP_ASSET_POOL(AssetDumperStructuredDataDefSet, m_structed_data_def_set, ASSET_TYPE_STRUCTURED_DATA_DEF)
|
||||
// DUMP_ASSET_POOL(AssetDumperTracerDef, m_tracer, ASSET_TYPE_TRACER)
|
||||
// DUMP_ASSET_POOL(AssetDumperVehicleDef, m_vehicle, ASSET_TYPE_VEHICLE)
|
||||
DUMP_ASSET_POOL(addon_map_ents::Dumper, m_addon_map_ents, ASSET_TYPE_ADDON_MAP_ENTS)
|
||||
DUMP_ASSET_POOL(addon_map_ents::DumperIW5, m_addon_map_ents, ASSET_TYPE_ADDON_MAP_ENTS)
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
namespace IW5::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
bool DumperIW5::ShouldDump(XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
void DumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
|
||||
{
|
||||
const auto* rawFile = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -62,4 +62,4 @@ namespace IW5::raw_file
|
||||
|
||||
inflateEnd(&zs);
|
||||
}
|
||||
} // namespace IW5::raw_file
|
||||
} // namespace raw_file
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::raw_file
|
||||
namespace raw_file
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<RawFile>
|
||||
class DumperIW5 final : public AbstractAssetDumper<IW5::RawFile>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::RawFile>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::RawFile>* asset) override;
|
||||
};
|
||||
} // namespace IW5::raw_file
|
||||
} // namespace raw_file
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
namespace IW5::script
|
||||
namespace script
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<ScriptFile>* asset)
|
||||
bool DumperIW5::ShouldDump(XAssetInfo<IW5::ScriptFile>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// See https://github.com/xensik/gsc-tool#file-format for an in-depth explanation about the .gscbin format
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<ScriptFile>* asset)
|
||||
void DumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::ScriptFile>* asset)
|
||||
{
|
||||
auto* scriptFile = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name + ".gscbin");
|
||||
@@ -30,4 +30,4 @@ namespace IW5::script
|
||||
stream.write(scriptFile->buffer, scriptFile->compressedLen);
|
||||
stream.write(reinterpret_cast<char*>(scriptFile->bytecode), scriptFile->bytecodeLen);
|
||||
}
|
||||
} // namespace IW5::script
|
||||
} // namespace script
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::script
|
||||
namespace script
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<ScriptFile>
|
||||
class DumperIW5 final : public AbstractAssetDumper<IW5::ScriptFile>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<ScriptFile>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<ScriptFile>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::ScriptFile>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::ScriptFile>* asset) override;
|
||||
};
|
||||
} // namespace IW5::script
|
||||
} // namespace script
|
||||
|
||||
@@ -22,14 +22,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW5::sound
|
||||
namespace sound
|
||||
{
|
||||
bool LoadedSoundDumper::ShouldDump(XAssetInfo<LoadedSound>* asset)
|
||||
bool LoadedSoundDumperIW5::ShouldDump(XAssetInfo<LoadedSound>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void LoadedSoundDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset)
|
||||
void LoadedSoundDumperIW5::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 IW5::sound
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // namespace IW5::sound
|
||||
} // namespace sound
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::sound
|
||||
namespace sound
|
||||
{
|
||||
class LoadedSoundDumper final : public AbstractAssetDumper<LoadedSound>
|
||||
class LoadedSoundDumperIW5 final : public AbstractAssetDumper<IW5::LoadedSound>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<LoadedSound>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::LoadedSound>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::LoadedSound>* asset) override;
|
||||
};
|
||||
} // namespace IW5::sound
|
||||
} // namespace sound
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
namespace IW5::string_table
|
||||
namespace string_table
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
bool DumperIW5::ShouldDump(XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
void DumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
|
||||
{
|
||||
const auto* stringTable = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
@@ -39,4 +39,4 @@ namespace IW5::string_table
|
||||
csv.NextRow();
|
||||
}
|
||||
}
|
||||
} // namespace IW5::string_table
|
||||
} // namespace string_table
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::string_table
|
||||
namespace string_table
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<StringTable>
|
||||
class DumperIW5 final : public AbstractAssetDumper<IW5::StringTable>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::StringTable>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::StringTable>* asset) override;
|
||||
};
|
||||
} // namespace IW5::string_table
|
||||
} // namespace string_table
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace IW5;
|
||||
using namespace ::attachment;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -394,14 +393,14 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::attachment
|
||||
namespace attachment
|
||||
{
|
||||
bool JsonDumper::ShouldDump(XAssetInfo<WeaponAttachment>* asset)
|
||||
bool JsonDumperIW5::ShouldDump(XAssetInfo<WeaponAttachment>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void JsonDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset)
|
||||
void JsonDumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset)
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile(GetJsonFileNameForAssetName(asset->m_name));
|
||||
|
||||
@@ -411,4 +410,4 @@ namespace IW5::attachment
|
||||
const JsonDumperImpl dumper(context, *assetFile);
|
||||
dumper.Dump(asset->Asset());
|
||||
}
|
||||
} // namespace IW5::attachment
|
||||
} // namespace attachment
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::attachment
|
||||
namespace attachment
|
||||
{
|
||||
class JsonDumper final : public AbstractAssetDumper<WeaponAttachment>
|
||||
class JsonDumperIW5 final : public AbstractAssetDumper<IW5::WeaponAttachment>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponAttachment>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::WeaponAttachment>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::WeaponAttachment>* asset) override;
|
||||
};
|
||||
} // namespace IW5::attachment
|
||||
} // namespace attachment
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <unordered_set>
|
||||
|
||||
using namespace IW5;
|
||||
using namespace ::weapon;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -732,14 +731,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<WeaponCompleteDef>* asset)
|
||||
bool DumperIW5::ShouldDump(XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
void DumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
// TODO: only dump infostring fields when non-default
|
||||
|
||||
@@ -766,4 +765,4 @@ namespace IW5::weapon
|
||||
|
||||
DumpAccuracyGraphs(context, asset);
|
||||
}
|
||||
} // namespace IW5::weapon
|
||||
} // namespace weapon
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<WeaponCompleteDef>
|
||||
class DumperIW5 final : public AbstractAssetDumper<IW5::WeaponCompleteDef>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::WeaponCompleteDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::WeaponCompleteDef>* asset) override;
|
||||
};
|
||||
} // namespace IW5::weapon
|
||||
} // namespace weapon
|
||||
|
||||
Reference in New Issue
Block a user