refactor: change names back

This commit is contained in:
jonschz 2024-06-14 19:17:18 +02:00
parent abc1c091e8
commit dc2ab78b90
2 changed files with 35 additions and 31 deletions

View File

@ -78,11 +78,15 @@ class AnimState : public LegoState {
// AnimState::`scalar deleting destructor' // AnimState::`scalar deleting destructor'
private: private:
undefined4 m_unk0x08; // 0x08 undefined4 m_unk0x08; // 0x08
undefined4 m_arrayOfUnknownShortsLength; // 0x0c // appears to store the length of m_unk0x10
undefined2* m_arrayOfUnknownShorts; // 0x10 undefined4 m_unk0x0c; // 0x0c
undefined4 m_arrayOfUnknownBytesLength; // 0x14 // dynamically sized array of two-byte elements
undefined* m_arrayOfUnknownBytes; // 0x18 undefined2* m_unk0x10; // 0x10
// appears to store the length of m_unk0x18
undefined4 m_unk0x14; // 0x14
// dynamically sized array of one-byte elements
undefined* m_unk0x18; // 0x18
}; };
// VTABLE: LEGO1 0x100d8c18 // VTABLE: LEGO1 0x100d8c18

View File

@ -2826,10 +2826,10 @@ void LegoAnimationManager::FUN_10064b50(MxLong p_time)
// FUNCTION: LEGO1 0x10064ff0 // FUNCTION: LEGO1 0x10064ff0
AnimState::AnimState() AnimState::AnimState()
{ {
m_arrayOfUnknownShortsLength = 0; m_unk0x0c = 0;
m_arrayOfUnknownShorts = NULL; m_unk0x10 = NULL;
m_arrayOfUnknownBytesLength = 0; m_unk0x14 = 0;
m_arrayOfUnknownBytes = NULL; m_unk0x18 = NULL;
} }
// STUB: LEGO1 0x10065150 // STUB: LEGO1 0x10065150
@ -2867,45 +2867,45 @@ MxResult AnimState::Serialize(LegoFile* p_file)
Read(p_file, &m_unk0x08); Read(p_file, &m_unk0x08);
// m_unk0x10_len and m_unk0x10 // m_unk0x10_len and m_unk0x10
if (m_arrayOfUnknownShorts) { if (m_unk0x10) {
delete[] m_arrayOfUnknownShorts; delete[] m_unk0x10;
} }
Read(p_file, &m_arrayOfUnknownShortsLength); Read(p_file, &m_unk0x0c);
if (m_arrayOfUnknownShortsLength != 0) { if (m_unk0x0c != 0) {
m_arrayOfUnknownShorts = new undefined2[m_arrayOfUnknownShortsLength]; m_unk0x10 = new undefined2[m_unk0x0c];
} }
else { else {
m_arrayOfUnknownShorts = NULL; m_unk0x10 = NULL;
} }
for (int i = 0; i < m_arrayOfUnknownShortsLength; i++) { for (int i = 0; i < m_unk0x0c; i++) {
Read(p_file, &m_arrayOfUnknownShorts[i]); Read(p_file, &m_unk0x10[i]);
} }
// m_unk0x18_len and m_unk0x18 // m_unk0x18_len and m_unk0x18
// Note that here we read first and then free memory in contrast to above // Note that here we read first and then free memory in contrast to above
Read(p_file, &m_arrayOfUnknownBytesLength); Read(p_file, &m_unk0x14);
if (m_arrayOfUnknownBytes) { if (m_unk0x18) {
delete[] m_arrayOfUnknownBytes; delete[] m_unk0x18;
} }
if (m_arrayOfUnknownBytesLength != 0) { if (m_unk0x14 != 0) {
m_arrayOfUnknownBytes = new undefined[m_arrayOfUnknownBytesLength]; m_unk0x18 = new undefined[m_unk0x14];
} }
else { else {
m_arrayOfUnknownBytes = NULL; m_unk0x18 = NULL;
} }
for (int j = 0; j < m_arrayOfUnknownBytesLength; j++) { for (int j = 0; j < m_unk0x14; j++) {
Read(p_file, &m_arrayOfUnknownBytes[j]); Read(p_file, &m_unk0x18[j]);
} }
} }
else if (p_file->IsWriteMode()) { else if (p_file->IsWriteMode()) {
Write(p_file, m_unk0x08); Write(p_file, m_unk0x08);
Write(p_file, m_arrayOfUnknownShortsLength); Write(p_file, m_unk0x0c);
for (int i = 0; i < m_arrayOfUnknownShortsLength; i++) { for (int i = 0; i < m_unk0x0c; i++) {
Write(p_file, m_arrayOfUnknownShorts[i]); Write(p_file, m_unk0x10[i]);
} }
Write(p_file, m_arrayOfUnknownBytesLength); Write(p_file, m_unk0x14);
for (int j = 0; j < m_arrayOfUnknownBytesLength; j++) { for (int j = 0; j < m_unk0x14; j++) {
Write(p_file, m_arrayOfUnknownBytes[j]); Write(p_file, m_unk0x18[j]);
} }
} }