Skip to content

Commit

Permalink
Implement/match LegoNavController::Notify
Browse files Browse the repository at this point in the history
  • Loading branch information
foxtacles committed Dec 21, 2024
1 parent bcc4125 commit 499462f
Show file tree
Hide file tree
Showing 20 changed files with 464 additions and 88 deletions.
8 changes: 7 additions & 1 deletion LEGO1/lego/legoomni/include/legoanimationmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ class LegoAnimationManager : public MxCore {
MxBool m_unk0x14; // 0x14
};

enum PlayMode {
e_unk0 = 0,
e_unk1,
e_unk2
};

LegoAnimationManager();
~LegoAnimationManager() override;

Expand Down Expand Up @@ -166,7 +172,7 @@ class LegoAnimationManager : public MxCore {
MxU32 p_objectId,
MxMatrix* p_matrix,
MxBool p_param3,
MxBool p_param4,
MxU8 p_param4,
LegoROI* p_roi,
MxBool p_param6,
MxBool p_param7,
Expand Down
2 changes: 2 additions & 0 deletions LEGO1/lego/legoomni/include/legocharactermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class LegoCharacterManager {

MxResult Write(LegoStorage* p_storage);
MxResult Read(LegoStorage* p_storage);
const char* GetActorName(MxS32 p_index);
MxU32 GetNumActors();
LegoROI* GetActorROI(const char* p_name, MxBool p_createEntity);

void Init();
Expand Down
3 changes: 2 additions & 1 deletion LEGO1/lego/legoomni/include/legoplantmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class LegoPlantManager : public MxCore {
void Reset(LegoOmni::World p_worldId);
MxResult Write(LegoStorage* p_storage);
MxResult Read(LegoStorage* p_storage);
MxS32 GetNumPlants();
MxBool SwitchColor(LegoEntity* p_entity);
MxBool SwitchVariant(LegoEntity* p_entity);
MxBool SwitchSound(LegoEntity* p_entity);
Expand All @@ -48,6 +49,7 @@ class LegoPlantManager : public MxCore {
MxU32 GetAnimationId(LegoEntity* p_entity);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
LegoPlantInfo* GetInfoArray(MxS32& p_length);
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId);
MxBool FUN_10026c50(LegoEntity* p_entity);
void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length);
MxResult FUN_10026410();
Expand All @@ -61,7 +63,6 @@ class LegoPlantManager : public MxCore {
// LegoPlantManager::`scalar deleting destructor'

private:
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId);
void RemovePlant(MxS32 p_index, LegoOmni::World p_worldId);
void FUN_10026860(MxS32 p_index);
LegoPlantInfo* GetInfo(LegoEntity* p_entity);
Expand Down
6 changes: 4 additions & 2 deletions LEGO1/lego/legoomni/src/actors/ambulance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,15 +595,17 @@ void Ambulance::FUN_10037250()
// FUNCTION: BETA10 0x100241a0
void Ambulance::PlayAnimation(IsleScript::Script p_objectId)
{
AnimationManager()->FUN_10060dc0(p_objectId, NULL, TRUE, FALSE, NULL, FALSE, FALSE, FALSE, TRUE);
AnimationManager()
->FUN_10060dc0(p_objectId, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, FALSE, FALSE, FALSE, TRUE);
m_lastAnimation = p_objectId;
}

// FUNCTION: LEGO1 0x10037310
// FUNCTION: BETA10 0x10024440
void Ambulance::PlayFinalAnimation(IsleScript::Script p_objectId)
{
AnimationManager()->FUN_10060dc0(p_objectId, NULL, TRUE, TRUE, NULL, FALSE, FALSE, TRUE, TRUE);
AnimationManager()
->FUN_10060dc0(p_objectId, NULL, TRUE, LegoAnimationManager::e_unk1, NULL, FALSE, FALSE, TRUE, TRUE);
m_lastAnimation = p_objectId;
}

Expand Down
13 changes: 11 additions & 2 deletions LEGO1/lego/legoomni/src/actors/bike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,16 @@ void Bike::ActivateSceneActions()
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

AnimationManager()
->FUN_10060dc0(IsleScript::c_sns006in_RunAnim, &mat, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE);
AnimationManager()->FUN_10060dc0(
IsleScript::c_sns006in_RunAnim,
&mat,
TRUE,
LegoAnimationManager::e_unk0,
NULL,
FALSE,
TRUE,
TRUE,
TRUE
);
}
}
13 changes: 11 additions & 2 deletions LEGO1/lego/legoomni/src/actors/dunebuggy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,16 @@ void DuneBuggy::ActivateSceneActions()
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

