From 5f6f0457c2f99ddb14b24b4aa0aafd8abcc1cb62 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 5 Jun 2024 13:07:54 -0400 Subject: [PATCH] Name --- .../legoomni/include/legobuildingmanager.h | 6 +++--- .../src/build/legobuildingmanager.cpp | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legobuildingmanager.h b/LEGO1/lego/legoomni/include/legobuildingmanager.h index 637b1776..8095aa8e 100644 --- a/LEGO1/lego/legoomni/include/legobuildingmanager.h +++ b/LEGO1/lego/legoomni/include/legobuildingmanager.h @@ -15,15 +15,15 @@ class LegoPathBoundary; // SIZE 0x2c struct LegoBuildingInfo { enum { - c_bit1 = 0x01, - c_bit2 = 0x02, + c_hasVariants = 0x01, + c_playSound = 0x02, c_bit3 = 0x04, c_bit4 = 0x08 }; LegoEntity* m_entity; // 0x00 const char* m_hausName; // 0x04 - MxU32 m_cycle1; // 0x08 + MxU32 m_sound; // 0x08 MxU32 m_cycle2; // 0x0c MxU8 m_cycle3; // 0x10 MxS8 m_unk0x11; // 0x11 diff --git a/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp b/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp index 8b2d12fb..3135d631 100644 --- a/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp +++ b/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp @@ -193,7 +193,7 @@ LegoBuildingInfo g_buildingInfoInit[16] = { // clang-format on // GLOBAL: LEGO1 0x100f3738 -MxU32 g_buildingCycle1Length = 6; +MxU32 g_maxSound = 6; // GLOBAL: LEGO1 0x100f373c MxU32 g_cycleLengthOffset1 = 0x3c; @@ -330,7 +330,7 @@ MxResult LegoBuildingManager::Write(LegoStorage* p_storage) for (MxS32 i = 0; i < sizeOfArray(g_buildingInfo); i++) { LegoBuildingInfo* info = &g_buildingInfo[i]; - if (p_storage->Write(&info->m_cycle1, sizeof(info->m_cycle1)) != SUCCESS) { + if (p_storage->Write(&info->m_sound, sizeof(info->m_sound)) != SUCCESS) { goto done; } if (p_storage->Write(&info->m_cycle2, sizeof(info->m_cycle2)) != SUCCESS) { @@ -363,7 +363,7 @@ MxResult LegoBuildingManager::Read(LegoStorage* p_storage) for (MxS32 i = 0; i < sizeOfArray(g_buildingInfo); i++) { LegoBuildingInfo* info = &g_buildingInfo[i]; - if (p_storage->Read(&info->m_cycle1, sizeof(info->m_cycle1)) != SUCCESS) { + if (p_storage->Read(&info->m_sound, sizeof(info->m_sound)) != SUCCESS) { goto done; } if (p_storage->Read(&info->m_cycle2, sizeof(info->m_cycle2)) != SUCCESS) { @@ -449,7 +449,7 @@ MxBool LegoBuildingManager::SwitchVariant(LegoEntity* p_entity) LegoBuildingInfo* info = GetInfo(p_entity); - if (info != NULL && info->m_flags & LegoBuildingInfo::c_bit1 && info->m_unk0x11 == -1) { + if (info != NULL && info->m_flags & LegoBuildingInfo::c_hasVariants && info->m_unk0x11 == -1) { LegoROI* roi = p_entity->GetROI(); if (++m_nextVariant >= sizeOfArray(g_buildingInfoHausName)) { m_nextVariant = 0; @@ -476,11 +476,11 @@ MxBool LegoBuildingManager::SwitchSound(LegoEntity* p_entity) MxBool result = FALSE; LegoBuildingInfo* info = GetInfo(p_entity); - if (info != NULL && info->m_flags & LegoBuildingInfo::c_bit2) { - info->m_cycle1++; + if (info != NULL && info->m_flags & LegoBuildingInfo::c_playSound) { + info->m_sound++; - if (info->m_cycle1 >= g_buildingCycle1Length) { - info->m_cycle1 = 0; + if (info->m_sound >= g_maxSound) { + info->m_sound = 0; } result = TRUE; @@ -548,7 +548,7 @@ MxU32 LegoBuildingManager::FUN_1002ff40(LegoEntity* p_entity, MxBool p_state) { LegoBuildingInfo* info = GetInfo(p_entity); - if (info == NULL || !(info->m_flags & LegoBuildingInfo::c_bit2)) { + if (info == NULL || !(info->m_flags & LegoBuildingInfo::c_playSound)) { return 0; } @@ -557,7 +557,7 @@ MxU32 LegoBuildingManager::FUN_1002ff40(LegoEntity* p_entity, MxBool p_state) } if (info != NULL) { - return info->m_cycle1 + g_cycleLengthOffset1; + return info->m_sound + g_cycleLengthOffset1; } return 0;