2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-07-02 22:08:11 +00:00

feat: add addon map ents dumper to T6 (#842)

* feat: add addon map ents dumper to T6

* Remove NOMINMAX

* docs: add addonmapents to t6 supported assets

---------

Co-authored-by: hindercanrun <109132519+meowica@users.noreply.github.com>
This commit is contained in:
Ash
2026-06-29 05:01:25 +08:00
committed by GitHub
parent 4017f084a8
commit 46e34b0036
6 changed files with 248 additions and 215 deletions
@@ -1,4 +1,3 @@
#define NOMINMAX
#include "AddonMapEntsDumperIW4.h"
#include <algorithm>
@@ -1,4 +1,3 @@
#define NOMINMAX
#include "AddonMapEntsDumperIW5.h"
#include <algorithm>
@@ -0,0 +1,20 @@
#include "AddonMapEntsDumperT6.h"
#include <algorithm>
using namespace T6;
namespace addon_map_ents
{
void DumperT6::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetAddonMapEnts::Type>& asset)
{
const auto* addonMapEnts = asset.Asset();
const auto assetFile = context.OpenAssetFile(asset.m_name);
if (!assetFile)
return;
auto& stream = *assetFile;
stream.write(addonMapEnts->entityString, std::max(addonMapEnts->numEntityChars - 1, 0));
}
} // namespace addon_map_ents
@@ -0,0 +1,13 @@
#pragma once
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace addon_map_ents
{
class DumperT6 final : public AbstractAssetDumper<T6::AssetAddonMapEnts>
{
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<T6::AssetAddonMapEnts::Type>& asset) override;
};
} // namespace addon_map_ents
+2 -1
View File
@@ -9,6 +9,7 @@
#include "Leaderboard/LeaderboardJsonDumperT6.h"
#include "LightDef/LightDefDumperT6.h"
#include "Localize/LocalizeDumperT6.h"
#include "Maps/AddonMapEntsDumperT6.h"
#include "Maps/MapEntsDumperT6.h"
#include "PhysConstraints/PhysConstraintsInfoStringDumperT6.h"
#include "PhysPreset/PhysPresetInfoStringDumperT6.h"
@@ -77,7 +78,7 @@ void ObjWriter::RegisterAssetDumpers(AssetDumpingContext& context)
// REGISTER_DUMPER(AssetDumperKeyValuePairs, m_key_value_pairs)
RegisterAssetDumper(std::make_unique<vehicle::DumperT6>());
// REGISTER_DUMPER(AssetDumperMemoryBlock, m_memory_block)
// REGISTER_DUMPER(AssetDumperAddonMapEnts, m_addon_map_ents)
RegisterAssetDumper(std::make_unique<addon_map_ents::DumperT6>());
RegisterAssetDumper(std::make_unique<tracer::DumperT6>());
// REGISTER_DUMPER(AssetDumperSkinnedVertsDef, m_skinned_verts)
RegisterAssetDumper(std::make_unique<qdb::DumperT6>());