mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-02-16 19:50:52 -05:00
Match StartAction functions, remove NextFragment (#610)
This commit is contained in:
parent
ba8744ef8f
commit
fb6eed9bff
6 changed files with 42 additions and 55 deletions
|
@ -36,21 +36,24 @@ MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller
|
||||||
MxDSAction* action;
|
MxDSAction* action;
|
||||||
|
|
||||||
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
|
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
|
||||||
// The usual cursor.Next() loop doesn't match here, even though
|
cursor.Head();
|
||||||
// the logic is the same. It does match when "deconstructed" into
|
|
||||||
// the following Head(), Current() and NextFragment() calls,
|
while (cursor.Current(action)) {
|
||||||
// but this seems unlikely to be the original code.
|
|
||||||
// The alpha debug build also uses Next().
|
|
||||||
// cursor.Head();
|
|
||||||
// while (cursor.Current(action)) {
|
|
||||||
// cursor.NextFragment();
|
|
||||||
while (cursor.Next(action)) {
|
|
||||||
MxBool success = FALSE;
|
MxBool success = FALSE;
|
||||||
|
const char* presenterName;
|
||||||
|
MxPresenter* presenter = NULL;
|
||||||
|
|
||||||
action->CopyFlags(m_action->GetFlags());
|
cursor.Next();
|
||||||
|
|
||||||
const char* presenterName = PresenterNameDispatch(*action);
|
if (m_action->GetFlags() & MxDSAction::c_looping) {
|
||||||
MxPresenter* presenter = (MxPresenter*) ObjectFactory()->Create(presenterName);
|
action->SetFlags(action->GetFlags() | MxDSAction::c_looping);
|
||||||
|
}
|
||||||
|
else if (m_action->GetFlags() & MxDSAction::c_bit3) {
|
||||||
|
action->SetFlags(action->GetFlags() | MxDSAction::c_bit3);
|
||||||
|
}
|
||||||
|
|
||||||
|
presenterName = PresenterNameDispatch(*action);
|
||||||
|
presenter = (MxPresenter*) ObjectFactory()->Create(presenterName);
|
||||||
|
|
||||||
if (presenter && presenter->AddToManager() == SUCCESS) {
|
if (presenter && presenter->AddToManager() == SUCCESS) {
|
||||||
presenter->SetCompositePresenter(this);
|
presenter->SetCompositePresenter(this);
|
||||||
|
|
|
@ -107,13 +107,9 @@ void LegoControlManager::FUN_100292e0()
|
||||||
LegoNotifyListCursor cursor(&m_notifyList);
|
LegoNotifyListCursor cursor(&m_notifyList);
|
||||||
MxCore* target;
|
MxCore* target;
|
||||||
|
|
||||||
// The usual cursor.Next() loop doesn't match here, even though
|
|
||||||
// the logic is the same. It does match when "deconstructed" into
|
|
||||||
// the following Head(), Current() and NextFragment() calls,
|
|
||||||
// but this seems unlikely to be the original code.
|
|
||||||
cursor.Head();
|
cursor.Head();
|
||||||
while (cursor.Current(target)) {
|
while (cursor.Current(target)) {
|
||||||
cursor.NextFragment();
|
cursor.Next();
|
||||||
target->Notify(m_event);
|
target->Notify(m_event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,21 +74,24 @@ MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSA
|
||||||
MxDSAction* action;
|
MxDSAction* action;
|
||||||
|
|
||||||
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
|
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
|
||||||
// The usual cursor.Next() loop doesn't match here, even though
|
|
||||||
// the logic is the same. It does match when "deconstructed" into
|
|
||||||
// the following Head(), Current() and NextFragment() calls,
|
|
||||||
// but this seems unlikely to be the original code.
|
|
||||||
// The alpha debug build also uses Next().
|
|
||||||
cursor.Head();
|
cursor.Head();
|
||||||
|
|
||||||
while (cursor.Current(action)) {
|
while (cursor.Current(action)) {
|
||||||
cursor.NextFragment();
|
|
||||||
|
|
||||||
MxBool success = FALSE;
|
MxBool success = FALSE;
|
||||||
|
const char* presenterName;
|
||||||
|
MxPresenter* presenter = NULL;
|
||||||
|
|
||||||
action->CopyFlags(m_action->GetFlags());
|
cursor.Next();
|
||||||
|
|
||||||
const char* presenterName = PresenterNameDispatch(*action);
|
if (m_action->GetFlags() & MxDSAction::c_looping) {
|
||||||
MxPresenter* presenter = (MxPresenter*) factory->Create(presenterName);
|
action->SetFlags(action->GetFlags() | MxDSAction::c_looping);
|
||||||
|
}
|
||||||
|
else if (m_action->GetFlags() & MxDSAction::c_bit3) {
|
||||||
|
action->SetFlags(action->GetFlags() | MxDSAction::c_bit3);
|
||||||
|
}
|
||||||
|
|
||||||
|
presenterName = PresenterNameDispatch(*action);
|
||||||
|
presenter = (MxPresenter*) factory->Create(presenterName);
|
||||||
|
|
||||||
if (presenter && presenter->AddToManager() == SUCCESS) {
|
if (presenter && presenter->AddToManager() == SUCCESS) {
|
||||||
presenter->SetCompositePresenter(this);
|
presenter->SetCompositePresenter(this);
|
||||||
|
|
|
@ -81,16 +81,6 @@ public:
|
||||||
inline MxBool IsLooping() const { return m_flags & c_looping; }
|
inline MxBool IsLooping() const { return m_flags & c_looping; }
|
||||||
inline MxBool IsBit3() const { return m_flags & c_bit3; }
|
inline MxBool IsBit3() const { return m_flags & c_bit3; }
|
||||||
|
|
||||||
inline void CopyFlags(MxU32 p_flags)
|
|
||||||
{
|
|
||||||
if (p_flags & MxDSAction::c_looping) {
|
|
||||||
SetFlags(GetFlags() | MxDSAction::c_looping);
|
|
||||||
}
|
|
||||||
else if (p_flags & MxDSAction::c_bit3) {
|
|
||||||
SetFlags(GetFlags() | MxDSAction::c_bit3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100ada60
|
// SYNTHETIC: LEGO1 0x100ada60
|
||||||
// MxDSAction::`scalar deleting destructor'
|
// MxDSAction::`scalar deleting destructor'
|
||||||
|
|
||||||
|
|
|
@ -118,14 +118,6 @@ public:
|
||||||
void Reset() { m_match = NULL; }
|
void Reset() { m_match = NULL; }
|
||||||
void Prepend(T p_newobj);
|
void Prepend(T p_newobj);
|
||||||
|
|
||||||
// TODO: Probably shouldn't exist
|
|
||||||
void NextFragment()
|
|
||||||
{
|
|
||||||
if (m_match) {
|
|
||||||
m_match = m_match->GetNext();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxList<T>* m_list; // 0x08
|
MxList<T>* m_list; // 0x08
|
||||||
MxListEntry<T>* m_match; // 0x0c
|
MxListEntry<T>* m_match; // 0x0c
|
||||||
|
|
|
@ -32,21 +32,24 @@ MxResult MxCompositePresenter::StartAction(MxStreamController* p_controller, MxD
|
||||||
MxDSAction* action;
|
MxDSAction* action;
|
||||||
|
|
||||||
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
|
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
|
||||||
// The usual cursor.Next() loop doesn't match here, even though
|
|
||||||
// the logic is the same. It does match when "deconstructed" into
|
|
||||||
// the following Head(), Current() and NextFragment() calls,
|
|
||||||
// but this seems unlikely to be the original code.
|
|
||||||
// The alpha debug build also uses Next().
|
|
||||||
cursor.Head();
|
cursor.Head();
|
||||||
|
|
||||||
while (cursor.Current(action)) {
|
while (cursor.Current(action)) {
|
||||||
cursor.NextFragment();
|
|
||||||
|
|
||||||
MxBool success = FALSE;
|
MxBool success = FALSE;
|
||||||
|
const char* presenterName;
|
||||||
|
MxPresenter* presenter = NULL;
|
||||||
|
|
||||||
action->CopyFlags(m_action->GetFlags());
|
cursor.Next();
|
||||||
|
|
||||||
const char* presenterName = PresenterNameDispatch(*action);
|
if (m_action->GetFlags() & MxDSAction::c_looping) {
|
||||||
MxPresenter* presenter = (MxPresenter*) factory->Create(presenterName);
|
action->SetFlags(action->GetFlags() | MxDSAction::c_looping);
|
||||||
|
}
|
||||||
|
else if (m_action->GetFlags() & MxDSAction::c_bit3) {
|
||||||
|
action->SetFlags(action->GetFlags() | MxDSAction::c_bit3);
|
||||||
|
}
|
||||||
|
|
||||||
|
presenterName = PresenterNameDispatch(*action);
|
||||||
|
presenter = (MxPresenter*) factory->Create(presenterName);
|
||||||
|
|
||||||
if (presenter && presenter->AddToManager() == SUCCESS) {
|
if (presenter && presenter->AddToManager() == SUCCESS) {
|
||||||
presenter->SetCompositePresenter(this);
|
presenter->SetCompositePresenter(this);
|
||||||
|
|
Loading…
Reference in a new issue