MxRegion structures

This commit is contained in:
Christian Semmler
2023-10-17 18:12:24 -04:00
parent 7c26a4d2dc
commit 0604f25778
5 changed files with 91 additions and 11 deletions

View File

@@ -161,6 +161,7 @@ add_library(lego1 SHARED
LEGO1/mxramstreamcontroller.cpp
LEGO1/mxramstreamprovider.cpp
LEGO1/mxregion.cpp
LEGO1/mxregionlist.cpp
LEGO1/mxscheduler.cpp
LEGO1/mxsemaphore.cpp
LEGO1/mxsmkpresenter.cpp

View File

@@ -1,11 +1,24 @@
#include "mxregion.h"
#include <limits.h>
DECOMP_SIZE_ASSERT(MxRegion, 0x1c);
// OFFSET: LEGO1 0x100c31c0 STUB
// OFFSET: LEGO1 0x100c31c0
MxRegion::MxRegion()
{
m_list = new MxRegionList;
m_rect.m_left = INT_MAX;
m_rect.m_top = INT_MAX;
m_rect.m_right = -1;
m_rect.m_bottom = - 1;
}
// OFFSET: LEGO1 0x100c3660 STUB
MxBool MxRegion::vtable20()
{
// TODO
return FALSE;
}
// OFFSET: LEGO1 0x100c3690 STUB
@@ -31,10 +44,3 @@ void MxRegion::vtable1c()
{
// TODO
}
// OFFSET: LEGO1 0x100c3660 STUB
MxBool MxRegion::vtable20()
{
// TODO
return FALSE;
}

View File

@@ -2,9 +2,25 @@
#define MXREGION_H
#include "mxcore.h"
#include "mxregionlist.h"
#include "mxrect32.h"
#include "decomp.h"
// SIZE 0x0c
struct MxRegionTopBottom
{
MxS32 m_top;
MxS32 m_bottom;
MxRegionLeftRightList *m_leftRightList;
};
// SIZE 0x08
struct MxRegionLeftRight
{
MxS32 m_left;
MxS32 m_right;
};
// VTABLE 0x100dcae8
// SIZE 0x1c
class MxRegion : public MxCore
@@ -21,9 +37,7 @@ public:
inline MxRect32 &GetRect() { return this->m_rect; }
private:
// A container (probably MxList) holding MxRect32
// MxList<MxRect32*> *m_rects;
undefined4 m_unk08;
MxRegionList *m_list;
MxRect32 m_rect;
};

18
LEGO1/mxregionlist.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include "mxregionlist.h"
#include "mxregion.h"
// OFFSET: LEGO1 0x100c4e80
void MxRegionLeftRightListParent::Destroy(MxRegionLeftRight *p_leftRight)
{
delete p_leftRight;
}
// OFFSET: LEGO1 0x100c33e0
void MxRegionListParent::Destroy(MxRegionTopBottom *p_topBottom)
{
if (p_topBottom) {
if (p_topBottom->m_leftRightList)
delete p_topBottom->m_leftRightList;
delete p_topBottom;
}
}

41
LEGO1/mxregionlist.h Normal file
View File

@@ -0,0 +1,41 @@
#ifndef MXREGIONLIST_H
#define MXREGIONLIST_H
#include "mxlist.h"
struct MxRegionLeftRight;
struct MxRegionTopBottom;
// VTABLE 0x100dcc70
// SIZE 0x18
class MxRegionLeftRightListParent : public MxList<MxRegionLeftRight*>
{
public:
static void Destroy(MxRegionLeftRight *p_leftRight);
MxRegionLeftRightListParent() {
m_customDestructor = Destroy;
}
};
// VTABLE 0x100dcc88
// SIZE 0x18
class MxRegionLeftRightList : public MxRegionLeftRightListParent {};
// VTABLE 0x100dcb40
// SIZE 0x18
class MxRegionListParent : public MxList<MxRegionTopBottom*>
{
public:
static void Destroy(MxRegionTopBottom *p_topBottom);
MxRegionListParent() {
m_customDestructor = Destroy;
}
};
// VTABLE 0x100dcb58
// SIZE 0x18
class MxRegionList : public MxRegionListParent {};
#endif // MXREGIONLIST_H