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

@@ -32,8 +32,39 @@ ViewManager::~ViewManager()
SetPOVSource(NULL);
}
// STUB: LEGO1 0x100a64d0
void ViewManager::RemoveAll(ViewROI*)
// FUNCTION: LEGO1 0x100a64d0
void ViewManager::RemoveAll(ViewROI* p_roi)
{
if (p_roi == NULL) {
for (CompoundObject::iterator it = rois.begin(); !(it == rois.end()); it++) {
ViewROI* roi = (ViewROI*) *it;
RemoveAll(roi);
}
rois.erase(rois.begin(), rois.end());
}
else {
if (p_roi->GetUnknown0xe0() >= 0) {
FUN_100a66a0(p_roi);
}
p_roi->SetUnknown0xe0(-1);
const CompoundObject* comp = p_roi->GetComp();
if (comp != NULL) {
for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) {
ViewROI* roi = (ViewROI*) *it;
if (roi != NULL) {
RemoveAll(roi);
}
}
}
}
}
// STUB: LEGO1 0x100a66a0
void ViewManager::FUN_100a66a0(ViewROI* p_roi)
{
// TODO
}

View File

@@ -21,8 +21,8 @@ public:
ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const OrientableROI* point_of_view);
virtual ~ViewManager();
void RemoveAll(ViewROI*);
void RemoveAll(ViewROI* p_roi);
void FUN_100a66a0(ViewROI* p_roi);
void SetPOVSource(const OrientableROI* point_of_view);
void SetResolution(int width, int height);
void SetFrustrum(float fov, float front, float back);
@@ -31,13 +31,13 @@ public:
// SYNTHETIC: LEGO1 0x100a6000
// ViewManager::`scalar deleting destructor'
inline CompoundObject& GetUnknown0x08() { return unk0x08; }
inline const CompoundObject& GetROIs() { return rois; }
inline void AddToUnknown0x08(ViewROI* p_roi) { unk0x08.push_back(p_roi); }
inline void Add(ViewROI* p_roi) { rois.push_back(p_roi); }
private:
Tgl::Group* scene; // 0x04
CompoundObject unk0x08; // 0x08
CompoundObject rois; // 0x08
RealtimeView rt_view; // 0x14
ROIList visible_rois; // 0x18
float unk0x28; // 0x28

View File

@@ -56,6 +56,9 @@ public:
virtual const Tgl::Group* GetGeometry() const; // vtable+0x34
virtual Tgl::Group* GetGeometry(); // vtable+0x30
inline int GetUnknown0xe0() { return m_unk0xe0; }
inline void SetUnknown0xe0(int p_unk0xe0) { m_unk0xe0 = p_unk0xe0; }
static undefined SetUnk101013d8(undefined p_flag);
protected: