2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-06-08 21:45:40 +00:00

fix: Make LoadPtrArray reusable methods for x64

This commit is contained in:
Jan 2025-06-03 22:52:25 +01:00
parent 476205fe2e
commit af4abe49d3
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C

View File

@ -952,7 +952,14 @@ namespace
LINE("{") LINE("{")
m_intendation++; m_intendation++;
LINEF("*{0} = m_stream.ConvertOffsetToPointerNative(*{0});", MakeTypePtrVarName(def)) if (info && !info->m_has_matching_cross_platform_structure)
{
LINEF("*{0} = m_stream.ConvertOffsetToPointerRedirect(*{0});", MakeTypePtrVarName(def))
}
else
{
LINEF("*{0} = m_stream.ConvertOffsetToPointerNative(*{0});", MakeTypePtrVarName(def))
}
m_intendation--; m_intendation--;
LINE("}") LINE("}")
@ -984,9 +991,19 @@ namespace
m_intendation++; m_intendation++;
LINEF("const auto ptrArrayFill = m_stream.LoadWithFill({0} * count);", m_env.m_pointer_size) LINEF("const auto ptrArrayFill = m_stream.LoadWithFill({0} * count);", m_env.m_pointer_size)
LINE("for (size_t index = 0; index < count; index++)") LINE("for (size_t index = 0; index < count; index++)")
LINE("{")
m_intendation++; m_intendation++;
LINEF("ptrArrayFill.FillPtr({0}[index], {1} * index);", MakeTypePtrVarName(def), m_env.m_pointer_size) LINEF("ptrArrayFill.FillPtr({0}[index], {1} * index);", MakeTypePtrVarName(def), m_env.m_pointer_size)
if (reusable)
{
LINEF("ptrArrayFill.InsertPointerRedirect(m_stream.AllocRedirectEntry({0}[index]), {1} * index);",
MakeTypePtrVarName(def),
m_env.m_pointer_size)
}
m_intendation--; m_intendation--;
LINE("}")
m_intendation--; m_intendation--;
LINE("}") LINE("}")
} }