mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-29 10:55:42 -05:00
Implement/match LegoAnimationManager::FUN_10063b90 (#953)
This commit is contained in:
parent
7c9fdd255e
commit
857c15ca11
5 changed files with 73 additions and 23 deletions
|
@ -152,7 +152,7 @@ class LegoAnimationManager : public MxCore {
|
|||
MxBool FUN_10062650(Vector3& p_position, float p_und, LegoROI* p_roi);
|
||||
MxBool FUN_10062710(AnimInfo& p_info);
|
||||
void FUN_10063aa0();
|
||||
MxBool FUN_10063b90(LegoWorld* p_world, LegoExtraActor* p_actor, MxU8 p_unk0x14, MxU32 p_characterId);
|
||||
MxBool FUN_10063b90(LegoWorld* p_world, LegoExtraActor* p_actor, MxU8 p_mood, MxU32 p_characterId);
|
||||
void FUN_10063d10();
|
||||
MxBool FUN_10063fb0(LegoLocation::Boundary* p_boundary, LegoWorld* p_world);
|
||||
MxBool FUN_10064010(LegoPathBoundary* p_boundary, LegoUnknown100db7f4* p_edge, float p_destScale);
|
||||
|
|
|
@ -71,7 +71,7 @@ class LegoCharacterManager {
|
|||
LegoCharacterInfo* GetInfo(LegoROI* p_roi);
|
||||
MxBool SwitchHat(LegoROI* p_roi);
|
||||
MxU32 FUN_10085140(LegoROI* p_roi, MxBool p_und);
|
||||
MxU8 FUN_10085180(LegoROI* p_roi);
|
||||
MxU8 GetMood(LegoROI* p_roi);
|
||||
LegoROI* FUN_10085210(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
||||
LegoROI* FUN_10085a80(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ struct LegoCharacterInfo {
|
|||
LegoExtraActor* m_actor; // 0x08
|
||||
MxS32 m_unk0x0c; // 0x0c
|
||||
MxS32 m_unk0x10; // 0x10
|
||||
MxU8 m_unk0x14; // 0x14
|
||||
MxU8 m_mood; // 0x14
|
||||
Part m_parts[10]; // 0x18
|
||||
};
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ LegoAnimationManager::Vehicle g_vehicles[] = {
|
|||
};
|
||||
|
||||
// GLOBAL: LEGO1 0x100f6d58
|
||||
const char* g_unk0x100f6d58[11][17] = {
|
||||
const char* g_cycles[11][17] = {
|
||||
{"CNs001xx",
|
||||
"CNs002xx",
|
||||
"CNs003xx",
|
||||
|
@ -1973,7 +1973,7 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und)
|
|||
if (FUN_10063b90(
|
||||
world,
|
||||
actor,
|
||||
CharacterManager()->FUN_10085180(m_extras[i].m_roi),
|
||||
CharacterManager()->GetMood(m_extras[i].m_roi),
|
||||
m_lastExtraCharacterId
|
||||
)) {
|
||||
m_extras[i].m_unk0x14 = TRUE;
|
||||
|
@ -2064,17 +2064,67 @@ void LegoAnimationManager::FUN_10063aa0()
|
|||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10063b90
|
||||
// FUNCTION: LEGO1 0x10063b90
|
||||
// FUNCTION: BETA10 0x10044d46
|
||||
MxBool LegoAnimationManager::FUN_10063b90(
|
||||
LegoWorld* p_world,
|
||||
LegoExtraActor* p_actor,
|
||||
MxU8 p_unk0x14,
|
||||
MxU32 p_characterId
|
||||
)
|
||||
MxBool LegoAnimationManager::FUN_10063b90(LegoWorld* p_world, LegoExtraActor* p_actor, MxU8 p_mood, MxU32 p_characterId)
|
||||
{
|
||||
// TODO
|
||||
return TRUE;
|
||||
const char** cycles = g_cycles[g_characters[p_characterId].m_unk0x16];
|
||||
const char* vehicleWC;
|
||||
|
||||
if (g_characters[p_characterId].m_vehicleId >= 0 && g_vehicles[g_characters[p_characterId].m_vehicleId].m_unk0x04 &&
|
||||
(vehicleWC = cycles[10]) != NULL) {
|
||||
LegoLocomotionAnimPresenter* presenter =
|
||||
(LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
|
||||
|
||||
if (presenter != NULL) {
|
||||
presenter->FUN_1006d680(p_actor, 1.7f);
|
||||
}
|
||||
|
||||
g_vehicles[g_characters[p_characterId].m_vehicleId].m_unk0x04 = FALSE;
|
||||
g_vehicles[g_characters[p_characterId].m_vehicleId].m_unk0x05 = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
vehicleWC = cycles[p_mood];
|
||||
if (vehicleWC != NULL) {
|
||||
LegoLocomotionAnimPresenter* presenter =
|
||||
(LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
|
||||
|
||||
if (presenter != NULL) {
|
||||
presenter->FUN_1006d680(p_actor, 0.7f);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_mood >= 2) {
|
||||
p_mood--;
|
||||
}
|
||||
|
||||
vehicleWC = cycles[p_mood + 4];
|
||||
if (vehicleWC != NULL) {
|
||||
LegoLocomotionAnimPresenter* presenter =
|
||||
(LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
|
||||
|
||||
if (presenter != NULL) {
|
||||
presenter->FUN_1006d680(p_actor, 4.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_mood >= 1) {
|
||||
p_mood--;
|
||||
}
|
||||
|
||||
vehicleWC = cycles[p_mood + 7];
|
||||
if (vehicleWC != NULL) {
|
||||
LegoLocomotionAnimPresenter* presenter =
|
||||
(LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
|
||||
|
||||
if (presenter != NULL) {
|
||||
presenter->FUN_1006d680(p_actor, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10063d10
|
||||
|
@ -2329,15 +2379,15 @@ MxResult LegoAnimationManager::FUN_10064380(
|
|||
}
|
||||
|
||||
MxS32 characterId = m_extras[i].m_characterId;
|
||||
const char** unk0x100f6d58 = g_unk0x100f6d58[g_characters[characterId].m_unk0x16];
|
||||
const char** cycles = g_cycles[g_characters[characterId].m_unk0x16];
|
||||
|
||||
LegoLocomotionAnimPresenter* presenter =
|
||||
(LegoLocomotionAnimPresenter*) world->Find("LegoAnimPresenter", unk0x100f6d58[p_undIdx1]);
|
||||
(LegoLocomotionAnimPresenter*) world->Find("LegoAnimPresenter", cycles[p_undIdx1]);
|
||||
if (presenter != NULL) {
|
||||
presenter->FUN_1006d680(actor, 0.0f);
|
||||
}
|
||||
|
||||
presenter = (LegoLocomotionAnimPresenter*) world->Find("LegoAnimPresenter", unk0x100f6d58[p_undIdx2]);
|
||||
presenter = (LegoLocomotionAnimPresenter*) world->Find("LegoAnimPresenter", cycles[p_undIdx2]);
|
||||
if (presenter != NULL) {
|
||||
presenter->FUN_1006d680(actor, 4.0f);
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ MxResult LegoCharacterManager::Write(LegoStorage* p_storage)
|
|||
if (p_storage->Write(&info->m_unk0x10, sizeof(info->m_unk0x10)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_unk0x14, sizeof(info->m_unk0x14)) != SUCCESS) {
|
||||
if (p_storage->Write(&info->m_mood, sizeof(info->m_mood)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_parts[c_infohatPart].m_unk0x08, sizeof(info->m_parts[c_infohatPart].m_unk0x08)) !=
|
||||
|
@ -171,7 +171,7 @@ MxResult LegoCharacterManager::Read(LegoStorage* p_storage)
|
|||
if (p_storage->Read(&info->m_unk0x10, sizeof(info->m_unk0x10)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_unk0x14, sizeof(info->m_unk0x14)) != SUCCESS) {
|
||||
if (p_storage->Read(&info->m_mood, sizeof(info->m_mood)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_parts[c_infohatPart].m_unk0x08, sizeof(info->m_parts[c_infohatPart].m_unk0x08)) !=
|
||||
|
@ -449,7 +449,7 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||
|
||||
info->m_unk0x0c = pepper->m_unk0x0c;
|
||||
info->m_unk0x10 = pepper->m_unk0x10;
|
||||
info->m_unk0x14 = pepper->m_unk0x14;
|
||||
info->m_mood = pepper->m_mood;
|
||||
|
||||
for (i = 0; i < sizeOfArray(info->m_parts); i++) {
|
||||
info->m_parts[i] = pepper->m_parts[i];
|
||||
|
@ -760,7 +760,7 @@ MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
|
|||
LegoCharacterInfo* info = GetInfo(p_roi);
|
||||
|
||||
if (p_und) {
|
||||
return info->m_unk0x14 + g_unk0x100fc4dc;
|
||||
return info->m_mood + g_unk0x100fc4dc;
|
||||
}
|
||||
|
||||
if (info != NULL) {
|
||||
|
@ -772,12 +772,12 @@ MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
|
|||
|
||||
// FUNCTION: LEGO1 0x10085180
|
||||
// FUNCTION: BETA10 0x100768c5
|
||||
MxU8 LegoCharacterManager::FUN_10085180(LegoROI* p_roi)
|
||||
MxU8 LegoCharacterManager::GetMood(LegoROI* p_roi)
|
||||
{
|
||||
LegoCharacterInfo* info = GetInfo(p_roi);
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_unk0x14;
|
||||
return info->m_mood;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue