Clear unknowns in GetSoundId (#1594)

This commit is contained in:
Fabian Neundorf
2025-06-28 20:32:09 +02:00
committed by GitHub
parent 89539a64f1
commit 9dcc701fcb
8 changed files with 32 additions and 32 deletions

View File

@@ -78,7 +78,7 @@ public:
MxBool SwitchMove(LegoEntity* p_entity); MxBool SwitchMove(LegoEntity* p_entity);
MxBool SwitchMood(LegoEntity* p_entity); MxBool SwitchMood(LegoEntity* p_entity);
MxU32 GetAnimationId(LegoEntity* p_entity); MxU32 GetAnimationId(LegoEntity* p_entity);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state); MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood);
MxBool DecrementCounter(LegoEntity* p_entity); MxBool DecrementCounter(LegoEntity* p_entity);
MxBool DecrementCounter(MxS32 p_index); MxBool DecrementCounter(MxS32 p_index);
MxBool DecrementCounter(LegoBuildingInfo* p_data); MxBool DecrementCounter(LegoBuildingInfo* p_data);

View File

@@ -86,7 +86,7 @@ public:
MxBool SwitchMove(LegoROI* p_roi); MxBool SwitchMove(LegoROI* p_roi);
MxBool SwitchMood(LegoROI* p_roi); MxBool SwitchMood(LegoROI* p_roi);
MxU32 GetAnimationId(LegoROI* p_roi); MxU32 GetAnimationId(LegoROI* p_roi);
MxU32 GetSoundId(LegoROI* p_roi, MxBool p_und); MxU32 GetSoundId(LegoROI* p_roi, MxBool p_basedOnMood);
MxU8 GetMood(LegoROI* p_roi); MxU8 GetMood(LegoROI* p_roi);
LegoROI* CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity); LegoROI* CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity);
MxResult UpdateBoundingSphereAndBox(LegoROI* p_roi); MxResult UpdateBoundingSphereAndBox(LegoROI* p_roi);

View File

@@ -68,13 +68,13 @@ public:
// FUNCTION: BETA10 0x10013260 // FUNCTION: BETA10 0x10013260
virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30 virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30
virtual void ClickSound(MxBool p_und); // vtable+0x34 virtual void ClickSound(MxBool p_basedOnMood); // vtable+0x34
virtual void ClickAnimation(); // vtable+0x38 virtual void ClickAnimation(); // vtable+0x38
virtual void SwitchVariant(); // vtable+0x3c virtual void SwitchVariant(); // vtable+0x3c
virtual void SwitchSound(); // vtable+0x40 virtual void SwitchSound(); // vtable+0x40
virtual void SwitchMove(); // vtable+0x44 virtual void SwitchMove(); // vtable+0x44
virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48 virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48
virtual void SwitchMood(); // vtable+0x4c virtual void SwitchMood(); // vtable+0x4c
void FUN_10010c30(); void FUN_10010c30();
void SetType(MxU8 p_type); void SetType(MxU8 p_type);

View File

@@ -49,7 +49,7 @@ public:
MxBool SwitchMove(LegoEntity* p_entity); MxBool SwitchMove(LegoEntity* p_entity);
MxBool SwitchMood(LegoEntity* p_entity); MxBool SwitchMood(LegoEntity* p_entity);
MxU32 GetAnimationId(LegoEntity* p_entity); MxU32 GetAnimationId(LegoEntity* p_entity);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state); MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood);
LegoPlantInfo* GetInfoArray(MxS32& p_length); LegoPlantInfo* GetInfoArray(MxS32& p_length);
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId); LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId);
MxBool DecrementCounter(LegoEntity* p_entity); MxBool DecrementCounter(LegoEntity* p_entity);

View File

@@ -199,10 +199,10 @@ LegoBuildingInfo g_buildingInfoInit[16] = {
MxU32 LegoBuildingManager::g_maxSound = 6; MxU32 LegoBuildingManager::g_maxSound = 6;
// GLOBAL: LEGO1 0x100f373c // GLOBAL: LEGO1 0x100f373c
MxU32 g_unk0x100f373c = 0x3c; MxU32 g_buildingSoundIdOffset = 0x3c;
// GLOBAL: LEGO1 0x100f3740 // GLOBAL: LEGO1 0x100f3740
MxU32 g_unk0x100f3740 = 0x42; MxU32 g_buildingSoundIdMoodOffset = 0x42;
// clang-format off // clang-format off
// GLOBAL: LEGO1 0x100f3788 // GLOBAL: LEGO1 0x100f3788
@@ -548,7 +548,7 @@ MxU32 LegoBuildingManager::GetAnimationId(LegoEntity* p_entity)
// FUNCTION: LEGO1 0x1002ff40 // FUNCTION: LEGO1 0x1002ff40
// FUNCTION: BETA10 0x10064398 // FUNCTION: BETA10 0x10064398
MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_state) MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood)
{ {
LegoBuildingInfo* info = GetInfo(p_entity); LegoBuildingInfo* info = GetInfo(p_entity);
@@ -556,12 +556,12 @@ MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
return 0; return 0;
} }
if (p_state) { if (p_basedOnMood) {
return info->m_mood + g_unk0x100f3740; return info->m_mood + g_buildingSoundIdMoodOffset;
} }
if (info != NULL) { if (info != NULL) {
return info->m_sound + g_unk0x100f373c; return info->m_sound + g_buildingSoundIdOffset;
} }
return 0; return 0;

