2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-10-23 14:55:52 +00:00

refactor: do not nest asset namespaces in game namespaces

* Duplicated namespace names are kind of annoying
This commit is contained in:
Jan Laupetin
2025-08-06 00:50:35 +02:00
parent 33c09dfe61
commit 46fb919a52
336 changed files with 1430 additions and 1480 deletions

View File

@@ -15,7 +15,6 @@
#include <format>
using namespace IW3;
using namespace ::image;
namespace
{
@@ -40,7 +39,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())
{
@@ -60,9 +59,9 @@ namespace
}
} // namespace
namespace IW3::image
namespace image
{
Dumper::Dumper()
DumperIW3::DumperIW3()
{
switch (ObjWriting::Configuration.ImageOutputFormat)
{
@@ -79,12 +78,12 @@ namespace IW3::image
}
}
bool Dumper::ShouldDump(XAssetInfo<GfxImage>* asset)
bool DumperIW3::ShouldDump(XAssetInfo<GfxImage>* asset)
{
return true;
}
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
void DumperIW3::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
{
const auto* image = asset->Asset();
const auto texture = LoadImageData(context.m_obj_search_path, *image);
@@ -99,4 +98,4 @@ namespace IW3::image
auto& stream = *assetFile;
m_writer->DumpImage(stream, texture.get());
}
} // namespace IW3::image
} // namespace image

View File

@@ -6,18 +6,18 @@
#include <memory>
namespace IW3::image
namespace image
{
class Dumper final : public AbstractAssetDumper<GfxImage>
class DumperIW3 final : public AbstractAssetDumper<IW3::GfxImage>
{
public:
Dumper();
DumperIW3();
protected:
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
bool ShouldDump(XAssetInfo<IW3::GfxImage>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW3::GfxImage>* asset) override;
private:
std::unique_ptr<IImageWriter> m_writer;
};
} // namespace IW3::image
} // namespace image

View File

@@ -8,9 +8,9 @@
using namespace IW3;
namespace IW3::localize
namespace localize
{
void Dumper::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
void DumperIW3::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
{
if (pool->m_asset_lookup.empty())
return;
@@ -41,4 +41,4 @@ namespace IW3::localize
std::cerr << std::format("Could not create string file for dumping localized strings of zone '{}'\n", context.m_zone.m_name);
}
}
} // namespace IW3::localize
} // namespace localize

View File

@@ -3,11 +3,11 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/IW3/IW3.h"
namespace IW3::localize
namespace localize
{
class Dumper final : public IAssetDumper<LocalizeEntry>
class DumperIW3 final : public IAssetDumper<IW3::LocalizeEntry>
{
public:
void DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool) override;
void DumpPool(AssetDumpingContext& context, AssetPool<IW3::LocalizeEntry>* pool) override;
};
} // namespace IW3::localize
} // namespace localize

View File

@@ -2,14 +2,14 @@
using namespace IW3;
namespace IW3::map_ents
namespace map_ents
{
bool Dumper::ShouldDump(XAssetInfo<MapEnts>* asset)
bool DumperIW3::ShouldDump(XAssetInfo<MapEnts>* asset)
{
return true;
}
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset)
void DumperIW3::DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset)
{
const auto* mapEnts = asset->Asset();
const auto assetFile = context.OpenAssetFile(asset->m_name + ".ents");
@@ -20,4 +20,4 @@ namespace IW3::map_ents
auto& stream = *assetFile;
stream.write(mapEnts->entityString, mapEnts->numEntityChars);
}
} // namespace IW3::map_ents
} // namespace map_ents

View File

@@ -3,12 +3,12 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/IW3/IW3.h"
namespace IW3::map_ents
namespace map_ents
{
class Dumper final : public AbstractAssetDumper<MapEnts>
class DumperIW3 final : public AbstractAssetDumper<IW3::MapEnts>
{
protected:
bool ShouldDump(XAssetInfo<MapEnts>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset) override;
bool ShouldDump(XAssetInfo<IW3::MapEnts>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW3::MapEnts>* asset) override;
};
} // namespace IW3::map_ents
} // namespace map_ents

