Fix LegoROI / add TimeROI (#572)

* Fix LegoROI / add TimeROI

* Fix order

* Remove extra fwd decl
This commit is contained in:
Christian Semmler
2024-02-17 10:07:34 -05:00
committed by GitHub
parent b47412183b
commit 332d8da695
14 changed files with 117 additions and 64 deletions

View File

@@ -2,7 +2,8 @@
#include <string.h>
DECOMP_SIZE_ASSERT(LegoROI, 0x10c);
DECOMP_SIZE_ASSERT(LegoROI, 0x108)
DECOMP_SIZE_ASSERT(TimeROI, 0x10c)
// SIZE 0x14
typedef struct {
@@ -59,8 +60,44 @@ void LegoROI::configureLegoROI(int p_roiConfig)
g_roiConfig = p_roiConfig;
}
// STUB: LEGO1 0x100a9a50
LegoROI::LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, int p_time) : ViewROI(p_renderer, p_lodList)
// FUNCTION: LEGO1 0x100a81d0
LegoROI::LegoROI(Tgl::Renderer* p_renderer) : ViewROI(p_renderer, NULL), m_unk0xe0(-1)
{
m_unk0xd4 = NULL;
m_name = NULL;
m_unk0x104 = NULL;
}
// FUNCTION: LEGO1 0x100a82d0
LegoROI::LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList) : ViewROI(p_renderer, p_lodList), m_unk0xe0(-1)
{
m_unk0xd4 = NULL;
m_name = NULL;
m_unk0x104 = NULL;
}
// FUNCTION: LEGO1 0x100a83c0
LegoROI::~LegoROI()
{
if (comp) {
CompoundObject::iterator iterator;
for (iterator = comp->begin(); !(iterator == comp->end()); ++iterator) {
ROI* child = *iterator;
delete child;
}
delete comp;
comp = 0;
}
if (m_name) {
delete[] m_name;
}
}
// FUNCTION: LEGO1 0x100a9a50
TimeROI::TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, int p_time) : LegoROI(p_renderer, p_lodList)
{
m_time = p_time;
}
@@ -127,7 +164,6 @@ float LegoROI::IntrinsicImportance() const
return .5;
}
// Note: Actually part of parent class (doesn't exist yet)
// STUB: LEGO1 0x100aa350
void LegoROI::UpdateWorldBoundingVolumes()
{

View File

@@ -7,20 +7,15 @@ typedef unsigned char (*ROIHandler)(char*, char*, unsigned int);
class LegoEntity;
// Note: There is an extra class between LegoROI and ViewROI,
// maybe called "AutoROI". VTABLE 0x100dbe38
// TODO: Set as superclass of LegoROI
class AutoROI : public ViewROI {};
// VTABLE: LEGO1 0x100dbea8
// SIZE 0x10c
// VTABLE: LEGO1 0x100dbe38
// SIZE 0x108
class LegoROI : public ViewROI {
public:
LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, int p_time);
LegoROI(Tgl::Renderer* p_renderer);
LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList);
~LegoROI() override;
float IntrinsicImportance() const override; // vtable+0x04
// Note: Actually part of parent class (doesn't exist yet)
void UpdateWorldBoundingVolumes() override; // vtable+0x18
void SetDisplayBB(int p_displayBB);
@@ -40,20 +35,33 @@ public:
void FUN_100a46b0(Matrix4& p_transform);
void FUN_100a58f0(Matrix4& p_transform);
inline const char* GetName() { return m_name; }
inline const char* GetName() const { return m_name; }
inline LegoEntity* GetUnknown0x104() { return m_unk0x104; }
inline void SetUnknown0x104(LegoEntity* p_unk0x104) { m_unk0x104 = p_unk0x104; }
// SYNTHETIC: LEGO1 0x100a9ad0
// SYNTHETIC: LEGO1 0x100a82b0
// LegoROI::`scalar deleting destructor'
private:
undefined4 m_unk0xe0; // 0xe0
const char* m_name; // 0xe4
undefined m_unk0xe8[0x1c]; // 0xe8
LegoEntity* m_unk0x104; // 0x104
int m_time; // 0x108
int m_unk0xe0; // 0xe0
char* m_name; // 0xe4
BoundingSphere m_sphere; // 0xe8
undefined4 m_unk0x100; // 0x100
LegoEntity* m_unk0x104; // 0x104
};
// VTABLE: LEGO1 0x100dbea8
// SIZE 0x10c
class TimeROI : public LegoROI {
public:
TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, int p_time);
// SYNTHETIC: LEGO1 0x100a9ad0
// TimeROI::`scalar deleting destructor'
private:
int m_time; // 0x108
};
#endif // LEGOROI_H