mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Use COMPAT_MODE macro to fix errors with mingw gcc 12.2
This commit is contained in:
parent
dc3500f631
commit
f33372a539
@ -132,9 +132,15 @@ BOOL IsleApp::SetupLegoOmni()
|
||||
char mediaPath[256];
|
||||
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
|
||||
|
||||
#ifdef COMPAT_MODE
|
||||
MxOmniCreateParam param(mediaPath, (struct HWND__*) m_windowHandle, m_videoParam, MxOmniCreateFlags());
|
||||
BOOL failure = Lego()->Create(param) == FAILURE;
|
||||
#else
|
||||
BOOL failure =
|
||||
Lego()->Create(MxOmniCreateParam(mediaPath, (struct HWND__*) m_windowHandle, m_videoParam, MxOmniCreateFlags())
|
||||
) == FAILURE;
|
||||
#endif
|
||||
|
||||
if (!failure) {
|
||||
VariableTable()->SetVariable("ACTOR_01", "");
|
||||
TickleManager()->SetClientTickleInterval(VideoManager(), 10);
|
||||
|
||||
@ -36,7 +36,12 @@ void MxAtomId::Destroy()
|
||||
|
||||
// The dtor is called on the counter object immediately,
|
||||
// so this syntax should be correct.
|
||||
#ifdef COMPAT_MODE
|
||||
MxAtomIdCounter id_counter(m_internal);
|
||||
MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&id_counter);
|
||||
#else
|
||||
MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&MxAtomIdCounter(m_internal));
|
||||
#endif
|
||||
|
||||
MxAtomIdCounter* counter = (MxAtomIdCounter*) (*it);
|
||||
counter->Dec();
|
||||
|
||||
@ -97,10 +97,18 @@ void MxCompositePresenter::EndAction()
|
||||
MxPresenter::EndAction();
|
||||
|
||||
if (action && action->GetOrigin()) {
|
||||
#ifdef COMPAT_MODE
|
||||
MxEndActionNotificationParam param(c_notificationEndAction, this, action, FALSE);
|
||||
NotificationManager()->Send(
|
||||
action->GetOrigin(),
|
||||
¶m
|
||||
);
|
||||
#else
|
||||
NotificationManager()->Send(
|
||||
action->GetOrigin(),
|
||||
&MxEndActionNotificationParam(c_notificationEndAction, this, action, FALSE)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -23,8 +23,14 @@ MxDiskStreamController::~MxDiskStreamController()
|
||||
m_unk0xc4 = FALSE;
|
||||
m_unk0x70 = FALSE;
|
||||
|
||||
if (m_provider)
|
||||
if (m_provider) {
|
||||
#ifdef COMPAT_MODE
|
||||
MxDSAction action;
|
||||
m_provider->VTable0x20(&action);
|
||||
#else
|
||||
m_provider->VTable0x20(&MxDSAction());
|
||||
#endif
|
||||
}
|
||||
|
||||
MxDSAction* action;
|
||||
while (m_unk0x3c.PopFront(action))
|
||||
@ -299,9 +305,16 @@ MxResult MxDiskStreamController::VTable0x24(MxDSAction* p_action)
|
||||
MxAutoLocker lock(&this->m_criticalSection);
|
||||
if (m_unk0x54.Find(p_action, FALSE) == NULL) {
|
||||
if (VTable0x30(p_action) == SUCCESS) {
|
||||
#ifdef COMPAT_MODE
|
||||
MxEndActionNotificationParam param(c_notificationEndAction, NULL, p_action, TRUE);
|
||||
MxOmni::GetInstance()->NotifyCurrentEntity(
|
||||
¶m
|
||||
);
|
||||
#else
|
||||
MxOmni::GetInstance()->NotifyCurrentEntity(
|
||||
&MxEndActionNotificationParam(c_notificationEndAction, NULL, p_action, TRUE)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -160,10 +160,18 @@ void MxMediaPresenter::EndAction()
|
||||
}
|
||||
|
||||
if (action && action->GetOrigin()) {
|
||||
#ifdef COMPAT_MODE
|
||||
MxEndActionNotificationParam param(c_notificationEndAction, this, action, FALSE);
|
||||
NotificationManager()->Send(
|
||||
action->GetOrigin(),
|
||||
¶m
|
||||
);
|
||||
#else
|
||||
NotificationManager()->Send(
|
||||
action->GetOrigin(),
|
||||
&MxEndActionNotificationParam(c_notificationEndAction, this, action, FALSE)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -345,14 +345,27 @@ MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p
|
||||
|
||||
if (object->StartAction(p_controller, &p_action) == SUCCESS) {
|
||||
if (sender) {
|
||||
#ifdef COMPAT_MODE
|
||||
MxType4NotificationParam param(this, &p_action, object);
|
||||
NotificationManager()->Send(sender, ¶m);
|
||||
#else
|
||||
NotificationManager()->Send(sender, &MxType4NotificationParam(this, &p_action, object));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (p_action.GetUnknown84()) {
|
||||
#ifdef COMPAT_MODE
|
||||
MxStartActionNotificationParam param(c_notificationStartAction, object, &p_action, FALSE);
|
||||
NotificationManager()->Send(
|
||||
p_action.GetUnknown84(),
|
||||
¶m
|
||||
);
|
||||
#else
|
||||
NotificationManager()->Send(
|
||||
p_action.GetUnknown84(),
|
||||
&MxStartActionNotificationParam(c_notificationStartAction, object, &p_action, FALSE)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
result = SUCCESS;
|
||||
}
|
||||
|
||||
@ -147,9 +147,16 @@ void MxPresenter::EndAction()
|
||||
MxAutoLocker lock(&this->m_criticalSection);
|
||||
|
||||
if (!this->m_compositePresenter) {
|
||||
#ifdef COMPAT_MODE
|
||||
MxEndActionNotificationParam param(c_notificationEndAction, NULL, this->m_action, TRUE);
|
||||
MxOmni::GetInstance()->NotifyCurrentEntity(
|
||||
¶m
|
||||
);
|
||||
#else
|
||||
MxOmni::GetInstance()->NotifyCurrentEntity(
|
||||
&MxEndActionNotificationParam(c_notificationEndAction, NULL, this->m_action, TRUE)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
this->m_action = NULL;
|
||||
@ -195,7 +202,12 @@ void MxPresenter::SendToCompositePresenter(MxOmni* p_omni)
|
||||
if (m_compositePresenter) {
|
||||
MxAutoLocker lock(&m_criticalSection);
|
||||
|
||||
#ifdef COMPAT_MODE
|
||||
MxNotificationParam param(MXPRESENTER_NOTIFICATION, this);
|
||||
NotificationManager()->Send(m_compositePresenter, ¶m);
|
||||
#else
|
||||
NotificationManager()->Send(m_compositePresenter, &MxNotificationParam(MXPRESENTER_NOTIFICATION, this));
|
||||
#endif
|
||||
|
||||
m_action->SetOrigin(p_omni ? p_omni : MxOmni::GetInstance());
|
||||
m_compositePresenter = NULL;
|
||||
|
||||
@ -55,7 +55,12 @@ MxStreamController::~MxStreamController()
|
||||
if (m_provider) {
|
||||
MxStreamProvider* provider = m_provider;
|
||||
m_provider = NULL;
|
||||
#ifdef COMPAT_MODE
|
||||
MxDSAction action;
|
||||
provider->VTable0x20(&action);
|
||||
#else
|
||||
provider->VTable0x20(&MxDSAction());
|
||||
#endif
|
||||
delete provider;
|
||||
}
|
||||
|
||||
|
||||
@ -81,8 +81,14 @@ MxLong MxStreamer::Close(const char* p_name)
|
||||
|
||||
if (c->FUN_100c20d0(ds))
|
||||
delete c;
|
||||
else
|
||||
else {
|
||||
#ifdef COMPAT_MODE
|
||||
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
|
||||
NotificationManager()->Send(this, ¬ification);
|
||||
#else
|
||||
NotificationManager()->Send(this, &MxStreamerNotification(MXSTREAMER_DELETE_NOTIFY, NULL, c));
|
||||
#endif
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
@ -185,8 +191,14 @@ MxLong MxStreamer::Notify(MxParam& p_param)
|
||||
|
||||
if (c->FUN_100c20d0(ds))
|
||||
delete c;
|
||||
else
|
||||
else {
|
||||
#ifdef COMPAT_MODE
|
||||
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
|
||||
NotificationManager()->Send(this, ¬ification);
|
||||
#else
|
||||
NotificationManager()->Send(this, &MxStreamerNotification(MXSTREAMER_DELETE_NOTIFY, NULL, c));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -140,7 +140,12 @@ void MxTransitionManager::EndTransition(MxBool p_notifyWorld)
|
||||
LegoWorld* world = GetCurrentWorld();
|
||||
|
||||
if (world) {
|
||||
#ifdef COMPAT_MODE
|
||||
MxNotificationParam param(MXTRANSITIONMANAGER_TRANSITIONENDED, this);
|
||||
world->Notify(param);
|
||||
#else
|
||||
world->Notify(MxNotificationParam(MXTRANSITIONMANAGER_TRANSITIONENDED, this));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user