View File

@@ -26,30 +26,30 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
// DUMP_ASSET_POOL(AssetDumperPhysPreset, m_phys_preset, ASSET_TYPE_PHYSPRESET)
// 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::DumperIW3, m_xmodel, ASSET_TYPE_XMODEL)
DUMP_ASSET_POOL(material::JsonDumperIW3, m_material, ASSET_TYPE_MATERIAL)
// 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::DumperIW3, 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::LoadedSoundDumperIW3, m_loaded_sound, ASSET_TYPE_LOADED_SOUND)
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP_PVS)
// DUMP_ASSET_POOL(AssetDumperComWorld, m_com_world, ASSET_TYPE_COMWORLD)
// DUMP_ASSET_POOL(AssetDumperGameWorldSp, m_game_world_sp, ASSET_TYPE_GAMEWORLD_SP)
// DUMP_ASSET_POOL(AssetDumperGameWorldMp, m_game_world_mp, ASSET_TYPE_GAMEWORLD_MP)
DUMP_ASSET_POOL(map_ents::Dumper, m_map_ents, ASSET_TYPE_MAP_ENTS)
DUMP_ASSET_POOL(map_ents::DumperIW3, m_map_ents, ASSET_TYPE_MAP_ENTS)
// 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(AssetDumperMenuList, m_menu_list, ASSET_TYPE_MENULIST)
// DUMP_ASSET_POOL(AssetDumpermenuDef_t, m_menu_def, ASSET_TYPE_MENU)
DUMP_ASSET_POOL(localize::Dumper, m_localize, ASSET_TYPE_LOCALIZE_ENTRY)
DUMP_ASSET_POOL(localize::DumperIW3, m_localize, ASSET_TYPE_LOCALIZE_ENTRY)
// DUMP_ASSET_POOL(AssetDumperWeapon, 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(raw_file::DumperIW3, m_raw_file, ASSET_TYPE_RAWFILE)
DUMP_ASSET_POOL(string_table::DumperIW3, m_string_table, ASSET_TYPE_STRINGTABLE)
return true;

View File

@@ -2,14 +2,14 @@
using namespace IW3;
namespace IW3::raw_file
namespace raw_file
{
bool Dumper::ShouldDump(XAssetInfo<RawFile>* asset)
bool DumperIW3::ShouldDump(XAssetInfo<RawFile>* asset)
{
return true;
}
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
void DumperIW3::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
{
const auto* rawFile = asset->Asset();
const auto assetFile = context.OpenAssetFile(asset->m_name);
@@ -20,4 +20,4 @@ namespace IW3::raw_file
auto& stream = *assetFile;
stream.write(rawFile->buffer, rawFile->len);
}
} // namespace IW3::raw_file
} // namespace raw_file

View File

@@ -3,12 +3,12 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/IW3/IW3.h"
namespace IW3::raw_file
namespace raw_file
{
class Dumper final : public AbstractAssetDumper<RawFile>
class DumperIW3 final : public AbstractAssetDumper<IW3::RawFile>
{
protected:
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
bool ShouldDump(XAssetInfo<IW3::RawFile>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW3::RawFile>* asset) override;
};
} // namespace IW3::raw_file
} // namespace raw_file

View File

@@ -22,14 +22,14 @@ namespace
}
} // namespace
namespace IW3::sound
namespace sound
{
bool LoadedSoundDumper::ShouldDump(XAssetInfo<LoadedSound>* asset)
bool LoadedSoundDumperIW3::ShouldDump(XAssetInfo<LoadedSound>* asset)
{
return true;
}
void LoadedSoundDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset)
void LoadedSoundDumperIW3::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 IW3::sound
break;
}
}
} // namespace IW3::sound
} // namespace sound

View File

@@ -3,12 +3,12 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/IW3/IW3.h"
namespace IW3::sound
namespace sound
{
class LoadedSoundDumper final : public AbstractAssetDumper<LoadedSound>
class LoadedSoundDumperIW3 final : public AbstractAssetDumper<IW3::LoadedSound>
{
protected:
bool ShouldDump(XAssetInfo<LoadedSound>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LoadedSound>* asset) override;
bool ShouldDump(XAssetInfo<IW3::LoadedSound>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW3::LoadedSound>* asset) override;
};
} // namespace IW3::sound
} // namespace sound