AnimationManager()
->FUN_10060dc0(IsleScript::c_sns005in_RunAnim, &mat, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE);
AnimationManager()->FUN_10060dc0(
IsleScript::c_sns005in_RunAnim,
&mat,
TRUE,
LegoAnimationManager::e_unk0,
NULL,
FALSE,
TRUE,
TRUE,
TRUE
);
}
}
3 changes: 2 additions & 1 deletion LEGO1/lego/legoomni/src/actors/islepathactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ void IslePathActor::SpawnPlayer(LegoGameState::Area p_area, MxBool p_enter, MxU8
}

if (state != NULL && state->m_unk0x4d && !state->m_unk0x4e) {
if (AnimationManager()->FUN_10060dc0(anim, NULL, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE) ==
if (AnimationManager()
->FUN_10060dc0(anim, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, FALSE, TRUE, TRUE, TRUE) ==
SUCCESS) {
state->m_unk0x4e = TRUE;
camAnim = FALSE;
Expand Down
13 changes: 11 additions & 2 deletions LEGO1/lego/legoomni/src/actors/jetski.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,17 @@ void Jetski::ActivateSceneActions()
MxMatrix mat(user->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.6, mat[2][2] * 2.5);

AnimationManager()
->FUN_10060dc0(IsleScript::c_sjs007in_RunAnim, &mat, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE);
AnimationManager()->FUN_10060dc0(
IsleScript::c_sjs007in_RunAnim,
&mat,
TRUE,
LegoAnimationManager::e_unk0,
NULL,
FALSE,
TRUE,
TRUE,
TRUE
);
}
}
}
Expand Down
13 changes: 11 additions & 2 deletions LEGO1/lego/legoomni/src/actors/motorcycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,16 @@ void Motocycle::ActivateSceneActions()
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

AnimationManager()
->FUN_10060dc0(IsleScript::c_sns006in_RunAnim, &mat, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE);
AnimationManager()->FUN_10060dc0(
IsleScript::c_sns006in_RunAnim,
&mat,
TRUE,
LegoAnimationManager::e_unk0,
NULL,
FALSE,
TRUE,
TRUE,
TRUE
);
}
}
3 changes: 2 additions & 1 deletion LEGO1/lego/legoomni/src/actors/pizza.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@ void Pizza::PlayAction(MxU32 p_objectId, MxBool p_param7)
InvokeAction(Extra::e_stop, *g_isleScript, m_unk0x8c, NULL);
}

AnimationManager()->FUN_10060dc0(p_objectId, NULL, TRUE, FALSE, NULL, FALSE, p_param7, TRUE, TRUE);
AnimationManager()
->FUN_10060dc0(p_objectId, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, FALSE, p_param7, TRUE, TRUE);
}

// FUNCTION: LEGO1 0x10039030
Expand Down
13 changes: 11 additions & 2 deletions LEGO1/lego/legoomni/src/actors/skateboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,17 @@ void SkateBoard::ActivateSceneActions()
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.2, mat[2][2] * 2.5);

