Limit scope for variables in compat mode

This commit is contained in:
Anonymous Maarten 2024-01-07 18:14:12 +01:00
parent 3552eb3dd6
commit 8a09a7a0b3
10 changed files with 58 additions and 28 deletions

View File

@ -133,8 +133,11 @@ BOOL IsleApp::SetupLegoOmni()
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;
BOOL failure;
{
MxOmniCreateParam param(mediaPath, (struct HWND__ *) m_windowHandle, m_videoParam, MxOmniCreateFlags());
failure = Lego()->Create(param) == FAILURE;
}
#else
BOOL failure =
Lego()->Create(MxOmniCreateParam(mediaPath, (struct HWND__*) m_windowHandle, m_videoParam, MxOmniCreateFlags())

View File

@ -35,8 +35,11 @@ void MxAtomId::Destroy()
return;
#ifdef COMPAT_MODE
MxAtomIdCounter id_counter(m_internal);
MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&id_counter);
MxAtomIdCounterSet::iterator it;
{
MxAtomIdCounter id_counter(m_internal);
it = AtomIdCounterSet()->find(&id_counter);
}
#else
MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&MxAtomIdCounter(m_internal));
#endif

View File

@ -98,8 +98,10 @@ void MxCompositePresenter::EndAction()
if (action && action->GetOrigin()) {
#ifdef COMPAT_MODE
MxEndActionNotificationParam param(c_notificationEndAction, this, action, FALSE);
NotificationManager()->Send(action->GetOrigin(), &param);
{
MxEndActionNotificationParam param(c_notificationEndAction, this, action, FALSE);
NotificationManager()->Send(action->GetOrigin(), &param);
}
#else
NotificationManager()->Send(
action->GetOrigin(),

View File

@ -25,8 +25,10 @@ MxDiskStreamController::~MxDiskStreamController()
if (m_provider) {
#ifdef COMPAT_MODE
MxDSAction action;
m_provider->VTable0x20(&action);
{
MxDSAction action;
m_provider->VTable0x20(&action);
}
#else
m_provider->VTable0x20(&MxDSAction());
#endif
@ -306,8 +308,10 @@ MxResult MxDiskStreamController::VTable0x24(MxDSAction* p_action)
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(&param);
{
MxEndActionNotificationParam param(c_notificationEndAction, NULL, p_action, TRUE);
MxOmni::GetInstance()->NotifyCurrentEntity(&param);
}
#else
MxOmni::GetInstance()->NotifyCurrentEntity(
&MxEndActionNotificationParam(c_notificationEndAction, NULL, p_action, TRUE)

View File

@ -161,8 +161,10 @@ void MxMediaPresenter::EndAction()
if (action && action->GetOrigin()) {
#ifdef COMPAT_MODE
MxEndActionNotificationParam param(c_notificationEndAction, this, action, FALSE);
NotificationManager()->Send(action->GetOrigin(), &param);
{
MxEndActionNotificationParam param(c_notificationEndAction, this, action, FALSE);
NotificationManager()->Send(action->GetOrigin(), &param);
}
#else
NotificationManager()->Send(
action->GetOrigin(),

View File

@ -346,8 +346,10 @@ 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, &param);
{
MxType4NotificationParam param(this, &p_action, object);
NotificationManager()->Send(sender, &param);
}
#else
NotificationManager()->Send(sender, &MxType4NotificationParam(this, &p_action, object));
#endif
@ -355,8 +357,10 @@ MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p
if (p_action.GetUnknown84()) {
#ifdef COMPAT_MODE
MxStartActionNotificationParam param(c_notificationStartAction, object, &p_action, FALSE);
NotificationManager()->Send(p_action.GetUnknown84(), &param);
{
MxStartActionNotificationParam param(c_notificationStartAction, object, &p_action, FALSE);
NotificationManager()->Send(p_action.GetUnknown84(), &param);
}
#else
NotificationManager()->Send(
p_action.GetUnknown84(),

View File

@ -148,8 +148,10 @@ void MxPresenter::EndAction()
if (!this->m_compositePresenter) {
#ifdef COMPAT_MODE
MxEndActionNotificationParam param(c_notificationEndAction, NULL, this->m_action, TRUE);
MxOmni::GetInstance()->NotifyCurrentEntity(&param);
{
MxEndActionNotificationParam param(c_notificationEndAction, NULL, this->m_action, TRUE);
MxOmni::GetInstance()->NotifyCurrentEntity(&param);
}
#else
MxOmni::GetInstance()->NotifyCurrentEntity(
&MxEndActionNotificationParam(c_notificationEndAction, NULL, this->m_action, TRUE)
@ -201,8 +203,10 @@ void MxPresenter::SendToCompositePresenter(MxOmni* p_omni)
MxAutoLocker lock(&m_criticalSection);
#ifdef COMPAT_MODE
MxNotificationParam param(MXPRESENTER_NOTIFICATION, this);
NotificationManager()->Send(m_compositePresenter, &param);
{
MxNotificationParam param(MXPRESENTER_NOTIFICATION, this);
NotificationManager()->Send(m_compositePresenter, &param);
}
#else
NotificationManager()->Send(m_compositePresenter, &MxNotificationParam(MXPRESENTER_NOTIFICATION, this));
#endif

View File

@ -56,8 +56,10 @@ MxStreamController::~MxStreamController()
MxStreamProvider* provider = m_provider;
m_provider = NULL;
#ifdef COMPAT_MODE
MxDSAction action;
provider->VTable0x20(&action);
{
MxDSAction action;
provider->VTable0x20(&action);
}
#else
provider->VTable0x20(&MxDSAction());
#endif

View File

@ -83,8 +83,10 @@ MxLong MxStreamer::Close(const char* p_name)
delete c;
else {
#ifdef COMPAT_MODE
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
NotificationManager()->Send(this, &notification);
{
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
NotificationManager()->Send(this, &notification);
}
#else
NotificationManager()->Send(this, &MxStreamerNotification(MXSTREAMER_DELETE_NOTIFY, NULL, c));
#endif
@ -193,8 +195,10 @@ MxLong MxStreamer::Notify(MxParam& p_param)
delete c;
else {
#ifdef COMPAT_MODE
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
NotificationManager()->Send(this, &notification);
{
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
NotificationManager()->Send(this, &notification);
}
#else
NotificationManager()->Send(this, &MxStreamerNotification(MXSTREAMER_DELETE_NOTIFY, NULL, c));
#endif

View File

@ -141,8 +141,10 @@ void MxTransitionManager::EndTransition(MxBool p_notifyWorld)
if (world) {
#ifdef COMPAT_MODE
MxNotificationParam param(MXTRANSITIONMANAGER_TRANSITIONENDED, this);
world->Notify(param);
{
MxNotificationParam param(MXTRANSITIONMANAGER_TRANSITIONENDED, this);
world->Notify(param);
}
#else
world->Notify(MxNotificationParam(MXTRANSITIONMANAGER_TRANSITIONENDED, this));
#endif