View File

@@ -4,14 +4,14 @@
using namespace IW3;
namespace IW3::string_table
namespace string_table
{
bool Dumper::ShouldDump(XAssetInfo<StringTable>* asset)
bool DumperIW3::ShouldDump(XAssetInfo<StringTable>* asset)
{
return true;
}
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
void DumperIW3::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
{
const auto* stringTable = asset->Asset();
const auto assetFile = context.OpenAssetFile(asset->m_name);
@@ -31,4 +31,4 @@ namespace IW3::string_table
csv.NextRow();
}
}
} // namespace IW3::string_table
} // namespace string_table

View File

@@ -3,12 +3,12 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/IW3/IW3.h"
namespace IW3::string_table
namespace string_table
{
class Dumper final : public AbstractAssetDumper<StringTable>
class DumperIW3 final : public AbstractAssetDumper<IW3::StringTable>
{
protected:
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
bool ShouldDump(XAssetInfo<IW3::StringTable>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW3::StringTable>* asset) override;
};
} // namespace IW3::string_table
} // namespace string_table

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View 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

View 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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View 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

View 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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -12,7 +12,6 @@
#include <format>
using namespace T5;
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 T5::image
namespace image
{
Dumper::Dumper()
DumperT5::DumperT5()
{
switch (ObjWriting::Configuration.ImageOutputFormat)
{
@@ -76,12 +75,12 @@ namespace T5::image
}
}
bool Dumper::ShouldDump(XAssetInfo<GfxImage>* asset)
bool DumperT5::ShouldDump(XAssetInfo<GfxImage>* asset)
{
return true;
}
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
void DumperT5::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 T5::image
auto& stream = *assetFile;
m_writer->DumpImage(stream, texture.get());
}
} // namespace T5::image
} // namespace image

View File

@@ -6,18 +6,18 @@
#include <memory>
namespace T5::image
namespace image
{
class Dumper final : public AbstractAssetDumper<GfxImage>
class DumperT5 final : public AbstractAssetDumper<T5::GfxImage>
{
public:
Dumper();
DumperT5();
protected:
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
bool ShouldDump(XAssetInfo<T5::GfxImage>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<T5::GfxImage>* asset) override;
private:
std::unique_ptr<IImageWriter> m_writer;
};
} // namespace T5::image
} // namespace image

View File

@@ -8,9 +8,9 @@
using namespace T5;
namespace T5::localize
namespace localize
{
void Dumper::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
void DumperT5::DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool)
{
if (pool->m_asset_lookup.empty())
return;
@@ -41,4 +41,4 @@ namespace T5::localize
std::cerr << std::format("Could not create string file for dumping localized strings of zone '{}'\n", context.m_zone.m_name);
}
}
} // namespace T5::localize
} // namespace localize

View File

@@ -3,11 +3,11 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T5/T5.h"
namespace T5::localize
namespace localize
{
class Dumper final : public IAssetDumper<LocalizeEntry>
class DumperT5 final : public IAssetDumper<T5::LocalizeEntry>
{
public:
void DumpPool(AssetDumpingContext& context, AssetPool<LocalizeEntry>* pool) override;
void DumpPool(AssetDumpingContext& context, AssetPool<T5::LocalizeEntry>* pool) override;
};
} // namespace T5::localize
} // namespace localize

View File

