Implement/match ViewManager::RemoveAll (#616)

* Implement/match ViewManager::RemoveAll

* Use const_iterator

* const

* Naming
This commit is contained in:
Christian Semmler
2024-03-02 14:26:19 -05:00
committed by GitHub
parent 6de17cf1b6
commit de5cd98b76
7 changed files with 52 additions and 18 deletions

View File

@@ -65,7 +65,7 @@ protected:
void FUN_100692b0();
void FUN_100695c0();
LegoChar* FUN_100697c0(const LegoChar* p_und1, const LegoChar* p_und2);
LegoBool FUN_100698b0(const CompoundObject& p_und1, const LegoChar* p_und2);
LegoBool FUN_100698b0(const CompoundObject& p_rois, const LegoChar* p_und2);
void FUN_10069b10();
LegoBool FUN_1006aba0();
LegoBool FUN_1006abb0(LegoTreeNode*, undefined4);

View File

@@ -547,7 +547,7 @@ void LegoWorld::Enable(MxBool p_enable)
while (cursor.Next(entity)) {
if (entity->GetROI()) {
entity->GetROI()->SetUnknown0x104(entity);
GetViewManager()->AddToUnknown0x08(entity->GetROI());
GetViewManager()->Add(entity->GetROI());
}
}
}

View File

@@ -829,10 +829,10 @@ void LegoOmni::DeleteObject(MxDSAction& p_dsAction)
LegoROI* LegoOmni::FindROI(const char* p_name)
{
ViewManager* viewManager = GetVideoManager()->Get3DManager()->GetLego3DView()->GetViewManager();
CompoundObject& unk0x08 = viewManager->GetUnknown0x08();
const CompoundObject& rois = viewManager->GetROIs();
if (p_name != NULL && *p_name != '\0' && unk0x08.size() > 0) {
for (CompoundObject::iterator it = unk0x08.begin(); it != unk0x08.end(); it++) {
if (p_name != NULL && *p_name != '\0' && rois.size() > 0) {
for (CompoundObject::const_iterator it = rois.begin(); it != rois.end(); it++) {
LegoROI* roi = (LegoROI*) *it;
const char* name = roi->GetName();

View File

@@ -218,11 +218,11 @@ void LegoAnimPresenter::FUN_100695c0()
m_unk0x70 = new LegoROIList();
if (m_unk0x70) {
CompoundObject& unk0x08 = VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->GetUnknown0x08();
const CompoundObject& rois = VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->GetROIs();
LegoU32 numActors = m_anim->GetNumActors();
for (LegoU32 i = 0; i < numActors; i++) {
if (FUN_100698b0(unk0x08, m_anim->GetActorName(i)) == FALSE) {
if (FUN_100698b0(rois, m_anim->GetActorName(i)) == FALSE) {
undefined4 unk0x04 = m_anim->GetActorUnknown0x04(i);
if (unk0x04 == 5 || unk0x04 == 6) {
@@ -239,7 +239,7 @@ void LegoAnimPresenter::FUN_100695c0()
strlwr(dest);
UnkSaveDataWriter()->FUN_10085210(str, dest, 0);
FUN_100698b0(unk0x08, str);
FUN_100698b0(rois, str);
}
}
}
@@ -274,7 +274,7 @@ LegoChar* LegoAnimPresenter::FUN_100697c0(const LegoChar* p_und1, const LegoChar
}
// FUNCTION: LEGO1 0x100698b0
LegoBool LegoAnimPresenter::FUN_100698b0(const CompoundObject& p_und1, const LegoChar* p_und2)
LegoBool LegoAnimPresenter::FUN_100698b0(const CompoundObject& p_rois, const LegoChar* p_und2)
{
LegoBool result = FALSE;
@@ -285,8 +285,8 @@ LegoBool LegoAnimPresenter::FUN_100698b0(const CompoundObject& p_und1, const Leg
str = tmp;
}
if (str != NULL && *str != '\0' && p_und1.size() > 0) {
for (CompoundObject::const_iterator it = p_und1.begin(); it != p_und1.end(); it++) {
if (str != NULL && *str != '\0' && p_rois.size() > 0) {
for (CompoundObject::const_iterator it = p_rois.begin(); it != p_rois.end(); it++) {
LegoROI* roi = (LegoROI*) *it;
const char* name = roi->GetName();