mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 15:28:11 -05:00
Dump CommonStructuredDataDefSet instead of the game's internal structures
This commit is contained in:
@ -11,3 +11,9 @@ CommonStructuredDataDef::CommonStructuredDataDef(const int version)
|
||||
m_size_in_byte(0u)
|
||||
{
|
||||
}
|
||||
|
||||
size_t CommonStructuredDataDef::CalculateChecksum() const
|
||||
{
|
||||
// TODO: Implement
|
||||
return 0u;
|
||||
}
|
||||
|
@ -21,4 +21,6 @@ public:
|
||||
|
||||
CommonStructuredDataDef();
|
||||
explicit CommonStructuredDataDef(int version);
|
||||
|
||||
size_t CalculateChecksum() const;
|
||||
};
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "CommonStructuredDataEnum.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
CommonStructuredDataEnumEntry::CommonStructuredDataEnumEntry()
|
||||
: m_value(0u)
|
||||
{
|
||||
@ -32,3 +34,11 @@ size_t CommonStructuredDataEnum::ElementCount() const
|
||||
{
|
||||
return m_reserved_entry_count > 0 ? static_cast<size_t>(m_reserved_entry_count) : m_entries.size();
|
||||
}
|
||||
|
||||
void CommonStructuredDataEnum::SortEntries()
|
||||
{
|
||||
std::sort(m_entries.begin(), m_entries.end(), [](const CommonStructuredDataEnumEntry& e1, const CommonStructuredDataEnumEntry& e2)
|
||||
{
|
||||
return e1.m_value < e2.m_value;
|
||||
});
|
||||
}
|
||||
|
@ -25,4 +25,6 @@ struct CommonStructuredDataEnum
|
||||
CommonStructuredDataEnum(std::string name, int reservedEntryCount);
|
||||
|
||||
_NODISCARD size_t ElementCount() const;
|
||||
|
||||
void SortEntries();
|
||||
};
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "CommonStructuredDataStruct.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
CommonStructuredDataStructEntry::CommonStructuredDataStructEntry()
|
||||
: m_offset_in_bits(0u)
|
||||
{
|
||||
@ -30,3 +32,11 @@ CommonStructuredDataStruct::CommonStructuredDataStruct(std::string name)
|
||||
m_size_in_byte(0u)
|
||||
{
|
||||
}
|
||||
|
||||
void CommonStructuredDataStruct::SortProperties()
|
||||
{
|
||||
std::sort(m_properties.begin(), m_properties.end(), [](const CommonStructuredDataStructEntry& e1, const CommonStructuredDataStructEntry& e2)
|
||||
{
|
||||
return e1.m_offset_in_bits < e2.m_offset_in_bits;
|
||||
});
|
||||
}
|
||||
|
@ -25,4 +25,6 @@ struct CommonStructuredDataStruct
|
||||
|
||||
CommonStructuredDataStruct();
|
||||
explicit CommonStructuredDataStruct(std::string name);
|
||||
|
||||
void SortProperties();
|
||||
};
|
||||
|
Reference in New Issue
Block a user