View File

@@ -37,10 +37,10 @@ MxU32 g_characterAnimationId = 10;
char* LegoCharacterManager::g_customizeAnimFile = NULL; char* LegoCharacterManager::g_customizeAnimFile = NULL;
// GLOBAL: LEGO1 0x100fc4d8 // GLOBAL: LEGO1 0x100fc4d8
MxU32 g_soundIdOffset = 50; MxU32 g_characterSoundIdOffset = 50;
// GLOBAL: LEGO1 0x100fc4dc // GLOBAL: LEGO1 0x100fc4dc
MxU32 g_soundIdMoodOffset = 66; MxU32 g_characterSoundIdMoodOffset = 66;
// GLOBAL: LEGO1 0x100fc4e8 // GLOBAL: LEGO1 0x100fc4e8
MxU32 g_headTextureCounter = 0; MxU32 g_headTextureCounter = 0;
@@ -931,16 +931,16 @@ MxU32 LegoCharacterManager::GetAnimationId(LegoROI* p_roi)
// FUNCTION: LEGO1 0x10085140 // FUNCTION: LEGO1 0x10085140
// FUNCTION: BETA10 0x10076855 // FUNCTION: BETA10 0x10076855
MxU32 LegoCharacterManager::GetSoundId(LegoROI* p_roi, MxBool p_und) MxU32 LegoCharacterManager::GetSoundId(LegoROI* p_roi, MxBool p_basedOnMood)
{ {
LegoActorInfo* info = GetActorInfo(p_roi); LegoActorInfo* info = GetActorInfo(p_roi);
if (p_und) { if (p_basedOnMood) {
return info->m_mood + g_soundIdMoodOffset; return info->m_mood + g_characterSoundIdMoodOffset;
} }
if (info != NULL) { if (info != NULL) {
return info->m_sound + g_soundIdOffset; return info->m_sound + g_characterSoundIdOffset;
} }
else { else {
return 0; return 0;

View File

@@ -40,10 +40,10 @@ MxU8 g_counters[] = {1, 2, 2, 3};
MxU32 LegoPlantManager::g_maxSound = 8; MxU32 LegoPlantManager::g_maxSound = 8;
// GLOBAL: LEGO1 0x100f3160 // GLOBAL: LEGO1 0x100f3160
MxU32 g_unk0x100f3160 = 56; MxU32 g_plantSoundIdOffset = 56;
// GLOBAL: LEGO1 0x100f3164 // GLOBAL: LEGO1 0x100f3164
MxU32 g_unk0x100f3164 = 66; MxU32 g_plantSoundIdMoodOffset = 66;
// GLOBAL: LEGO1 0x100f3168 // GLOBAL: LEGO1 0x100f3168
MxS32 LegoPlantManager::g_maxMove[4] = {3, 3, 3, 3}; MxS32 LegoPlantManager::g_maxMove[4] = {3, 3, 3, 3};
@@ -513,16 +513,16 @@ MxU32 LegoPlantManager::GetAnimationId(LegoEntity* p_entity)
// FUNCTION: LEGO1 0x10026ba0 // FUNCTION: LEGO1 0x10026ba0
// FUNCTION: BETA10 0x100c61ba // FUNCTION: BETA10 0x100c61ba
MxU32 LegoPlantManager::GetSoundId(LegoEntity* p_entity, MxBool p_state) MxU32 LegoPlantManager::GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood)
{ {
LegoPlantInfo* info = GetInfo(p_entity); LegoPlantInfo* info = GetInfo(p_entity);
if (p_state) { if (p_basedOnMood) {
return (info->m_mood & 1) + g_unk0x100f3164; return (info->m_mood & 1) + g_plantSoundIdMoodOffset;
} }
if (info != NULL) { if (info != NULL) {
return info->m_sound + g_unk0x100f3160; return info->m_sound + g_plantSoundIdOffset;
} }
return 0; return 0;

View File

@@ -263,7 +263,7 @@ void LegoEntity::ParseAction(char* p_extra)
// FUNCTION: LEGO1 0x10010f10 // FUNCTION: LEGO1 0x10010f10
// FUNCTION: BETA10 0x1007ee87 // FUNCTION: BETA10 0x1007ee87
void LegoEntity::ClickSound(MxBool p_und) void LegoEntity::ClickSound(MxBool p_basedOnMood)
{ {
if (!IsInteraction(c_disabled)) { if (!IsInteraction(c_disabled)) {
MxU32 objectId = 0; MxU32 objectId = 0;
@@ -271,15 +271,15 @@ void LegoEntity::ClickSound(MxBool p_und)
switch (m_type) { switch (m_type) {
case e_actor: case e_actor:
objectId = CharacterManager()->GetSoundId(m_roi, p_und); objectId = CharacterManager()->GetSoundId(m_roi, p_basedOnMood);
break; break;
case e_unk1: case e_unk1:
break; break;
case e_plant: case e_plant:
objectId = PlantManager()->GetSoundId(this, p_und); objectId = PlantManager()->GetSoundId(this, p_basedOnMood);
break; break;
case e_building: case e_building:
objectId = BuildingManager()->GetSoundId(this, p_und); objectId = BuildingManager()->GetSoundId(this, p_basedOnMood);
break; break;
} }