mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-05 00:07:25 +00:00
Add base for StructuredDataDefDumper
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#include "AssetDumperStructuredDataDefSet.h"
|
||||
|
||||
#include "Dumping/StructuredDataDef/StructuredDataDefDumper.h"
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
bool AssetDumperStructuredDataDefSet::ShouldDump(XAssetInfo<StructuredDataDefSet>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void AssetDumperStructuredDataDefSet::DumpAsset(AssetDumpingContext& context, XAssetInfo<StructuredDataDefSet>* asset)
|
||||
{
|
||||
const auto* set = asset->Asset();
|
||||
const auto assetFile = context.OpenAssetFile(asset->m_name);
|
||||
|
||||
if (!assetFile || set->defs == nullptr)
|
||||
return;
|
||||
|
||||
StructuredDataDefDumper dumper(*assetFile);
|
||||
|
||||
for(auto defIndex = 0u; defIndex < set->defCount; defIndex++)
|
||||
{
|
||||
const auto& def = set->defs[defIndex];
|
||||
|
||||
dumper.BeginVersion(def.version);
|
||||
|
||||
// TODO
|
||||
|
||||
dumper.EndVersion();
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
class AssetDumperStructuredDataDefSet final : public AbstractAssetDumper<StructuredDataDefSet>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<StructuredDataDefSet>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<StructuredDataDefSet>* asset) override;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user