AnimationManager()
->FUN_10060dc0(IsleScript::c_sns008in_RunAnim, &mat, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE);
AnimationManager()->FUN_10060dc0(
IsleScript::c_sns008in_RunAnim,
&mat,
TRUE,
LegoAnimationManager::e_unk0,
NULL,
FALSE,
TRUE,
TRUE,
TRUE
);
}
}
}
6 changes: 4 additions & 2 deletions LEGO1/lego/legoomni/src/actors/towtrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,17 @@ void TowTrack::FUN_1004dbe0()
// FUNCTION: BETA10 0x100f86a0
void TowTrack::PlayFinalAnimation(IsleScript::Script p_objectId)
{
AnimationManager()->FUN_10060dc0(p_objectId, NULL, TRUE, FALSE, NULL, FALSE, FALSE, FALSE, TRUE);
AnimationManager()
->FUN_10060dc0(p_objectId, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, FALSE, FALSE, FALSE, TRUE);
m_lastAnimation = p_objectId;
}

// FUNCTION: LEGO1 0x1004dcb0
void TowTrack::FUN_1004dcb0(IsleScript::Script p_objectId)
{
AnimationManager()->FUN_1005f6d0(TRUE);
AnimationManager()->FUN_10060dc0(p_objectId, NULL, TRUE, TRUE, NULL, FALSE, TRUE, TRUE, TRUE);
AnimationManager()
->FUN_10060dc0(p_objectId, NULL, TRUE, LegoAnimationManager::e_unk1, NULL, FALSE, TRUE, TRUE, TRUE);
m_lastAnimation = p_objectId;
}

Expand Down
6 changes: 3 additions & 3 deletions LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ MxResult LegoAnimationManager::FUN_10060dc0(
MxU32 p_objectId,
MxMatrix* p_matrix,
MxBool p_param3,
MxBool p_param4,
MxU8 p_param4,
LegoROI* p_roi,
MxBool p_param6,
MxBool p_param7,
Expand All @@ -1159,10 +1159,10 @@ MxResult LegoAnimationManager::FUN_10060dc0(
MxBool unk0x0a;

switch (p_param4) {
case FALSE:
case e_unk0:
unk0x0a = m_anims[i].m_unk0x0a;
break;
case TRUE:
case e_unk1:
unk0x0a = TRUE;
break;
default:
Expand Down
18 changes: 18 additions & 0 deletions LEGO1/lego/legoomni/src/common/legocharactermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,24 @@ MxResult LegoCharacterManager::Read(LegoStorage* p_storage)
return result;
}

// FUNCTION: LEGO1 0x100834d0
// FUNCTION: BETA10 0x100742eb
const char* LegoCharacterManager::GetActorName(MxS32 p_index)
{
if (p_index < sizeOfArray(g_actorInfo)) {
return g_actorInfo[p_index].m_name;
}

return NULL;
}

// FUNCTION: LEGO1 0x100834f0
// FUNCTION: BETA10 0x1007432a
MxU32 LegoCharacterManager::GetNumActors()
{
return sizeOfArray(g_actorInfo);
}

// FUNCTION: LEGO1 0x10083500
// FUNCTION: BETA10 0x10074345
LegoROI* LegoCharacterManager::GetActorROI(const char* p_name, MxBool p_createEntity)
Expand Down
8 changes: 8 additions & 0 deletions LEGO1/lego/legoomni/src/common/legoplantmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void LegoPlantManager::LoadWorldInfo(LegoOmni::World p_worldId)
}

// FUNCTION: LEGO1 0x100263a0
// FUNCTION: BETA10 0x100c5093
void LegoPlantManager::Reset(LegoOmni::World p_worldId)
{
MxU32 i;
Expand Down Expand Up @@ -363,6 +364,13 @@ LegoPlantInfo* LegoPlantManager::GetInfo(LegoEntity* p_entity)
return NULL;
}

// FUNCTION: LEGO1 0x100268d0
// FUNCTION: BETA10 0x100c5c7a
MxS32 LegoPlantManager::GetNumPlants()
{
return sizeOfArray(g_plantInfo);
}

// FUNCTION: LEGO1 0x10026920
// FUNCTION: BETA10 0x100c5dc9
MxBool LegoPlantManager::SwitchColor(LegoEntity* p_entity)
Expand Down
Loading

0 comments on commit 499462f

Please sign in to comment.