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