Implement/match ViewManager::Remove (#624)

This commit is contained in:
Christian Semmler 2024-03-04 16:06:40 -05:00 committed by GitHub
parent 00c05aa80b
commit b8aa16ff80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 10 deletions

View file

@ -16,7 +16,7 @@
#include "roi/legoroi.h" #include "roi/legoroi.h"
// GLOBAL: LEGO1 0x100f7ae0 // GLOBAL: LEGO1 0x100f7ae0
int g_modelPresenterConfig = 1; MxS32 g_modelPresenterConfig = 1;
// GLOBAL: LEGO1 0x10102054 // GLOBAL: LEGO1 0x10102054
// STRING: LEGO1 0x10102018 // STRING: LEGO1 0x10102018

View file

@ -32,19 +32,38 @@ ViewManager::~ViewManager()
SetPOVSource(NULL); SetPOVSource(NULL);
} }
// STUB: LEGO1 0x100a6410 // FUNCTION: LEGO1 0x100a6410
void ViewManager::Remove(ViewROI* p_roi) void ViewManager::Remove(ViewROI* p_roi)
{ {
// TODO for (CompoundObject::iterator it = rois.begin(); it != rois.end(); it++) {
if (*it == p_roi) {
rois.erase(it);
if (p_roi->GetUnknown0xe0() >= 0) {
FUN_100a66a0(p_roi);
}
const CompoundObject* comp = p_roi->GetComp();
if (comp != NULL) {
for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) {
if (((ViewROI*) *it)->GetUnknown0xe0() >= 0) {
FUN_100a66a0((ViewROI*) *it);
}
}
}
return;
}
}
} }
// FUNCTION: LEGO1 0x100a64d0 // FUNCTION: LEGO1 0x100a64d0
void ViewManager::RemoveAll(ViewROI* p_roi) void ViewManager::RemoveAll(ViewROI* p_roi)
{ {
if (p_roi == NULL) { if (p_roi == NULL) {
for (CompoundObject::iterator it = rois.begin(); !(it == rois.end()); it++) { for (CompoundObject::iterator it = rois.begin(); it != rois.end(); it++) {
ViewROI* roi = (ViewROI*) *it; RemoveAll((ViewROI*) *it);
RemoveAll(roi);
} }
rois.erase(rois.begin(), rois.end()); rois.erase(rois.begin(), rois.end());
@ -59,10 +78,8 @@ void ViewManager::RemoveAll(ViewROI* p_roi)
if (comp != NULL) { if (comp != NULL) {
for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) { for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) {
ViewROI* roi = (ViewROI*) *it; if ((ViewROI*) *it != NULL) {
RemoveAll((ViewROI*) *it);
if (roi != NULL) {
RemoveAll(roi);
} }
} }
} }