mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Make NotificationManager::Send take a const reference to notification (#836)
* Make NotificationManager::Send take a const reference to notification * Fix virtual func
This commit is contained in:

committed by
GitHub

parent
0e0d6890ad
commit
f1688be263
@@ -124,7 +124,7 @@ void LegoAnimMMPresenter::EndAction()
|
||||
|
||||
MxType18NotificationParam param(c_notificationType18, NULL, m_animmanId);
|
||||
if (m_animmanId != 0) {
|
||||
NotificationManager()->Send(AnimationManager(), ¶m);
|
||||
NotificationManager()->Send(AnimationManager(), param);
|
||||
}
|
||||
|
||||
if (m_action != NULL) {
|
||||
|
@@ -775,14 +775,7 @@ inline void LoadIsle()
|
||||
LegoWorld* world = FindWorld(*g_isleScript, 0);
|
||||
if (world != NULL) {
|
||||
if (!world->GetUnknown0xd0().empty()) {
|
||||
#ifdef COMPAT_MODE
|
||||
{
|
||||
MxNotificationParam param(c_notificationType20, NULL);
|
||||
NotificationManager()->Send(world, ¶m);
|
||||
}
|
||||
#else
|
||||
NotificationManager()->Send(world, &MxNotificationParam(c_notificationType20, NULL));
|
||||
#endif
|
||||
NotificationManager()->Send(world, MxNotificationParam(c_notificationType20, NULL));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@@ -239,14 +239,7 @@ void NotifyEntity(const char* p_filename, MxS32 p_entityId, LegoEntity* p_sender
|
||||
}
|
||||
|
||||
if (entity != NULL) {
|
||||
#ifdef COMPAT_MODE
|
||||
{
|
||||
MxNotificationParam param(c_notificationType0, p_sender);
|
||||
NotificationManager()->Send(entity, ¶m);
|
||||
}
|
||||
#else
|
||||
NotificationManager()->Send(entity, &MxNotificationParam(c_notificationType0, p_sender));
|
||||
#endif
|
||||
NotificationManager()->Send(entity, MxNotificationParam(c_notificationType0, p_sender));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -66,14 +66,7 @@ LegoWorldPresenter::~LegoWorldPresenter()
|
||||
}
|
||||
|
||||
if (m_entity) {
|
||||
#ifdef COMPAT_MODE
|
||||
{
|
||||
MxNotificationParam param(c_notificationNewPresenter, NULL);
|
||||
NotificationManager()->Send(m_entity, ¶m);
|
||||
}
|
||||
#else
|
||||
NotificationManager()->Send(m_entity, &MxNotificationParam(c_notificationNewPresenter, NULL));
|
||||
#endif
|
||||
NotificationManager()->Send(m_entity, MxNotificationParam(c_notificationNewPresenter, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -678,7 +678,7 @@ MxEntity* LegoOmni::AddToWorld(const char* p_id, MxS32 p_entityId, MxPresenter*
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b3a0
|
||||
void LegoOmni::NotifyCurrentEntity(MxNotificationParam* p_param)
|
||||
void LegoOmni::NotifyCurrentEntity(const MxNotificationParam& p_param)
|
||||
{
|
||||
if (m_currentWorld) {
|
||||
NotificationManager()->Send(m_currentWorld, p_param);
|
||||
|
@@ -509,16 +509,7 @@ void Isle::Enable(MxBool p_enable)
|
||||
switch (GameState()->m_currentArea) {
|
||||
case LegoGameState::e_elevride:
|
||||
m_destLocation = LegoGameState::e_elevride;
|
||||
|
||||
#ifdef COMPAT_MODE
|
||||
{
|
||||
MxNotificationParam param(c_notificationTransitioned, NULL);
|
||||
NotificationManager()->Send(this, ¶m);
|
||||
}
|
||||
#else
|
||||
NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
#endif
|
||||
|
||||
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
SetIsWorldActive(FALSE);
|
||||
break;
|
||||
case LegoGameState::e_jetrace2:
|
||||
@@ -540,30 +531,12 @@ void Isle::Enable(MxBool p_enable)
|
||||
break;
|
||||
case LegoGameState::e_garadoor:
|
||||
m_destLocation = LegoGameState::e_garadoor;
|
||||
|
||||
#ifdef COMPAT_MODE
|
||||
{
|
||||
MxNotificationParam param(c_notificationTransitioned, NULL);
|
||||
NotificationManager()->Send(this, ¶m);
|
||||
}
|
||||
#else
|
||||
NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
#endif
|
||||
|
||||
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
SetIsWorldActive(FALSE);
|
||||
break;
|
||||
case LegoGameState::e_polidoor:
|
||||
m_destLocation = LegoGameState::e_polidoor;
|
||||
|
||||
#ifdef COMPAT_MODE
|
||||
{
|
||||
MxNotificationParam param(c_notificationTransitioned, NULL);
|
||||
NotificationManager()->Send(this, ¶m);
|
||||
}
|
||||
#else
|
||||
NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
#endif
|
||||
|
||||
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
SetIsWorldActive(FALSE);
|
||||
break;
|
||||
case LegoGameState::e_bike:
|
||||
@@ -1012,29 +985,13 @@ void Isle::FUN_10032d30(
|
||||
m_act1state->m_unk0x01f = FALSE;
|
||||
}
|
||||
else {
|
||||
#ifdef COMPAT_MODE
|
||||
{
|
||||
MxNotificationParam param(c_notificationTransitioned, NULL);
|
||||
NotificationManager()->Send(this, ¶m);
|
||||
}
|
||||
#else
|
||||
NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
#endif
|
||||
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
}
|
||||
}
|
||||
else {
|
||||
GameState()->SwitchArea(m_destLocation);
|
||||
GameState()->StopArea(LegoGameState::e_previousArea);
|
||||
|
||||
#ifdef COMPAT_MODE
|
||||
{
|
||||
MxNotificationParam param(c_notificationTransitioned, NULL);
|
||||
NotificationManager()->Send(this, ¶m);
|
||||
}
|
||||
#else
|
||||
NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
#endif
|
||||
|
||||
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
||||
m_act1state->m_unk0x01f = TRUE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user