@@ -26,10 +26,10 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
// DUMP_ASSET_POOL(AssetDumperPhysConstraints, m_phys_constraints, ASSET_TYPE_PHYSCONSTRAINTS)
// DUMP_ASSET_POOL(AssetDumperDestructibleDef, m_destructible_def, ASSET_TYPE_DESTRUCTIBLEDEF)
// 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::DumperT5, m_xmodel, ASSET_TYPE_XMODEL)
DUMP_ASSET_POOL(material::JsonDumperT5, m_material, ASSET_TYPE_MATERIAL)
// DUMP_ASSET_POOL(AssetDumperTechniqueSet, m_technique_set, ASSET_TYPE_TECHNIQUE_SET)
DUMP_ASSET_POOL(image::Dumper, m_image, ASSET_TYPE_IMAGE)
DUMP_ASSET_POOL(image::DumperT5, m_image, ASSET_TYPE_IMAGE)
// DUMP_ASSET_POOL(AssetDumperSndBank, m_sound_bank, ASSET_TYPE_SOUND)
// DUMP_ASSET_POOL(AssetDumperSndPatch, m_sound_patch, ASSET_TYPE_SOUND_PATCH)
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP_PVS)
@@ -42,13 +42,13 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
// DUMP_ASSET_POOL(AssetDumperFont, m_font, ASSET_TYPE_FONT)
// DUMP_ASSET_POOL(AssetDumperMenuList, m_menu_list, ASSET_TYPE_MENULIST)
// DUMP_ASSET_POOL(AssetDumperMenuDef, m_menu_def, ASSET_TYPE_MENU)
DUMP_ASSET_POOL(localize::Dumper, m_localize, ASSET_TYPE_LOCALIZE_ENTRY)
DUMP_ASSET_POOL(localize::DumperT5, m_localize, ASSET_TYPE_LOCALIZE_ENTRY)
// DUMP_ASSET_POOL(AssetDumperWeapon, 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(raw_file::DumperT5, m_raw_file, ASSET_TYPE_RAWFILE)
DUMP_ASSET_POOL(string_table::DumperT5, m_string_table, ASSET_TYPE_STRINGTABLE)
// DUMP_ASSET_POOL(AssetDumperPackIndex, m_pack_index, ASSET_TYPE_PACK_INDEX)
// DUMP_ASSET_POOL(AssetDumperXGlobals, m_xglobals, ASSET_TYPE_XGLOBALS)
// DUMP_ASSET_POOL(AssetDumperDDLRoot, m_ddl, ASSET_TYPE_DDL)

View File

@@ -93,14 +93,14 @@ namespace
}
} // namespace
namespace T5::raw_file
namespace raw_file
{
bool Dumper::ShouldDump(XAssetInfo<RawFile>* asset)
bool DumperT5::ShouldDump(XAssetInfo<RawFile>* asset)
{
return true;
}
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
void DumperT5::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
{
const auto* rawFile = asset->Asset();
const auto assetFile = context.OpenAssetFile(asset->m_name);
@@ -118,4 +118,4 @@ namespace T5::raw_file
else
stream.write(rawFile->buffer, rawFile->len);
}
} // namespace T5::raw_file
} // namespace raw_file

View File

@@ -3,12 +3,12 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T5/T5.h"
namespace T5::raw_file
namespace raw_file
{
class Dumper final : public AbstractAssetDumper<RawFile>
class DumperT5 final : public AbstractAssetDumper<T5::RawFile>
{
protected:
bool ShouldDump(XAssetInfo<RawFile>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset) override;
bool ShouldDump(XAssetInfo<T5::RawFile>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<T5::RawFile>* asset) override;
};
} // namespace T5::raw_file
} // namespace raw_file

View File

@@ -4,14 +4,14 @@
using namespace T5;
namespace T5::string_table
namespace string_table
{
bool Dumper::ShouldDump(XAssetInfo<StringTable>* asset)
bool DumperT5::ShouldDump(XAssetInfo<StringTable>* asset)
{
return true;
}
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
void DumperT5::DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset)
{
const auto* stringTable = asset->Asset();
const auto assetFile = context.OpenAssetFile(asset->m_name);
@@ -39,4 +39,4 @@ namespace T5::string_table
csv.NextRow();
}
}
} // namespace T5::string_table
} // namespace string_table

View File

@@ -3,12 +3,12 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T5/T5.h"
namespace T5::string_table
namespace string_table
{
class Dumper final : public AbstractAssetDumper<StringTable>
class DumperT5 final : public AbstractAssetDumper<T5::StringTable>
{
protected:
bool ShouldDump(XAssetInfo<StringTable>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StringTable>* asset) override;
bool ShouldDump(XAssetInfo<T5::StringTable>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<T5::StringTable>* asset) override;
};
} // namespace T5::string_table
} // namespace string_table

