mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 07:42:54 +00:00
Merge pull request #400 from GoastcraftHD/main
Added MapEnts dumping for T6
This commit is contained in:
commit
3134ec5a37
@ -177,7 +177,7 @@ The following section specify which assets are supported to be dumped to disk (u
|
||||
| ComWorld | ❌ | ❌ | |
|
||||
| GameWorldSp | ❌ | ❌ | |
|
||||
| GameWorldMp | ❌ | ❌ | |
|
||||
| MapEnts | ❌ | ❌ | |
|
||||
| MapEnts | ✅ | ❌ | |
|
||||
| GfxWorld | ❌ | ❌ | |
|
||||
| GfxLightDef | ❌ | ❌ | |
|
||||
| Font_s | ❌ | ❌ | |
|
||||
|
23
src/ObjWriting/Game/T6/AssetDumpers/AssetDumperMapEnts.cpp
Normal file
23
src/ObjWriting/Game/T6/AssetDumpers/AssetDumperMapEnts.cpp
Normal 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);
|
||||
}
|
14
src/ObjWriting/Game/T6/AssetDumpers/AssetDumperMapEnts.h
Normal file
14
src/ObjWriting/Game/T6/AssetDumpers/AssetDumperMapEnts.h
Normal 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
|
@ -4,6 +4,7 @@
|
||||
#include "AssetDumpers/AssetDumperGfxImage.h"
|
||||
#include "AssetDumpers/AssetDumperLeaderboardDef.h"
|
||||
#include "AssetDumpers/AssetDumperLocalizeEntry.h"
|
||||
#include "AssetDumpers/AssetDumperMapEnts.h"
|
||||
#include "AssetDumpers/AssetDumperMaterial.h"
|
||||
#include "AssetDumpers/AssetDumperPhysConstraints.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(AssetDumperGameWorldSp, m_game_world_sp, ASSET_TYPE_GAMEWORLD_SP)
|
||||
// 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(AssetDumperGfxLightDef, m_gfx_light_def, ASSET_TYPE_LIGHT_DEF)
|
||||
// DUMP_ASSET_POOL(AssetDumperFont, m_font, ASSET_TYPE_FONT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user