mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
Fix not considering alignment of 8 bit when calculating size for indexedarray and enumedarray
This commit is contained in:
parent
8133f4d57e
commit
f236d285b6
@ -3,6 +3,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "CommonStructuredDataDef.h"
|
#include "CommonStructuredDataDef.h"
|
||||||
|
#include "Utils/Alignment.h"
|
||||||
|
|
||||||
CommonStructuredDataType::CommonStructuredDataType()
|
CommonStructuredDataType::CommonStructuredDataType()
|
||||||
: m_category(CommonStructuredDataTypeCategory::UNKNOWN),
|
: m_category(CommonStructuredDataTypeCategory::UNKNOWN),
|
||||||
@ -58,7 +59,7 @@ size_t CommonStructuredDataType::GetSizeInBits(const CommonStructuredDataDef& de
|
|||||||
return 0u;
|
return 0u;
|
||||||
}
|
}
|
||||||
const auto& indexedArray = def.m_indexed_arrays[m_info.type_index];
|
const auto& indexedArray = def.m_indexed_arrays[m_info.type_index];
|
||||||
return indexedArray.m_element_size_in_bits * indexedArray.m_element_count;
|
return utils::Align(indexedArray.m_element_size_in_bits * indexedArray.m_element_count, 8u);
|
||||||
}
|
}
|
||||||
case CommonStructuredDataTypeCategory::ENUM_ARRAY:
|
case CommonStructuredDataTypeCategory::ENUM_ARRAY:
|
||||||
{
|
{
|
||||||
@ -68,7 +69,7 @@ size_t CommonStructuredDataType::GetSizeInBits(const CommonStructuredDataDef& de
|
|||||||
return 0u;
|
return 0u;
|
||||||
}
|
}
|
||||||
const auto& enumedArray = def.m_enumed_arrays[m_info.type_index];
|
const auto& enumedArray = def.m_enumed_arrays[m_info.type_index];
|
||||||
return enumedArray.m_element_size_in_bits * enumedArray.m_element_count;
|
return utils::Align(enumedArray.m_element_size_in_bits * enumedArray.m_element_count, 8u);
|
||||||
}
|
}
|
||||||
|
|
||||||
case CommonStructuredDataTypeCategory::UNKNOWN:
|
case CommonStructuredDataTypeCategory::UNKNOWN:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user