View File

@@ -131,14 +131,14 @@ namespace
};
} // namespace
namespace T6::font_icon
namespace font_icon
{
bool CsvDumper::ShouldDump(XAssetInfo<FontIcon>* asset)
bool CsvDumperT6::ShouldDump(XAssetInfo<FontIcon>* asset)
{
return true;
}
void CsvDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
void CsvDumperT6::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
{
const auto assetFile = context.OpenAssetFile(asset->m_name);
@@ -148,4 +148,4 @@ namespace T6::font_icon
Dumper dumper(*assetFile);
dumper.Dump(*asset->Asset());
}
} // namespace T6::font_icon
} // namespace font_icon

View File

@@ -3,12 +3,12 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace T6::font_icon
namespace font_icon
{
class CsvDumper final : public AbstractAssetDumper<FontIcon>
class CsvDumperT6 final : public AbstractAssetDumper<T6::FontIcon>
{
protected:
bool ShouldDump(XAssetInfo<FontIcon>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset) override;
bool ShouldDump(XAssetInfo<T6::FontIcon>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<T6::FontIcon>* asset) override;
};
} // namespace T6::font_icon
} // namespace font_icon

View File

@@ -7,14 +7,14 @@ using namespace T6;
// #define DUMP_FONT_ICON_AS_CSV 1
namespace T6::font_icon
namespace font_icon
{
std::unique_ptr<IAssetDumper<FontIcon>> CreateDumper()
std::unique_ptr<IAssetDumper<FontIcon>> CreateDumperT6()
{
#ifdef DUMP_FONT_ICON_AS_CSV
return std::make_unique<CsvDumper>();
return std::make_unique<CsvDumperT6>();
#else
return std::make_unique<JsonDumper>();
return std::make_unique<JsonDumperT6>();
#endif
}
} // namespace T6::font_icon
} // namespace font_icon

View File

@@ -3,7 +3,9 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace T6::font_icon
#include <memory>
namespace font_icon
{
std::unique_ptr<IAssetDumper<FontIcon>> CreateDumper();
} // namespace T6::font_icon
std::unique_ptr<IAssetDumper<T6::FontIcon>> CreateDumperT6();
} // namespace font_icon

View File

@@ -1,7 +1,7 @@
#include "FontIconJsonDumperT6.h"
#include "FontIcon/FontIconCommon.h"
#include "Game/T6/CommonT6.h"
#include "Game/T6/FontIcon/FontIconCommonT6.h"
#include "Game/T6/FontIcon/JsonFontIconT6.h"
#include "KnownFontIconAliasesT6.h"
@@ -76,20 +76,20 @@ namespace
}
} // namespace
namespace T6::font_icon
namespace font_icon
{
bool JsonDumper::ShouldDump(XAssetInfo<FontIcon>* asset)
bool JsonDumperT6::ShouldDump(XAssetInfo<FontIcon>* asset)
{
return true;
}
void JsonDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
void JsonDumperT6::DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset)
{
const auto assetFile = context.OpenAssetFile(font_icon::GetJsonFileNameForAssetName(asset->m_name));
const auto assetFile = context.OpenAssetFile(GetJsonFileNameForAssetName(asset->m_name));
if (!assetFile)
return;
DumpFontIcon(*assetFile, *asset->Asset());
}
} // namespace T6::font_icon
} // namespace font_icon

View File

@@ -3,12 +3,12 @@
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace T6::font_icon
namespace font_icon
{
class JsonDumper final : public AbstractAssetDumper<FontIcon>
class JsonDumperT6 final : public AbstractAssetDumper<T6::FontIcon>
{
protected:
bool ShouldDump(XAssetInfo<FontIcon>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<FontIcon>* asset) override;
bool ShouldDump(XAssetInfo<T6::FontIcon>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<T6::FontIcon>* asset) override;
};
} // namespace T6::font_icon
} // namespace font_icon

Some files were not shown because too many files have changed in this diff Show More