Dump structured data def reserved count

This commit is contained in:
Jan 2022-01-20 22:20:30 +01:00
parent 51003e5f6d
commit 040f945009
3 changed files with 11 additions and 4 deletions

View File

@ -53,7 +53,7 @@ void StructuredDataDefDumper::EndVersion()
m_flags.m_empty_line_before_block = false;
}
void StructuredDataDefDumper::BeginEnum(const std::string& enumName, const size_t enumEntryCount)
void StructuredDataDefDumper::BeginEnum(const std::string& enumName, const size_t enumEntryCount, size_t enumReservedEntryCount)
{
assert(m_flags.m_in_version);
assert(m_block == Block::BLOCK_NONE);
@ -65,7 +65,13 @@ void StructuredDataDefDumper::BeginEnum(const std::string& enumName, const size_
m_stream << "\n";
Indent();
m_stream << "enum " << enumName << "\n";
if (enumReservedEntryCount != enumEntryCount)
m_stream << "enum(" << enumReservedEntryCount << ") ";
else
m_stream << "enum ";
m_stream << enumName;
m_stream << "\n";
Indent();
m_stream << "{\n";

View File

@ -45,7 +45,7 @@ public:
void BeginVersion(int version);
void EndVersion();
void BeginEnum(const std::string& enumName, size_t enumEntryCount);
void BeginEnum(const std::string& enumName, size_t enumEntryCount, size_t enumReservedEntryCount);
void EndEnum();
void WriteEnumEntry(const std::string& entryName, size_t entryValue);

View File

@ -2,6 +2,7 @@
#include <cassert>
#include <sstream>
#include <algorithm>
#include "Dumping/StructuredDataDef/StructuredDataDefDumper.h"
@ -115,7 +116,7 @@ void AssetDumperStructuredDataDefSet::DumpEnum(StructuredDataDefDumper& dumper,
std::ostringstream ss;
ss << "ENUM_" << enumIndex;
dumper.BeginEnum(ss.str(), static_cast<size_t>(_enum->entryCount));
dumper.BeginEnum(ss.str(), static_cast<size_t>(_enum->entryCount), static_cast<size_t>(_enum->reservedEntryCount));
for (auto i = 0; i < _enum->entryCount; i++)
{