mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
LegoWorld::Add to 100% (#1328)
This commit is contained in:
@@ -184,7 +184,8 @@ protected:
|
||||
// TEMPLATE: LEGO1 0x10020b20
|
||||
// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::iterator::_Dec
|
||||
|
||||
// XTEMPLATE LEGO1 0x10020b70
|
||||
// TEMPLATE: LEGO1 0x10020b70
|
||||
// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::lower_bound
|
||||
|
||||
// TEMPLATE: LEGO1 0x10020bb0
|
||||
// _Tree<MxCore *,MxCore *,set<MxCore *,CoreSetCompare,allocator<MxCore *> >::_Kfn,CoreSetCompare,allocator<MxCore *> >::_Buynode
|
||||
|
@@ -402,20 +402,26 @@ MxResult LegoWorld::GetCurrPathInfo(LegoPathBoundary** p_boundaries, MxS32& p_nu
|
||||
// FUNCTION: BETA10 0x100da90b
|
||||
void LegoWorld::Add(MxCore* p_object)
|
||||
{
|
||||
if (p_object && !p_object->IsA("LegoWorld") && !p_object->IsA("LegoWorldPresenter")) {
|
||||
if (p_object->IsA("LegoAnimPresenter")) {
|
||||
LegoAnimPresenter* animPresenter = (LegoAnimPresenter*) p_object;
|
||||
if (p_object == NULL || p_object->IsA("LegoWorld") || p_object->IsA("LegoWorldPresenter")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmpi(animPresenter->GetAction()->GetObjectName(), "ConfigAnimation")) {
|
||||
FUN_1003e050(animPresenter);
|
||||
animPresenter->GetAction()->SetDuration(animPresenter->GetAnimation()->GetDuration());
|
||||
#ifndef BETA10
|
||||
if (p_object->IsA("LegoAnimPresenter")) {
|
||||
if (!strcmpi(((LegoAnimPresenter*) p_object)->GetAction()->GetObjectName(), "ConfigAnimation")) {
|
||||
FUN_1003e050((LegoAnimPresenter*) p_object);
|
||||
((LegoAnimPresenter*) p_object)
|
||||
->GetAction()
|
||||
->SetDuration(((LegoAnimPresenter*) p_object)->GetAnimation()->GetDuration());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (p_object->IsA("MxControlPresenter")) {
|
||||
MxPresenterListCursor cursor(&m_controlPresenters);
|
||||
|
||||
if (cursor.Find((MxPresenter*) p_object)) {
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -425,6 +431,7 @@ void LegoWorld::Add(MxCore* p_object)
|
||||
LegoEntityListCursor cursor(m_entityList);
|
||||
|
||||
if (cursor.Find((LegoEntity*) p_object)) {
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -434,6 +441,7 @@ void LegoWorld::Add(MxCore* p_object)
|
||||
MxPresenterListCursor cursor(&m_animPresenters);
|
||||
|
||||
if (cursor.Find((MxPresenter*) p_object)) {
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -444,37 +452,52 @@ void LegoWorld::Add(MxCore* p_object)
|
||||
m_hideAnim = (LegoHideAnimPresenter*) p_object;
|
||||
}
|
||||
}
|
||||
#ifndef BETA10
|
||||
else if (p_object->IsA("LegoCacheSound")) {
|
||||
LegoCacheSoundListCursor cursor(m_cacheSoundList);
|
||||
|
||||
if (cursor.Find((LegoCacheSound*) p_object)) {
|
||||
assert(0); // ?
|
||||
return;
|
||||
}
|
||||
|
||||
m_cacheSoundList->Append((LegoCacheSound*) p_object);
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
if (m_set0xa8.find(p_object) == m_set0xa8.end()) {
|
||||
MxCoreSet::iterator it = m_set0xa8.find(p_object);
|
||||
if (it == m_set0xa8.end()) {
|
||||
#ifdef BETA10
|
||||
if (p_object->IsA("MxPresenter")) {
|
||||
assert(static_cast<MxPresenter*>(p_object)->GetAction());
|
||||
}
|
||||
#endif
|
||||
|
||||
m_set0xa8.insert(p_object);
|
||||
}
|
||||
else {
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_set0xd0.empty() && p_object->IsA("MxPresenter")) {
|
||||
if (m_set0xd0.size() != 0 && p_object->IsA("MxPresenter")) {
|
||||
if (((MxPresenter*) p_object)->IsEnabled()) {
|
||||
((MxPresenter*) p_object)->Enable(FALSE);
|
||||
m_set0xd0.insert(p_object);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10020f10
|
||||
// FUNCTION: BETA10 0x100dad2a
|
||||
void LegoWorld::Remove(MxCore* p_object)
|
||||
{
|
||||
if (p_object) {
|
||||
MxCoreSet::iterator it;
|
||||
|
||||
if (p_object == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_object->IsA("MxControlPresenter")) {
|
||||
MxPresenterListCursor cursor(&m_controlPresenters);
|
||||
|
||||
@@ -508,6 +531,7 @@ void LegoWorld::Remove(MxCore* p_object)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef BETA10
|
||||
else if (p_object->IsA("LegoCacheSound")) {
|
||||
LegoCacheSoundListCursor cursor(m_cacheSoundList);
|
||||
|
||||
@@ -515,6 +539,7 @@ void LegoWorld::Remove(MxCore* p_object)
|
||||
cursor.Detach();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
it = m_set0xa8.find(p_object);
|
||||
if (it != m_set0xa8.end()) {
|
||||
@@ -527,7 +552,6 @@ void LegoWorld::Remove(MxCore* p_object)
|
||||
m_set0xd0.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100213a0
|
||||
// FUNCTION: BETA10 0x100db027
|
||||
@@ -643,8 +667,12 @@ MxCore* LegoWorld::Find(const MxAtomId& p_atom, MxS32 p_entityId)
|
||||
// FUNCTION: BETA10 0x100db758
|
||||
void LegoWorld::Enable(MxBool p_enable)
|
||||
{
|
||||
if (p_enable && !m_set0xd0.empty()) {
|
||||
if (CurrentWorld() != this) {
|
||||
MxCoreSet::iterator it;
|
||||
|
||||
if (p_enable && m_set0xd0.size() != 0) {
|
||||
if (CurrentWorld() == this) {
|
||||
return;
|
||||
}
|
||||
if (CurrentWorld()) {
|
||||
AnimationManager()->FUN_10061010(FALSE);
|
||||
CurrentWorld()->Enable(FALSE);
|
||||
@@ -653,15 +681,19 @@ void LegoWorld::Enable(MxBool p_enable)
|
||||
LegoEntity* entity;
|
||||
|
||||
while (cursor.Next(entity)) {
|
||||
assert(entity->GetROI());
|
||||
|
||||
if (entity->GetROI()) {
|
||||
#ifndef BETA10
|
||||
entity->GetROI()->SetEntity(entity);
|
||||
#endif
|
||||
GetViewManager()->Add(entity->GetROI());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (!m_set0xd0.empty()) {
|
||||
MxCoreSet::iterator it = m_set0xd0.begin();
|
||||
while (m_set0xd0.size() != 0) {
|
||||
it = m_set0xd0.begin();
|
||||
|
||||
if ((*it)->IsA("MxPresenter")) {
|
||||
((MxPresenter*) *it)->Enable(TRUE);
|
||||
@@ -690,10 +722,11 @@ void LegoWorld::Enable(MxBool p_enable)
|
||||
}
|
||||
|
||||
GameState()->ResetROI();
|
||||
#ifndef BETA10
|
||||
SetIsWorldActive(TRUE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (!p_enable && m_set0xd0.empty()) {
|
||||
else if (!p_enable && m_set0xd0.size() != 0) {
|
||||
MxPresenter* presenter;
|
||||
LegoPathController* controller;
|
||||
LegoPathActor* actor = UserActor();
|
||||
@@ -707,7 +740,9 @@ void LegoWorld::Enable(MxBool p_enable)
|
||||
|
||||
if (m_worldId != LegoOmni::e_undefined) {
|
||||
PlantManager()->Reset(m_worldId);
|
||||
#ifndef BETA10
|
||||
BuildingManager()->Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
MxPresenterListCursor controlPresenterCursor(&m_controlPresenters);
|
||||
|
Reference in New Issue
Block a user