mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Implement/match LegoEntity::SwitchSound / SwitchMove / SwitchColor / SwitchMood (#995)
* Implement/match LegoEntity::SwitchSound * Name * Name * Implement/match LegoEntity::SwitchMove * Mood
This commit is contained in:
committed by
GitHub
parent
f6c923a84e
commit
49c17c9c6a
@@ -21,6 +21,12 @@
|
||||
DECOMP_SIZE_ASSERT(LegoCharacter, 0x08)
|
||||
DECOMP_SIZE_ASSERT(LegoCharacterManager, 0x08)
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4d0
|
||||
MxU32 LegoCharacterManager::g_maxMove = 4;
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4d4
|
||||
MxU32 LegoCharacterManager::g_maxSound = 9;
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4e0
|
||||
MxU32 g_unk0x100fc4e0 = 10;
|
||||
|
||||
@@ -113,10 +119,10 @@ MxResult LegoCharacterManager::Write(LegoStorage* p_storage)
|
||||
for (MxS32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||
LegoActorInfo* info = &g_actorInfo[i];
|
||||
|
||||
if (p_storage->Write(&info->m_unk0x0c, sizeof(info->m_unk0x0c)) != SUCCESS) {
|
||||
if (p_storage->Write(&info->m_sound, sizeof(info->m_sound)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_unk0x10, sizeof(info->m_unk0x10)) != SUCCESS) {
|
||||
if (p_storage->Write(&info->m_move, sizeof(info->m_move)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_mood, sizeof(info->m_mood)) != SUCCESS) {
|
||||
@@ -168,10 +174,10 @@ MxResult LegoCharacterManager::Read(LegoStorage* p_storage)
|
||||
for (MxS32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||
LegoActorInfo* info = &g_actorInfo[i];
|
||||
|
||||
if (p_storage->Read(&info->m_unk0x0c, sizeof(info->m_unk0x0c)) != SUCCESS) {
|
||||
if (p_storage->Read(&info->m_sound, sizeof(info->m_sound)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_unk0x10, sizeof(info->m_unk0x10)) != SUCCESS) {
|
||||
if (p_storage->Read(&info->m_move, sizeof(info->m_move)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_mood, sizeof(info->m_mood)) != SUCCESS) {
|
||||
@@ -450,8 +456,8 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key)
|
||||
if (!strcmpi(p_key, "pep")) {
|
||||
LegoActorInfo* pepper = GetActorInfo("pepper");
|
||||
|
||||
info->m_unk0x0c = pepper->m_unk0x0c;
|
||||
info->m_unk0x10 = pepper->m_unk0x10;
|
||||
info->m_sound = pepper->m_sound;
|
||||
info->m_move = pepper->m_move;
|
||||
info->m_mood = pepper->m_mood;
|
||||
|
||||
for (i = 0; i < sizeOfArray(info->m_parts); i++) {
|
||||
@@ -702,8 +708,16 @@ LegoROI* LegoCharacterManager::FindChildROI(LegoROI* p_roi, const char* p_name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10084d50
|
||||
// FUNCTION: BETA10 0x10076223
|
||||
MxBool LegoCharacterManager::SwitchColor(LegoROI* p_roi, LegoROI* p_targetROI)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10084ec0
|
||||
MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi)
|
||||
MxBool LegoCharacterManager::SwitchVariant(LegoROI* p_roi)
|
||||
{
|
||||
LegoActorInfo* info = GetActorInfo(p_roi->GetName());
|
||||
|
||||
@@ -756,6 +770,66 @@ MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10085090
|
||||
// FUNCTION: BETA10 0x100766f6
|
||||
MxBool LegoCharacterManager::SwitchSound(LegoROI* p_roi)
|
||||
{
|
||||
MxBool result = FALSE;
|
||||
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||
|
||||
if (info != NULL) {
|
||||
info->m_sound++;
|
||||
|
||||
if (info->m_sound >= g_maxSound) {
|
||||
info->m_sound = 0;
|
||||
}
|
||||
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100850c0
|
||||
// FUNCTION: BETA10 0x10076754
|
||||
MxBool LegoCharacterManager::SwitchMove(LegoROI* p_roi)
|
||||
{
|
||||
MxBool result = FALSE;
|
||||
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||
|
||||
if (info != NULL) {
|
||||
info->m_move++;
|
||||
|
||||
if (info->m_move >= g_maxMove) {
|
||||
info->m_move = 0;
|
||||
}
|
||||
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100850f0
|
||||
// FUNCTION: BETA10 0x100767b2
|
||||
MxBool LegoCharacterManager::SwitchMood(LegoROI* p_roi)
|
||||
{
|
||||
MxBool result = FALSE;
|
||||
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||
|
||||
if (info != NULL) {
|
||||
info->m_mood++;
|
||||
|
||||
if (info->m_mood > 3) {
|
||||
info->m_mood = 0;
|
||||
}
|
||||
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10085120
|
||||
// FUNCTION: BETA10 0x1007680c
|
||||
MxU32 LegoCharacterManager::FUN_10085120(LegoROI* p_roi)
|
||||
@@ -763,7 +837,7 @@ MxU32 LegoCharacterManager::FUN_10085120(LegoROI* p_roi)
|
||||
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_unk0x10 + g_unk0x100fc4e0;
|
||||
return info->m_move + g_unk0x100fc4e0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -779,7 +853,7 @@ MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
|
||||
}
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_unk0x0c + g_unk0x100fc4d8;
|
||||
return info->m_sound + g_unk0x100fc4d8;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user