Implement/match Isle::HandleType19Notification (#952)

* Implement/match Isle::HandleType19Notification

* Fix
This commit is contained in:
Christian Semmler 2024-05-24 21:23:41 -04:00 committed by GitHub
parent 715acd657d
commit 7c9fdd255e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 94 additions and 16 deletions

View file

@ -6,19 +6,20 @@
#include "legoworld.h" #include "legoworld.h"
#include "radio.h" #include "radio.h"
class Pizza; class Act1State;
class Pizzeria;
class TowTrack;
class Ambulance; class Ambulance;
class JukeBoxEntity;
class Helicopter;
class Bike; class Bike;
class DuneBuggy; class DuneBuggy;
class Motocycle; class Helicopter;
class SkateBoard;
class RaceCar;
class Jetski; class Jetski;
class Act1State; class JukeBoxEntity;
class Motocycle;
class MxType19NotificationParam;
class Pizza;
class Pizzeria;
class RaceCar;
class SkateBoard;
class TowTrack;
// VTABLE: LEGO1 0x100d6fb8 // VTABLE: LEGO1 0x100d6fb8
// SIZE 0x140 // SIZE 0x140
@ -71,7 +72,7 @@ class Isle : public LegoWorld {
protected: protected:
MxLong HandleEndAction(MxEndActionNotificationParam& p_param); MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
MxLong HandleClick(LegoControlManagerEvent& p_param); MxLong HandleClick(LegoControlManagerEvent& p_param);
MxLong HandleType19Notification(MxParam& p_param); MxLong HandleType19Notification(MxType19NotificationParam& p_param);
MxLong HandleTransitionEnd(); MxLong HandleTransitionEnd();
void HandleElevatorEndAction(); void HandleElevatorEndAction();
void UpdateGlobe(); void UpdateGlobe();

View file

@ -112,6 +112,7 @@ class LegoAnimationManager : public MxCore {
void FUN_10063780(LegoROIList* p_list); void FUN_10063780(LegoROIList* p_list);
MxResult FUN_10064670(Vector3* p_position); MxResult FUN_10064670(Vector3* p_position);
MxResult FUN_10064740(Vector3* p_position); MxResult FUN_10064740(Vector3* p_position);
MxResult FUN_10064880(const char* p_name, MxS32 p_unk0x0c, MxS32 p_unk0x10);
static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig); static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig);

View file

@ -2411,6 +2411,25 @@ MxResult LegoAnimationManager::FUN_10064740(Vector3* p_position)
return FAILURE; return FAILURE;
} }
// FUNCTION: LEGO1 0x10064880
// FUNCTION: BETA10 0x10045d02
MxResult LegoAnimationManager::FUN_10064880(const char* p_name, MxS32 p_unk0x0c, MxS32 p_unk0x10)
{
for (MxS32 i = 0; i < (MxS32) sizeOfArray(m_extras); i++) {
LegoROI* roi = m_extras[i].m_roi;
if (roi != NULL) {
if (!strcmpi(roi->GetName(), p_name)) {
g_characters[m_extras[i].m_characterId].m_unk0x0c = p_unk0x0c;
g_characters[m_extras[i].m_characterId].m_unk0x10 = p_unk0x10;
return SUCCESS;
}
}
}
return FAILURE;
}
// STUB: LEGO1 0x100648f0 // STUB: LEGO1 0x100648f0
// FUNCTION: BETA10 0x10045daf // FUNCTION: BETA10 0x10045daf
void LegoAnimationManager::FUN_100648f0(LegoTranInfo*, MxLong) void LegoAnimationManager::FUN_100648f0(LegoTranInfo*, MxLong)

View file

@ -29,6 +29,7 @@
#include "mxnotificationmanager.h" #include "mxnotificationmanager.h"
#include "mxstillpresenter.h" #include "mxstillpresenter.h"
#include "mxtransitionmanager.h" #include "mxtransitionmanager.h"
#include "mxtype19notificationparam.h"
#include "mxvariabletable.h" #include "mxvariabletable.h"
#include "pizza.h" #include "pizza.h"
#include "pizzeria.h" #include "pizzeria.h"
@ -158,7 +159,7 @@ MxLong Isle::Notify(MxParam& p_param)
} }
break; break;
case c_notificationType19: case c_notificationType19:
result = HandleType19Notification(p_param); result = HandleType19Notification((MxType19NotificationParam&) p_param);
break; break;
case c_notificationType20: case c_notificationType20:
Enable(TRUE); Enable(TRUE);
@ -458,10 +459,64 @@ void Isle::UpdateGlobe()
} }
} }
// STUB: LEGO1 0x100315f0 // FUNCTION: LEGO1 0x100315f0
MxLong Isle::HandleType19Notification(MxParam& p_param) MxLong Isle::HandleType19Notification(MxType19NotificationParam& p_param)
{ {
return 0; MxLong result = 0;
if (CurrentActor() != NULL) {
if (CurrentActor() == m_dunebuggy) {
result = m_dunebuggy->Notify(p_param);
}
else if (CurrentActor() == m_motocycle) {
result = m_motocycle->Notify(p_param);
}
}
switch (m_act1state->m_unk0x018) {
case 3:
result = m_pizza->Notify(p_param);
break;
case 8:
result = m_towtrack->Notify(p_param);
break;
case 10:
result = m_ambulance->Notify(p_param);
break;
}
if (result == 0) {
switch (p_param.GetUnknown0x0c()) {
case 0x12c:
AnimationManager()->FUN_10064670(NULL);
result = 1;
break;
case 0x12d:
AnimationManager()->FUN_10064880("brickstr", 0, 20000);
result = 1;
break;
case 0x131:
if (m_act1state->m_unk0x018 != 10) {
AnimationManager()->FUN_10064740(FALSE);
}
result = 1;
break;
case 0x132:
AnimationManager()->FUN_10064880("mama", 0, 20000);
AnimationManager()->FUN_10064880("papa", 0, 20000);
result = 1;
break;
case 0x136:
LegoEntity* bouy = (LegoEntity*) Find("MxEntity", "bouybump");
if (bouy != NULL) {
NotificationManager()->Send(bouy, LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
}
result = 1;
break;
}
}
return result;
} }
// FUNCTION: LEGO1 0x10031820 // FUNCTION: LEGO1 0x10031820

View file

@ -8,7 +8,7 @@
// SIZE 0x10 // SIZE 0x10
class MxType19NotificationParam : public MxNotificationParam { class MxType19NotificationParam : public MxNotificationParam {
public: public:
MxType19NotificationParam(NotificationId p_type, MxCore* p_sender, MxU8 p_unk0x0e, MxU16 p_unk0x0c) MxType19NotificationParam(NotificationId p_type, MxCore* p_sender, MxU8 p_unk0x0e, MxS16 p_unk0x0c)
: MxNotificationParam() : MxNotificationParam()
{ {
m_type = p_type; m_type = p_type;
@ -23,8 +23,10 @@ class MxType19NotificationParam : public MxNotificationParam {
return new MxType19NotificationParam(m_type, m_sender, m_unk0x0e, m_unk0x0c); return new MxType19NotificationParam(m_type, m_sender, m_unk0x0e, m_unk0x0c);
} // vtable+0x04 } // vtable+0x04
inline MxS16 GetUnknown0x0c() { return m_unk0x0c; }
protected: protected:
MxU16 m_unk0x0c; // 0x0c MxS16 m_unk0x0c; // 0x0c
MxU8 m_unk0x0e; // 0x0e MxU8 m_unk0x0e; // 0x0e
}; };