Merge pull request #400 from GoastcraftHD/main

Added MapEnts dumping for T6
This commit is contained in:
Jan 2025-04-07 23:40:52 +02:00 committed by GitHub
commit 3134ec5a37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 40 additions and 2 deletions

View File

@ -177,7 +177,7 @@ The following section specify which assets are supported to be dumped to disk (u
| ComWorld | ❌ | ❌ | | | ComWorld | ❌ | ❌ | |
| GameWorldSp | ❌ | ❌ | | | GameWorldSp | ❌ | ❌ | |
| GameWorldMp | ❌ | ❌ | | | GameWorldMp | ❌ | ❌ | |
| MapEnts | | ❌ | | | MapEnts | | ❌ | |
| GfxWorld | ❌ | ❌ | | | GfxWorld | ❌ | ❌ | |
| GfxLightDef | ❌ | ❌ | | | GfxLightDef | ❌ | ❌ | |
| Font_s | ❌ | ❌ | | | Font_s | ❌ | ❌ | |

View File

@ -0,0 +1,23 @@
#include "AssetDumperMapEnts.h"
#include <format>
using namespace T6;
bool AssetDumperMapEnts::ShouldDump(XAssetInfo<MapEnts>* asset)
{
return true;
}
void AssetDumperMapEnts::DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset)
{
const auto* mapEnts = asset->Asset();
const auto mapEntsFile = context.OpenAssetFile(std::format("{}.ents", mapEnts->name));
if (!mapEntsFile)
return;
auto& stream = *mapEntsFile;
stream.write(mapEnts->entityString, mapEnts->numEntityChars - 1);
}

View File

@ -0,0 +1,14 @@
#pragma once
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace T6
{
class AssetDumperMapEnts final : public AbstractAssetDumper<MapEnts>
{
protected:
bool ShouldDump(XAssetInfo<MapEnts>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset) override;
};
} // namespace T6

View File

@ -4,6 +4,7 @@
#include "AssetDumpers/AssetDumperGfxImage.h" #include "AssetDumpers/AssetDumperGfxImage.h"
#include "AssetDumpers/AssetDumperLeaderboardDef.h" #include "AssetDumpers/AssetDumperLeaderboardDef.h"
#include "AssetDumpers/AssetDumperLocalizeEntry.h" #include "AssetDumpers/AssetDumperLocalizeEntry.h"
#include "AssetDumpers/AssetDumperMapEnts.h"
#include "AssetDumpers/AssetDumperMaterial.h" #include "AssetDumpers/AssetDumperMaterial.h"
#include "AssetDumpers/AssetDumperPhysConstraints.h" #include "AssetDumpers/AssetDumperPhysConstraints.h"
#include "AssetDumpers/AssetDumperPhysPreset.h" #include "AssetDumpers/AssetDumperPhysPreset.h"
@ -53,7 +54,7 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
// DUMP_ASSET_POOL(AssetDumperComWorld, m_com_world, ASSET_TYPE_COMWORLD) // 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(AssetDumperGameWorldSp, m_game_world_sp, ASSET_TYPE_GAMEWORLD_SP)
// DUMP_ASSET_POOL(AssetDumperGameWorldMp, m_game_world_mp, ASSET_TYPE_GAMEWORLD_MP) // DUMP_ASSET_POOL(AssetDumperGameWorldMp, m_game_world_mp, ASSET_TYPE_GAMEWORLD_MP)
// DUMP_ASSET_POOL(AssetDumperMapEnts, m_map_ents, ASSET_TYPE_MAP_ENTS) DUMP_ASSET_POOL(AssetDumperMapEnts, m_map_ents, ASSET_TYPE_MAP_ENTS)
// DUMP_ASSET_POOL(AssetDumperGfxWorld, m_gfx_world, ASSET_TYPE_GFXWORLD) // 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(AssetDumperGfxLightDef, m_gfx_light_def, ASSET_TYPE_LIGHT_DEF)
// DUMP_ASSET_POOL(AssetDumperFont, m_font, ASSET_TYPE_FONT) // DUMP_ASSET_POOL(AssetDumperFont, m_font, ASSET_TYPE_FONT)