mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-10-20 13:35:20 +00:00
refactor: streamline map assets dumper
This commit is contained in:
23
src/ObjWriting/Game/IW3/Maps/MapEntsDumperIW3.cpp
Normal file
23
src/ObjWriting/Game/IW3/Maps/MapEntsDumperIW3.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "MapEntsDumperIW3.h"
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
namespace IW3::map_ents
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<MapEnts>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset)
|
||||
{
|
||||
const auto* mapEnts = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name + ".ents");
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
auto& stream = *assetFile;
|
||||
stream.write(mapEnts->entityString, mapEnts->numEntityChars);
|
||||
}
|
||||
} // namespace IW3::map_ents
|
Reference in New Issue
Block a user