mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-22 23:57:54 -05:00
Improve accuracy of MxOmni::CreatePresenter (#407)
* Improve accuracy of MxOmni::CreatePresenter * Update mxactionnotificationparam.cpp * Match to 100% --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
parent
9a5e1cb853
commit
9651ece809
2 changed files with 18 additions and 10 deletions
|
@ -18,7 +18,12 @@ MxNotificationParam* MxEndActionNotificationParam::Clone()
|
||||||
// FUNCTION: LEGO1 0x100b0300
|
// FUNCTION: LEGO1 0x100b0300
|
||||||
MxNotificationParam* MxStartActionNotificationParam::Clone()
|
MxNotificationParam* MxStartActionNotificationParam::Clone()
|
||||||
{
|
{
|
||||||
return new MxEndActionNotificationParam(c_notificationStartAction, this->m_sender, this->m_action, this->m_realloc);
|
return new MxStartActionNotificationParam(
|
||||||
|
c_notificationStartAction,
|
||||||
|
this->m_sender,
|
||||||
|
this->m_action,
|
||||||
|
this->m_realloc
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b04f0
|
// FUNCTION: LEGO1 0x100b04f0
|
||||||
|
|
|
@ -324,22 +324,24 @@ void MxOmni::DeleteObject(MxDSAction& p_dsAction)
|
||||||
MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p_action)
|
MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p_action)
|
||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
MxPresenter* object = (MxPresenter*) m_objectFactory->Create(PresenterNameDispatch(p_action));
|
const char* name = PresenterNameDispatch(p_action);
|
||||||
|
MxPresenter* object = (MxPresenter*) m_objectFactory->Create(name);
|
||||||
|
|
||||||
if (object) {
|
if (object) {
|
||||||
if (object->AddToManager() == SUCCESS) {
|
if (object->AddToManager() == SUCCESS) {
|
||||||
MxPresenter* sender = p_action.GetUnknown28();
|
MxPresenter* sender = p_action.GetUnknown28();
|
||||||
if (sender == NULL && (sender = p_controller->FUN_100c1e70(p_action)) == NULL) {
|
if (!sender)
|
||||||
if (p_action.GetOrigin() == NULL) {
|
sender = p_controller->FUN_100c1e70(p_action);
|
||||||
p_action.SetOrigin(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
object->SetCompositePresenter(NULL);
|
if (sender) {
|
||||||
}
|
|
||||||
else {
|
|
||||||
p_action.SetOrigin(sender);
|
p_action.SetOrigin(sender);
|
||||||
object->SetCompositePresenter((MxCompositePresenter*) sender);
|
object->SetCompositePresenter((MxCompositePresenter*) sender);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (!p_action.GetOrigin())
|
||||||
|
p_action.SetOrigin(this);
|
||||||
|
object->SetCompositePresenter(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (object->StartAction(p_controller, &p_action) == SUCCESS) {
|
if (object->StartAction(p_controller, &p_action) == SUCCESS) {
|
||||||
if (sender) {
|
if (sender) {
|
||||||
|
@ -349,13 +351,14 @@ MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p
|
||||||
if (p_action.GetUnknown84()) {
|
if (p_action.GetUnknown84()) {
|
||||||
NotificationManager()->Send(
|
NotificationManager()->Send(
|
||||||
p_action.GetUnknown84(),
|
p_action.GetUnknown84(),
|
||||||
&MxStartActionNotificationParam(c_notificationStartAction, this, &p_action, FALSE)
|
&MxStartActionNotificationParam(c_notificationStartAction, object, &p_action, FALSE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue