mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-25 09:24:17 +00:00
Implement/match Ambulance::HandlePathStruct (#1029)
* Implement/match Ambulance::HandlePathStruct * Add annotation
This commit is contained in:
committed by
GitHub
parent
cf7246ac6c
commit
bbc304ce46
@@ -8,6 +8,7 @@
|
||||
#include "legocontrolmanager.h"
|
||||
#include "legogamestate.h"
|
||||
#include "legonavcontroller.h"
|
||||
#include "legopathstruct.h"
|
||||
#include "legoutils.h"
|
||||
#include "legovariables.h"
|
||||
#include "legoworld.h"
|
||||
@@ -31,7 +32,7 @@ Ambulance::Ambulance()
|
||||
m_maxLinearVel = 40.0;
|
||||
m_state = NULL;
|
||||
m_unk0x168 = 0;
|
||||
m_unk0x16a = -1;
|
||||
m_actorId = -1;
|
||||
m_unk0x16c = 0;
|
||||
m_unk0x16e = 0;
|
||||
m_unk0x170 = 0;
|
||||
@@ -126,7 +127,7 @@ MxLong Ambulance::Notify(MxParam& p_param)
|
||||
{
|
||||
MxLong result = 0;
|
||||
|
||||
switch (((MxNotificationParam&) p_param).GetType()) {
|
||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||
case c_notificationType0:
|
||||
result = HandleNotification0();
|
||||
break;
|
||||
@@ -142,8 +143,8 @@ MxLong Ambulance::Notify(MxParam& p_param)
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
break;
|
||||
case c_notificationType19:
|
||||
result = HandleNotification19((MxType19NotificationParam&) p_param);
|
||||
case c_notificationPathStruct:
|
||||
result = HandlePathStruct((LegoPathStructEvent&) p_param);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -259,10 +260,103 @@ MxLong Ambulance::HandleButtonDown(LegoControlManagerEvent& p_param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10036860
|
||||
MxLong Ambulance::HandleNotification19(MxType19NotificationParam& p_param)
|
||||
// FUNCTION: LEGO1 0x10036860
|
||||
// FUNCTION: BETA10 0x100231bf
|
||||
MxLong Ambulance::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
{
|
||||
// TODO
|
||||
// 0x168 corresponds to the path at the gas station
|
||||
if (p_param.GetData() == 0x168) {
|
||||
m_fuel = 1.0f;
|
||||
}
|
||||
|
||||
if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && p_param.GetData() == 0x0b) {
|
||||
if (m_unk0x16e != 0) {
|
||||
if (m_unk0x16c != 0) {
|
||||
m_state->m_unk0x08 = 2;
|
||||
|
||||
if (m_lastAction != IsleScript::c_noneIsle) {
|
||||
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
|
||||
}
|
||||
|
||||
FUN_10036ec0();
|
||||
MxLong time = Timer()->GetTime() - m_state->m_unk0x0c;
|
||||
|
||||
if (time < 300000) {
|
||||
m_state->UpdateScore(LegoState::e_red, m_actorId);
|
||||
PlayFinalAnimation(IsleScript::c_hho142cl_RunAnim);
|
||||
}
|
||||
else if (time < 400000) {
|
||||
m_state->UpdateScore(LegoState::e_blue, m_actorId);
|
||||
PlayFinalAnimation(IsleScript::c_hho143cl_RunAnim);
|
||||
}
|
||||
else {
|
||||
m_state->UpdateScore(LegoState::e_yellow, m_actorId);
|
||||
PlayFinalAnimation(IsleScript::c_hho144cl_RunAnim);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (m_unk0x16e != 0) {
|
||||
if (m_lastAction != IsleScript::c_noneIsle) {
|
||||
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
|
||||
}
|
||||
|
||||
PlayAction(IsleScript::c_Avo915In_PlayWav);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_unk0x16c != 0) {
|
||||
if (m_lastAction != IsleScript::c_noneIsle) {
|
||||
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
|
||||
}
|
||||
|
||||
PlayAction(IsleScript::c_Avo915In_PlayWav);
|
||||
}
|
||||
}
|
||||
else if (p_param.GetTrigger() == LegoPathStruct::c_s && p_param.GetData() == 0x131 && m_unk0x16e == 0) {
|
||||
m_unk0x16e = 1;
|
||||
m_unk0x170 = 1;
|
||||
|
||||
if (m_lastAction != IsleScript::c_noneIsle) {
|
||||
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
|
||||
}
|
||||
|
||||
FUN_10036ec0();
|
||||
|
||||
if (m_actorId < LegoActor::c_pepper || m_actorId > LegoActor::c_laura) {
|
||||
m_actorId = LegoActor::c_laura;
|
||||
}
|
||||
|
||||
switch (m_actorId) {
|
||||
case c_pepper:
|
||||
PlayAnimation(IsleScript::c_hpz049bd_RunAnim);
|
||||
break;
|
||||
case c_mama:
|
||||
PlayAnimation(IsleScript::c_hpz047pe_RunAnim);
|
||||
break;
|
||||
case c_papa:
|
||||
PlayAnimation(IsleScript::c_hpz050bd_RunAnim);
|
||||
break;
|
||||
case c_nick:
|
||||
case c_laura:
|
||||
PlayAnimation(IsleScript::c_hpz048pe_RunAnim);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && (p_param.GetData() == 0x22 || p_param.GetData() == 0x23 || p_param.GetData() == 0x24) && m_unk0x16c == 0) {
|
||||
m_unk0x16c = 1;
|
||||
m_unk0x170 = 1;
|
||||
|
||||
if (m_lastAction != IsleScript::c_noneIsle) {
|
||||
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
|
||||
}
|
||||
|
||||
FUN_10036ec0();
|
||||
PlayAnimation(IsleScript::c_hps116bd_RunAnim);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -287,7 +381,7 @@ MxLong Ambulance::HandleClick()
|
||||
}
|
||||
|
||||
m_time = Timer()->GetTime();
|
||||
m_unk0x16a = UserActor()->GetActorId();
|
||||
m_actorId = UserActor()->GetActorId();
|
||||
|
||||
Enter();
|
||||
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_AmbulanceDashboard, NULL);
|
||||
@@ -318,6 +412,12 @@ void Ambulance::Exit()
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10036ec0
|
||||
void Ambulance::FUN_10036ec0()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10036f90
|
||||
MxLong Ambulance::HandleControl(LegoControlManagerEvent& p_param)
|
||||
{
|
||||
@@ -447,6 +547,14 @@ void Ambulance::PlayAnimation(IsleScript::Script p_objectId)
|
||||
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);
|
||||
m_lastAnimation = p_objectId;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10037340
|
||||
void Ambulance::StopAction(IsleScript::Script p_objectId)
|
||||
{
|
||||
@@ -469,18 +577,18 @@ void Ambulance::PlayAction(IsleScript::Script p_objectId)
|
||||
// FUNCTION: LEGO1 0x100373a0
|
||||
AmbulanceMissionState::AmbulanceMissionState()
|
||||
{
|
||||
m_unk0x10 = 0;
|
||||
m_unk0x12 = 0;
|
||||
m_unk0x14 = 0;
|
||||
m_unk0x08 = 0;
|
||||
m_unk0x16 = 0;
|
||||
m_unk0x0c = 0;
|
||||
m_unk0x18 = 0;
|
||||
m_score1 = 0;
|
||||
m_score2 = 0;
|
||||
m_score3 = 0;
|
||||
m_score4 = 0;
|
||||
m_score5 = 0;
|
||||
m_peScore = 0;
|
||||
m_maScore = 0;
|
||||
m_paScore = 0;
|
||||
m_niScore = 0;
|
||||
m_laScore = 0;
|
||||
m_peHighScore = 0;
|
||||
m_maHighScore = 0;
|
||||
m_paHighScore = 0;
|
||||
m_niHighScore = 0;
|
||||
m_laHighScore = 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10037440
|
||||
|
||||
@@ -21,7 +21,7 @@ BuildingEntity::~BuildingEntity()
|
||||
// FUNCTION: LEGO1 0x100150a0
|
||||
MxLong BuildingEntity::Notify(MxParam& p_param)
|
||||
{
|
||||
if (((MxNotificationParam&) p_param).GetType() == c_notificationClick) {
|
||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationClick) {
|
||||
return HandleClick((LegoEventNotificationParam&) p_param);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ MxLong DuneBuggy::HandleControl(LegoControlManagerEvent& p_param)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10068270
|
||||
MxLong DuneBuggy::HandleNotification19(MxType19NotificationParam& p_param)
|
||||
MxLong DuneBuggy::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
||||
@@ -48,7 +48,7 @@ MxLong IsleActor::Notify(MxParam& p_param)
|
||||
case c_notificationEndAnim:
|
||||
result = VTable0x70();
|
||||
break;
|
||||
case c_notificationType19:
|
||||
case c_notificationPathStruct:
|
||||
result = VTable0x80(p_param);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -48,27 +48,27 @@ void IslePathActor::Destroy(MxBool p_fromDestructor)
|
||||
// FUNCTION: LEGO1 0x1001a2c0
|
||||
MxLong IslePathActor::Notify(MxParam& p_param)
|
||||
{
|
||||
MxLong ret = 0;
|
||||
MxLong result = 0;
|
||||
|
||||
switch (((MxNotificationParam&) p_param).GetType()) {
|
||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||
case c_notificationType0:
|
||||
ret = HandleNotification0();
|
||||
result = HandleNotification0();
|
||||
break;
|
||||
case c_notificationClick:
|
||||
ret = HandleClick();
|
||||
result = HandleClick();
|
||||
break;
|
||||
case c_notificationControl:
|
||||
ret = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
break;
|
||||
case c_notificationEndAnim:
|
||||
ret = HandleEndAnim((LegoEndAnimNotificationParam&) p_param);
|
||||
result = HandleEndAnim((LegoEndAnimNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationType19:
|
||||
ret = HandleNotification19((MxType19NotificationParam&) p_param);
|
||||
case c_notificationPathStruct:
|
||||
result = HandlePathStruct((LegoPathStructEvent&) p_param);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001a350
|
||||
|
||||
@@ -32,7 +32,7 @@ JukeBoxEntity::~JukeBoxEntity()
|
||||
// FUNCTION: LEGO1 0x10085e40
|
||||
MxLong JukeBoxEntity::Notify(MxParam& p_param)
|
||||
{
|
||||
if (((MxNotificationParam&) p_param).GetType() == c_notificationClick) {
|
||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationClick) {
|
||||
if (!FUN_1003ef60()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ MxLong Motocycle::HandleControl(LegoControlManagerEvent& p_param)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10035df0
|
||||
MxLong Motocycle::HandleNotification19(MxType19NotificationParam& p_param)
|
||||
MxLong Motocycle::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
||||
@@ -86,7 +86,7 @@ MxLong Radio::Notify(MxParam& p_param)
|
||||
MxLong result = 0;
|
||||
|
||||
if (m_unk0x0c) {
|
||||
switch (((MxNotificationParam&) p_param).GetType()) {
|
||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||
case c_notificationEndAction:
|
||||
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
||||
break;
|
||||
|
||||
@@ -89,7 +89,7 @@ MxLong TowTrack::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004d330
|
||||
MxLong TowTrack::HandleNotification19(MxType19NotificationParam& p_param)
|
||||
MxLong TowTrack::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
||||
@@ -1366,11 +1366,11 @@ LegoTranInfo* LegoAnimationManager::GetTranInfo(MxU32 p_index)
|
||||
MxLong LegoAnimationManager::Notify(MxParam& p_param)
|
||||
{
|
||||
if (((MxNotificationParam&) p_param).GetSender() == this) {
|
||||
if (((MxNotificationParam&) p_param).GetType() == c_notificationEndAnim) {
|
||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationEndAnim) {
|
||||
FUN_100605e0(m_unk0x18, TRUE, NULL, TRUE, NULL, FALSE, TRUE, TRUE, TRUE);
|
||||
}
|
||||
}
|
||||
else if (((MxNotificationParam&) p_param).GetType() == c_notificationEndAnim && m_tranInfoList != NULL) {
|
||||
else if (((MxNotificationParam&) p_param).GetNotification() == c_notificationEndAnim && m_tranInfoList != NULL) {
|
||||
LegoTranInfoListCursor cursor(m_tranInfoList);
|
||||
LegoTranInfo* tranInfo;
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ MxLong LegoAnimMMPresenter::Notify(MxParam& p_param)
|
||||
{
|
||||
AUTOLOCK(m_criticalSection);
|
||||
|
||||
if (((MxNotificationParam&) p_param).GetType() == c_notificationEndAction &&
|
||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationEndAction &&
|
||||
((MxNotificationParam&) p_param).GetSender() == m_presenter) {
|
||||
m_presenter = NULL;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "legoinputmanager.h"
|
||||
#include "legomain.h"
|
||||
#include "legonamedtexture.h"
|
||||
#include "legopathstruct.h"
|
||||
#include "legosoundmanager.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "legoworld.h"
|
||||
@@ -20,7 +21,6 @@
|
||||
#include "mxmisc.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxstreamer.h"
|
||||
#include "mxtype19notificationparam.h"
|
||||
#include "mxtypes.h"
|
||||
#include "mxutilities.h"
|
||||
#include "mxvariabletable.h"
|
||||
@@ -367,7 +367,7 @@ void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBo
|
||||
MxLong result = 0;
|
||||
|
||||
if (world != NULL) {
|
||||
MxType19NotificationParam param(c_notificationType19, p_actor, 0x43, p_location);
|
||||
LegoPathStructEvent param(c_notificationPathStruct, p_actor, LegoPathStruct::c_camAnim, p_location);
|
||||
result = world->Notify(param);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,13 +178,13 @@ MxBool MxControlPresenter::FUN_10044270(MxS32 p_x, MxS32 p_y, MxVideoPresenter*
|
||||
MxBool MxControlPresenter::FUN_10044480(LegoControlManagerEvent* p_event, MxPresenter* p_presenter)
|
||||
{
|
||||
if (IsEnabled()) {
|
||||
switch (p_event->GetType()) {
|
||||
switch (p_event->GetNotification()) {
|
||||
case c_notificationButtonUp:
|
||||
if (m_unk0x4c == 0 || m_unk0x4c == 2 || m_unk0x4c == 3) {
|
||||
p_event->SetClickedObjectId(m_action->GetObjectId());
|
||||
p_event->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
||||
VTable0x6c(0);
|
||||
p_event->SetType(c_notificationControl);
|
||||
p_event->SetNotification(c_notificationControl);
|
||||
p_event->SetUnknown0x28(m_unk0x4e);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ MxBool MxControlPresenter::FUN_10044480(LegoControlManagerEvent* p_event, MxPres
|
||||
p_event->SetClickedObjectId(m_action->GetObjectId());
|
||||
p_event->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
||||
VTable0x6c(m_unk0x56);
|
||||
p_event->SetType(c_notificationControl);
|
||||
p_event->SetNotification(c_notificationControl);
|
||||
p_event->SetUnknown0x28(m_unk0x4e);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -58,15 +58,16 @@ MxBool LegoControlManager::FUN_10029210(LegoEventNotificationParam& p_param, MxP
|
||||
if (m_presenterList != NULL && m_presenterList->GetCount() != 0) {
|
||||
m_unk0x14 = p_presenter;
|
||||
|
||||
if (p_param.GetType() == c_notificationButtonUp || p_param.GetType() == c_notificationButtonDown) {
|
||||
m_event.SetType(p_param.GetType());
|
||||
if (p_param.GetNotification() == c_notificationButtonUp ||
|
||||
p_param.GetNotification() == c_notificationButtonDown) {
|
||||
m_event.SetNotification(p_param.GetNotification());
|
||||
m_event.SetSender(p_param.GetSender());
|
||||
m_event.SetModifier(p_param.GetModifier());
|
||||
m_event.SetX(p_param.GetX());
|
||||
m_event.SetY(p_param.GetY());
|
||||
m_event.SetKey(p_param.GetKey());
|
||||
|
||||
if (p_param.GetType() == c_notificationButtonUp) {
|
||||
if (p_param.GetNotification() == c_notificationButtonUp) {
|
||||
if (m_unk0x10 == TRUE) {
|
||||
m_unk0x10 = FALSE;
|
||||
return TRUE;
|
||||
@@ -82,7 +83,7 @@ MxBool LegoControlManager::FUN_10029210(LegoEventNotificationParam& p_param, MxP
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (p_param.GetType() == c_notificationButtonDown) {
|
||||
else if (p_param.GetNotification() == c_notificationButtonDown) {
|
||||
if (m_unk0x0c == 1) {
|
||||
m_unk0x10 = TRUE;
|
||||
return TRUE;
|
||||
@@ -163,7 +164,7 @@ MxControlPresenter* LegoControlManager::FUN_100294e0(MxS32 p_x, MxS32 p_y)
|
||||
MxResult LegoControlManager::Tickle()
|
||||
{
|
||||
if (m_unk0x08 == 2 && m_unk0x0c == 1) {
|
||||
m_event.SetType(c_notificationButtonUp);
|
||||
m_event.SetNotification(c_notificationButtonUp);
|
||||
FUN_10029750();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ DECOMP_SIZE_ASSERT(Act2PoliceStation, 0x68)
|
||||
// FUNCTION: LEGO1 0x1004e0e0
|
||||
MxLong Act2PoliceStation::Notify(MxParam& p_param)
|
||||
{
|
||||
if (((MxNotificationParam&) p_param).GetType() == c_notificationClick) {
|
||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationClick) {
|
||||
MxNotificationParam param(c_notificationType23, NULL);
|
||||
NotificationManager()->Send(CurrentWorld(), param);
|
||||
return 1;
|
||||
|
||||
@@ -602,7 +602,7 @@ MxResult LegoNavController::ProcessKeyboardInput()
|
||||
// STUB: LEGO1 0x10055a60
|
||||
MxLong LegoNavController::Notify(MxParam& p_param)
|
||||
{
|
||||
if (((MxNotificationParam&) p_param).GetType() == c_notificationKeyPress) {
|
||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationKeyPress) {
|
||||
m_unk0x5d = TRUE;
|
||||
|
||||
switch (((LegoEventNotificationParam&) p_param).GetKey()) {
|
||||
|
||||
@@ -345,7 +345,7 @@ void LegoInputManager::QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p
|
||||
{
|
||||
LegoEventNotificationParam param = LegoEventNotificationParam(p_id, NULL, p_modifier, p_x, p_y, p_key);
|
||||
|
||||
if (((!m_unk0x88) || ((m_unk0x335 && (param.GetType() == c_notificationButtonDown)))) ||
|
||||
if (((!m_unk0x88) || ((m_unk0x335 && (param.GetNotification() == c_notificationButtonDown)))) ||
|
||||
((m_unk0x336 && (p_key == VK_SPACE)))) {
|
||||
ProcessOneEvent(param);
|
||||
}
|
||||
@@ -369,12 +369,12 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
|
||||
{
|
||||
MxBool processRoi;
|
||||
|
||||
if (p_param.GetType() == c_notificationKeyPress) {
|
||||
if (p_param.GetNotification() == c_notificationKeyPress) {
|
||||
if (!Lego()->IsPaused() || p_param.GetKey() == VK_PAUSE) {
|
||||
if (p_param.GetKey() == VK_SHIFT) {
|
||||
if (m_unk0x195) {
|
||||
m_unk0x80 = FALSE;
|
||||
p_param.SetType(c_notificationDrag);
|
||||
p_param.SetNotification(c_notificationDrag);
|
||||
|
||||
if (m_camera) {
|
||||
m_camera->Notify(p_param);
|
||||
@@ -400,7 +400,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
|
||||
processRoi = TRUE;
|
||||
|
||||
if (m_unk0x335 != 0) {
|
||||
if (p_param.GetType() == c_notificationButtonDown) {
|
||||
if (p_param.GetNotification() == c_notificationButtonDown) {
|
||||
LegoEventNotificationParam notification(c_notificationKeyPress, NULL, 0, 0, 0, VK_SPACE);
|
||||
LegoNotifyListCursor cursor(m_keyboardNotifyList);
|
||||
MxCore* target;
|
||||
@@ -415,7 +415,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (m_unk0x195 && p_param.GetType() == c_notificationButtonDown) {
|
||||
if (m_unk0x195 && p_param.GetNotification() == c_notificationButtonDown) {
|
||||
m_unk0x195 = 0;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -424,7 +424,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (p_param.GetType() == c_notificationButtonDown) {
|
||||
if (p_param.GetNotification() == c_notificationButtonDown) {
|
||||
MxPresenter* presenter = VideoManager()->GetPresenterAt(p_param.GetX(), p_param.GetY());
|
||||
|
||||
if (presenter) {
|
||||
@@ -444,7 +444,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (p_param.GetType() == c_notificationButtonUp) {
|
||||
else if (p_param.GetNotification() == c_notificationButtonUp) {
|
||||
if (g_unk0x100f31b0 != -1 || m_controlManager->GetUnknown0x10() ||
|
||||
m_controlManager->GetUnknown0x0c() == 1) {
|
||||
MxBool result = m_controlManager->FUN_10029210(p_param, NULL);
|
||||
@@ -457,7 +457,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
|
||||
}
|
||||
|
||||
if (FUN_1005cdf0(p_param)) {
|
||||
if (processRoi && p_param.GetType() == c_notificationClick) {
|
||||
if (processRoi && p_param.GetNotification() == c_notificationClick) {
|
||||
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
|
||||
p_param.SetROI(roi);
|
||||
|
||||
@@ -493,13 +493,13 @@ MxBool LegoInputManager::FUN_1005cdf0(LegoEventNotificationParam& p_param)
|
||||
StopAutoDragTimer();
|
||||
|
||||
if (m_unk0x80) {
|
||||
p_param.SetType(c_notificationDrag);
|
||||
p_param.SetNotification(c_notificationDrag);
|
||||
result = TRUE;
|
||||
}
|
||||
else if (m_unk0x81) {
|
||||
p_param.SetX(m_x);
|
||||
p_param.SetY(m_y);
|
||||
p_param.SetType(c_notificationClick);
|
||||
p_param.SetNotification(c_notificationClick);
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
@@ -531,14 +531,14 @@ MxBool LegoInputManager::FUN_1005cdf0(LegoEventNotificationParam& p_param)
|
||||
if (m_unk0x195 || (diffX * diffX) + (diffY * diffY) > m_unk0x74) {
|
||||
StopAutoDragTimer();
|
||||
m_unk0x80 = TRUE;
|
||||
p_param.SetType(c_notificationDragEnd);
|
||||
p_param.SetNotification(c_notificationDragEnd);
|
||||
result = TRUE;
|
||||
p_param.SetX(m_x);
|
||||
p_param.SetY(m_y);
|
||||
}
|
||||
}
|
||||
else {
|
||||
p_param.SetType(c_notificationDragStart);
|
||||
p_param.SetNotification(c_notificationDragStart);
|
||||
result = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -552,7 +552,7 @@ MxBool LegoInputManager::FUN_1005cdf0(LegoEventNotificationParam& p_param)
|
||||
p_param.SetX(m_x);
|
||||
p_param.SetY(m_y);
|
||||
p_param.SetModifier(LegoEventNotificationParam::c_lButtonState);
|
||||
p_param.SetType(c_notificationDragEnd);
|
||||
p_param.SetNotification(c_notificationDragEnd);
|
||||
result = TRUE;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -564,7 +564,7 @@ MxLong LegoOmni::Notify(MxParam& p_param)
|
||||
{
|
||||
MxBool isCD = FALSE;
|
||||
|
||||
if (((MxNotificationParam&) p_param).GetType() == c_notificationEndAction &&
|
||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationEndAction &&
|
||||
((MxActionNotificationParam&) p_param).GetAction()->GetAtomId() == *g_nocdSourceName) {
|
||||
isCD = TRUE;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "mxbackgroundaudiomanager.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxtype19notificationparam.h"
|
||||
#include "scripts.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoPathStructBase, 0x0c)
|
||||
@@ -52,7 +51,7 @@ MxBool LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction,
|
||||
case c_d: {
|
||||
p_actor->VTable0x58(p_data);
|
||||
|
||||
MxType19NotificationParam param(c_notificationType19, p_actor, m_name[2], p_data);
|
||||
LegoPathStructEvent param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
p_actor->Notify(param);
|
||||
|
||||
LegoWorld* world = CurrentWorld();
|
||||
@@ -68,7 +67,6 @@ MxBool LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction,
|
||||
break;
|
||||
case c_h: {
|
||||
LegoHideAnimPresenter* presenter = m_world->GetHideAnimPresenter();
|
||||
|
||||
if (presenter != NULL) {
|
||||
presenter->FUN_1006db40(p_data * 100);
|
||||
}
|
||||
@@ -82,7 +80,7 @@ MxBool LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction,
|
||||
case c_s: {
|
||||
LegoWorld* world = CurrentWorld();
|
||||
if (world != NULL) {
|
||||
MxType19NotificationParam param(c_notificationType19, p_actor, m_name[2], p_data);
|
||||
LegoPathStructEvent param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
|
||||
if (world->Notify(param) != 0) {
|
||||
break;
|
||||
@@ -95,7 +93,7 @@ MxBool LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction,
|
||||
case c_w: {
|
||||
LegoWorld* world = CurrentWorld();
|
||||
if (world != NULL) {
|
||||
MxType19NotificationParam param(c_notificationType19, p_actor, m_name[2], p_data);
|
||||
LegoPathStructEvent param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
NotificationManager()->Send(world, param);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -32,7 +32,7 @@ MxLong CarRace::HandleEndAction(MxEndActionNotificationParam&)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100170e0
|
||||
MxLong CarRace::HandleType19Notification(MxType19NotificationParam&)
|
||||
MxLong CarRace::HandlePathStruct(LegoPathStructEvent&)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
||||
@@ -26,7 +26,7 @@ MxLong JetskiRace::HandleClick(LegoEventNotificationParam&)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100166a0
|
||||
MxLong JetskiRace::HandleType19Notification(MxType19NotificationParam&)
|
||||
MxLong JetskiRace::HandlePathStruct(LegoPathStructEvent&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ LegoRace::LegoRace()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10015b70
|
||||
MxLong LegoRace::HandleType19Notification(MxType19NotificationParam&)
|
||||
MxLong LegoRace::HandlePathStruct(LegoPathStructEvent&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -101,8 +101,8 @@ MxLong LegoRace::Notify(MxParam& p_param)
|
||||
case c_notificationClick:
|
||||
result = HandleClick((LegoEventNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationType19:
|
||||
result = HandleType19Notification((MxType19NotificationParam&) p_param);
|
||||
case c_notificationPathStruct:
|
||||
result = HandlePathStruct((LegoPathStructEvent&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
GameState()->SwitchArea(m_destLocation);
|
||||
|
||||
@@ -58,7 +58,7 @@ MxLong ElevatorBottom::Notify(MxParam& p_param)
|
||||
LegoWorld::Notify(p_param);
|
||||
|
||||
if (m_worldStarted) {
|
||||
switch (((MxNotificationParam&) p_param).GetType()) {
|
||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||
case c_notificationControl:
|
||||
ret = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
break;
|
||||
|
||||
@@ -61,7 +61,7 @@ MxLong InfocenterDoor::Notify(MxParam& p_param)
|
||||
LegoWorld::Notify(p_param);
|
||||
|
||||
if (m_worldStarted) {
|
||||
switch (((MxNotificationParam&) p_param).GetType()) {
|
||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||
case c_notificationEndAction:
|
||||
if (((MxEndActionNotificationParam&) p_param).GetAction()->GetAtomId() == m_atom) {
|
||||
BackgroundAudioManager()->RaiseVolume();
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "legoinputmanager.h"
|
||||
#include "legomain.h"
|
||||
#include "legonamedtexture.h"
|
||||
#include "legopathstruct.h"
|
||||
#include "legoutils.h"
|
||||
#include "legovariables.h"
|
||||
#include "legovideomanager.h"
|
||||
@@ -29,7 +30,6 @@
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxstillpresenter.h"
|
||||
#include "mxtransitionmanager.h"
|
||||
#include "mxtype19notificationparam.h"
|
||||
#include "mxvariabletable.h"
|
||||
#include "pizza.h"
|
||||
#include "pizzeria.h"
|
||||
@@ -167,8 +167,8 @@ MxLong Isle::Notify(MxParam& p_param)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case c_notificationType19:
|
||||
result = HandleType19Notification((MxType19NotificationParam&) p_param);
|
||||
case c_notificationPathStruct:
|
||||
result = HandlePathStruct((LegoPathStructEvent&) p_param);
|
||||
break;
|
||||
case c_notificationType20:
|
||||
Enable(TRUE);
|
||||
@@ -469,7 +469,7 @@ void Isle::UpdateGlobe()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100315f0
|
||||
MxLong Isle::HandleType19Notification(MxType19NotificationParam& p_param)
|
||||
MxLong Isle::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
{
|
||||
MxLong result = 0;
|
||||
|
||||
@@ -495,7 +495,8 @@ MxLong Isle::HandleType19Notification(MxType19NotificationParam& p_param)
|
||||
}
|
||||
|
||||
if (result == 0) {
|
||||
switch (p_param.GetUnknown0x0c()) {
|
||||
// These values correspond to certain paths on the island
|
||||
switch (p_param.GetData()) {
|
||||
case 0x12c:
|
||||
AnimationManager()->FUN_10064670(NULL);
|
||||
result = 1;
|
||||
|
||||
@@ -103,7 +103,7 @@ MxLong RegistrationBook::Notify(MxParam& p_param)
|
||||
LegoWorld::Notify(p_param);
|
||||
|
||||
if (m_worldStarted) {
|
||||
switch (((MxNotificationParam&) p_param).GetType()) {
|
||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||
case c_notificationEndAction:
|
||||
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
||||
break;
|
||||
@@ -117,7 +117,7 @@ MxLong RegistrationBook::Notify(MxParam& p_param)
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
break;
|
||||
case c_notificationType19:
|
||||
case c_notificationPathStruct:
|
||||
result = HandleNotification19(p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
|
||||
@@ -266,21 +266,21 @@ void Score::Paint()
|
||||
m_surface = (MxU8*) desc.lpSurface;
|
||||
|
||||
for (MxU8 actor = 1; actor <= 5; actor++) {
|
||||
MxU16 score;
|
||||
MxS16 score;
|
||||
|
||||
score = carRaceState ? carRaceState->GetState(actor)->GetScore() : 0;
|
||||
score = carRaceState ? carRaceState->GetState(actor)->GetHighScore() : 0;
|
||||
FillArea(0, actor - 1, score);
|
||||
|
||||
score = jetskiRaceState ? jetskiRaceState->GetState(actor)->GetScore() : 0;
|
||||
score = jetskiRaceState ? jetskiRaceState->GetState(actor)->GetHighScore() : 0;
|
||||
FillArea(1, actor - 1, score);
|
||||
|
||||
score = pizzaMissionState ? pizzaMissionState->GetScore(actor) : 0;
|
||||
score = pizzaMissionState ? pizzaMissionState->GetHighScore(actor) : 0;
|
||||
FillArea(2, actor - 1, score);
|
||||
|
||||
score = towTrackMissionState ? towTrackMissionState->GetScore(actor) : 0;
|
||||
score = towTrackMissionState ? towTrackMissionState->GetHighScore(actor) : 0;
|
||||
FillArea(3, actor - 1, score);
|
||||
|
||||
score = ambulanceMissionState ? ambulanceMissionState->GetScore(actor) : 0;
|
||||
score = ambulanceMissionState ? ambulanceMissionState->GetHighScore(actor) : 0;
|
||||
FillArea(4, actor - 1, score);
|
||||
}
|
||||
|
||||
@@ -299,14 +299,14 @@ void Score::FillArea(MxU32 i_activity, MxU32 i_actor, MxS16 score)
|
||||
MxS32 local14[] = {0x2a, 0x27, 0x29, 0x29, 0x2a};
|
||||
MxS32 local50[] = {0x2f, 0x56, 0x81, 0xaa, 0xd4};
|
||||
MxS32 local28[] = {0x25, 0x29, 0x27, 0x28, 0x28};
|
||||
MxS32 local60[] = {0x11, 0x0f, 0x08, 0x05};
|
||||
MxS32 colors[] = {0x11, 0x0f, 0x08, 0x05};
|
||||
|
||||
MxU8* ptr = m_surface + local3c[i_actor] + local50[i_activity];
|
||||
MxS32 val = local60[score];
|
||||
MxS32 color = colors[score];
|
||||
MxS32 size = local28[i_activity];
|
||||
|
||||
for (MxS32 i = 0; i < local14[i_actor]; i++) {
|
||||
memset(ptr, val, size);
|
||||
memset(ptr, color, size);
|
||||
ptr += 0x100;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user