From d663e26321ed98927292a2855571c439e4bafe7e Mon Sep 17 00:00:00 2001 From: MS Date: Tue, 11 Mar 2025 21:13:13 -0400 Subject: [PATCH] Use MxGeometry header (#1399) * Use MxGeometry header * Fix comment --------- Co-authored-by: Christian Semmler --- LEGO1/lego/legoomni/include/infocenter.h | 4 +- .../legoomni/include/legocameracontroller.h | 2 +- .../legoomni/include/legometerpresenter.h | 20 +- .../include/legopointofviewcontroller.h | 2 +- LEGO1/lego/legoomni/include/legorace.h | 2 +- LEGO1/lego/legoomni/src/worlds/infocenter.cpp | 35 +- LEGO1/lego/sources/misc/legoutil.h | 5 + LEGO1/omni/include/mxgeometry.h | 604 ++++++++++++++++++ LEGO1/omni/include/mxpoint32.h | 36 -- LEGO1/omni/include/mxpresenter.h | 2 +- LEGO1/omni/include/mxrect16.h | 47 -- LEGO1/omni/include/mxrect32.h | 127 ---- LEGO1/omni/include/mxrectlist.h | 161 ----- LEGO1/omni/include/mxregion.h | 2 +- LEGO1/omni/include/mxsize32.h | 25 - LEGO1/omni/include/mxsmk.h | 4 +- LEGO1/omni/include/mxutilities.h | 6 + LEGO1/omni/include/mxvideoparam.h | 2 +- LEGO1/omni/include/mxvideopresenter.h | 2 +- LEGO1/omni/src/common/mxutilities.cpp | 19 +- LEGO1/omni/src/video/mxflcpresenter.cpp | 2 +- LEGO1/omni/src/video/mxregion.cpp | 16 +- LEGO1/omni/src/video/mxsmk.cpp | 2 +- LEGO1/omni/src/video/mxsmkpresenter.cpp | 6 +- LEGO1/omni/src/video/mxstillpresenter.cpp | 15 +- LEGO1/omni/src/video/mxvideomanager.cpp | 3 +- LEGO1/omni/src/video/mxvideopresenter.cpp | 2 +- 27 files changed, 674 insertions(+), 479 deletions(-) create mode 100644 LEGO1/omni/include/mxgeometry.h delete mode 100644 LEGO1/omni/include/mxpoint32.h delete mode 100644 LEGO1/omni/include/mxrect16.h delete mode 100644 LEGO1/omni/include/mxrect32.h delete mode 100644 LEGO1/omni/include/mxrectlist.h delete mode 100644 LEGO1/omni/include/mxsize32.h diff --git a/LEGO1/lego/legoomni/include/infocenter.h b/LEGO1/lego/legoomni/include/infocenter.h index 03c55254..24d14aa8 100644 --- a/LEGO1/lego/legoomni/include/infocenter.h +++ b/LEGO1/lego/legoomni/include/infocenter.h @@ -6,7 +6,7 @@ #include "legostate.h" #include "legoworld.h" #include "misc.h" -#include "mxrect32.h" +#include "mxgeometry.h" #include "radio.h" class MxNotificationParam; @@ -82,7 +82,7 @@ struct InfocenterMapEntry { MxStillPresenter* m_destCtl; // 0x00 undefined4 m_unk0x04; // 0x04 - MxRect32 m_area; // 0x08 + MxRect m_area; // 0x08 }; // VTABLE: LEGO1 0x100d9338 diff --git a/LEGO1/lego/legoomni/include/legocameracontroller.h b/LEGO1/lego/legoomni/include/legocameracontroller.h index 96934e4f..4dcb6c39 100644 --- a/LEGO1/lego/legoomni/include/legocameracontroller.h +++ b/LEGO1/lego/legoomni/include/legocameracontroller.h @@ -2,9 +2,9 @@ #define LEGOCAMERACONTROLLER_H #include "legopointofviewcontroller.h" +#include "mxgeometry.h" #include "mxgeometry/mxgeometry3d.h" #include "mxgeometry/mxmatrix.h" -#include "mxpoint32.h" // VTABLE: LEGO1 0x100d57b0 // VTABLE: BETA10 0x101bb748 diff --git a/LEGO1/lego/legoomni/include/legometerpresenter.h b/LEGO1/lego/legoomni/include/legometerpresenter.h index 9a8b7acd..efcf5db9 100644 --- a/LEGO1/lego/legoomni/include/legometerpresenter.h +++ b/LEGO1/lego/legoomni/include/legometerpresenter.h @@ -1,16 +1,10 @@ #ifndef LEGOMETERPRESENTER_H #define LEGOMETERPRESENTER_H -#include "mxrect16.h" +#include "mxgeometry.h" #include "mxstillpresenter.h" #include "mxstring.h" -// SIZE 0x08 -struct MeterRect : public MxRect16 { - // FUNCTION: BETA10 0x10097eb0 - MeterRect() {} -}; - // VTABLE: LEGO1 0x100d7ac8 // VTABLE: BETA10 0x101bca68 // SIZE 0x94 @@ -35,12 +29,12 @@ private: void DrawMeter(); - MxU8* m_meterPixels; // 0x6c - MxU16 m_fillColor; // 0x70 - MxString m_variable; // 0x74 - MxFloat m_curPercent; // 0x84 - MeterRect m_meterRect; // 0x88 - MxS16 m_layout; // 0x90 + MxU8* m_meterPixels; // 0x6c + MxU16 m_fillColor; // 0x70 + MxString m_variable; // 0x74 + MxFloat m_curPercent; // 0x84 + MxRect16 m_meterRect; // 0x88 + MxS16 m_layout; // 0x90 }; // SYNTHETIC: LEGO1 0x10043760 diff --git a/LEGO1/lego/legoomni/include/legopointofviewcontroller.h b/LEGO1/lego/legoomni/include/legopointofviewcontroller.h index ee6ac32c..9d1253aa 100644 --- a/LEGO1/lego/legoomni/include/legopointofviewcontroller.h +++ b/LEGO1/lego/legoomni/include/legopointofviewcontroller.h @@ -3,7 +3,7 @@ #include "decomp.h" #include "mxcore.h" -#include "mxpoint32.h" +#include "mxgeometry.h" #include diff --git a/LEGO1/lego/legoomni/include/legorace.h b/LEGO1/lego/legoomni/include/legorace.h index 344136f3..55d43785 100644 --- a/LEGO1/lego/legoomni/include/legorace.h +++ b/LEGO1/lego/legoomni/include/legorace.h @@ -7,7 +7,7 @@ #include "legoracemap.h" #include "legostate.h" #include "legoworld.h" -#include "mxrect32.h" +#include "mxgeometry.h" #include "mxtypes.h" class Act1State; diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index 657536b0..5cc9138c 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -630,58 +630,37 @@ void Infocenter::InitializeBitmaps() m_glowInfo[0].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap"); assert(m_glowInfo[0].m_destCtl); - m_glowInfo[0].m_area.SetLeft(391); - m_glowInfo[0].m_area.SetTop(182); - m_glowInfo[0].m_area.SetRight(427); - m_glowInfo[0].m_area.SetBottom(230); + m_glowInfo[0].m_area = MxRect(391, 182, 427, 230); m_glowInfo[0].m_unk0x04 = 3; m_glowInfo[1].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Boat_A_Bitmap"); assert(m_glowInfo[1].m_destCtl); - m_glowInfo[1].m_area.SetLeft(304); - m_glowInfo[1].m_area.SetTop(225); - m_glowInfo[1].m_area.SetRight(350); - m_glowInfo[1].m_area.SetBottom(268); + m_glowInfo[1].m_area = MxRect(304, 225, 350, 268); m_glowInfo[1].m_unk0x04 = 10; m_glowInfo[2].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Race_A_Bitmap"); assert(m_glowInfo[1].m_destCtl); // DECOMP: intentional typo - m_glowInfo[2].m_area.SetLeft(301); - m_glowInfo[2].m_area.SetTop(133); - m_glowInfo[2].m_area.SetRight(347); - m_glowInfo[2].m_area.SetBottom(181); + m_glowInfo[2].m_area = MxRect(301, 133, 347, 181); m_glowInfo[2].m_unk0x04 = 11; m_glowInfo[3].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Pizza_A_Bitmap"); assert(m_glowInfo[3].m_destCtl); - m_glowInfo[3].m_area.SetLeft(289); - m_glowInfo[3].m_area.SetTop(182); - m_glowInfo[3].m_area.SetRight(335); - m_glowInfo[3].m_area.SetBottom(225); + m_glowInfo[3].m_area = MxRect(289, 182, 335, 225); m_glowInfo[3].m_unk0x04 = 12; m_glowInfo[4].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Gas_A_Bitmap"); assert(m_glowInfo[4].m_destCtl); - m_glowInfo[4].m_area.SetLeft(350); - m_glowInfo[4].m_area.SetTop(161); - m_glowInfo[4].m_area.SetRight(391); - m_glowInfo[4].m_area.SetBottom(209); + m_glowInfo[4].m_area = MxRect(350, 161, 391, 209); m_glowInfo[4].m_unk0x04 = 13; m_glowInfo[5].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Med_A_Bitmap"); assert(m_glowInfo[5].m_destCtl); - m_glowInfo[5].m_area.SetLeft(392); - m_glowInfo[5].m_area.SetTop(130); - m_glowInfo[5].m_area.SetRight(438); - m_glowInfo[5].m_area.SetBottom(176); + m_glowInfo[5].m_area = MxRect(392, 130, 438, 176); m_glowInfo[5].m_unk0x04 = 14; m_glowInfo[6].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Cop_A_Bitmap"); assert(m_glowInfo[6].m_destCtl); - m_glowInfo[6].m_area.SetLeft(396); - m_glowInfo[6].m_area.SetTop(229); - m_glowInfo[6].m_area.SetRight(442); - m_glowInfo[6].m_area.SetBottom(272); + m_glowInfo[6].m_area = MxRect(396, 229, 442, 272); m_glowInfo[6].m_unk0x04 = 15; m_frame = (MxStillPresenter*) Find("MxStillPresenter", "FrameHot_Bitmap"); diff --git a/LEGO1/lego/sources/misc/legoutil.h b/LEGO1/lego/sources/misc/legoutil.h index fc42d462..871a9b72 100644 --- a/LEGO1/lego/sources/misc/legoutil.h +++ b/LEGO1/lego/sources/misc/legoutil.h @@ -1,6 +1,9 @@ #ifndef __LEGOUTIL_H #define __LEGOUTIL_H +// Exclude from modern compilers due to clash with mxutilities.h +#ifndef COMPAT_MODE + template inline T Min(T p_t1, T p_t2) { @@ -31,6 +34,8 @@ inline T Abs(T p_t) return p_t < 0 ? -p_t : p_t; } +#endif + template inline void Swap(T& p_t1, T& p_t2) { diff --git a/LEGO1/omni/include/mxgeometry.h b/LEGO1/omni/include/mxgeometry.h new file mode 100644 index 00000000..073b5471 --- /dev/null +++ b/LEGO1/omni/include/mxgeometry.h @@ -0,0 +1,604 @@ +#ifndef MXGEOMETRY_H +#define MXGEOMETRY_H + +#include "mxlist.h" +#include "mxutilities.h" + +template +class MxPoint { +protected: + T m_x; + T m_y; + +public: + MxPoint() {} + MxPoint(const MxPoint& p_p) + { + m_x = p_p.m_x; + m_y = p_p.m_y; + } + MxPoint(T p_x, T p_y) + { + m_x = p_x; + m_y = p_y; + } + T GetX() const { return m_x; } + T GetY() const { return m_y; } + void SetX(T p_x) { m_x = p_x; } + void SetY(T p_y) { m_y = p_y; } + void operator+=(const MxPoint& p_p) + { + m_x += p_p.m_x; + m_y += p_p.m_y; + } + void operator-=(const MxPoint& p_p) + { + m_x -= p_p.m_x; + m_y -= p_p.m_y; + } + MxPoint operator+(const MxPoint& p_p) const { return MxPoint(m_x + p_p.m_x, m_y + p_p.m_y); } + MxPoint operator-(const MxPoint& p_p) const { return MxPoint(m_x - p_p.m_x, m_y - p_p.m_y); } +}; + +template +class MxSize { +protected: + T m_width; + T m_height; + +public: + MxSize() {} + MxSize(const MxSize& p_s) + { + m_width = p_s.m_width; + m_height = p_s.m_height; + } + MxSize(T p_width, T p_height) + { + m_width = p_width; + m_height = p_height; + } + T GetWidth() const { return m_width; } + T GetHeight() const { return m_height; } + void SetWidth(T p_width) { m_width = p_width; } + void SetHeight(T p_height) { m_height = p_height; } +}; + +template +class MxRect { +protected: + T m_left; + T m_top; + T m_right; + T m_bottom; + +public: + MxRect() {} + MxRect(const MxRect& p_r) + { + m_left = p_r.m_left; + m_top = p_r.m_top; + m_right = p_r.m_right; + m_bottom = p_r.m_bottom; + } + MxRect(T p_l, T p_t, T p_r, T p_b) + { + m_left = p_l; + m_top = p_t; + m_right = p_r; + m_bottom = p_b; + } + MxRect(const MxPoint& p_p, const MxSize& p_s) + { + m_left = p_p.GetX(); + m_top = p_p.GetY(); + m_right = p_p.GetX() + p_s.GetWidth() - 1; + m_bottom = p_p.GetY() + p_s.GetHeight() - 1; + } + T GetLeft() const { return m_left; } + void SetLeft(T p_left) { m_left = p_left; } + T GetTop() const { return m_top; } + void SetTop(T p_top) { m_top = p_top; } + T GetRight() const { return m_right; } + void SetRight(T p_right) { m_right = p_right; } + T GetBottom() const { return m_bottom; } + void SetBottom(T p_bottom) { m_bottom = p_bottom; } + T GetWidth() const { return (m_right - m_left + 1); } + T GetHeight() const { return (m_bottom - m_top + 1); } + MxPoint GetLT() const { return MxPoint(m_left, m_top); } + MxPoint GetRB() const { return MxPoint(m_right, m_bottom); } + MxBool Empty() const { return m_left >= m_right || m_top >= m_bottom; } + MxBool Contains(const MxPoint& p_p) const + { + return p_p.GetX() >= m_left && p_p.GetX() <= m_right && p_p.GetY() >= m_top && p_p.GetY() <= m_bottom; + } + MxBool Intersects(const MxRect& p_r) const + { + return p_r.m_right > m_left && p_r.m_left < m_right && p_r.m_bottom > m_top && p_r.m_top < m_bottom; + } + void operator=(const MxRect& p_r) + { + m_left = p_r.m_left; + m_top = p_r.m_top; + m_right = p_r.m_right; + m_bottom = p_r.m_bottom; + } + MxBool operator==(const MxRect& p_r) const + { + return m_left == p_r.m_left && m_top == p_r.m_top && m_right == p_r.m_right && m_bottom == p_r.m_bottom; + } + MxBool operator!=(const MxRect& p_r) const { return !operator==(p_r); } + void operator+=(const MxPoint& p_p) + { + m_left += p_p.GetX(); + m_top += p_p.GetY(); + m_right += p_p.GetX(); + m_bottom += p_p.GetY(); + } + void operator-=(const MxPoint& p_p) + { + m_left -= p_p.GetX(); + m_top -= p_p.GetY(); + m_right -= p_p.GetX(); + m_bottom -= p_p.GetY(); + } + void operator&=(const MxRect& p_r) + { + m_left = Max(p_r.m_left, m_left); + m_top = Max(p_r.m_top, m_top); + m_right = Min(p_r.m_right, m_right); + m_bottom = Min(p_r.m_bottom, m_bottom); + } + void operator|=(const MxRect& p_r) + { + m_left = Min(p_r.m_left, m_left); + m_top = Min(p_r.m_top, m_top); + m_right = Max(p_r.m_right, m_right); + m_bottom = Max(p_r.m_bottom, m_bottom); + } + MxRect operator+(const MxPoint& p_p) const + { + return MxRect(m_left + p_p.GetX(), m_top + p_p.GetY(), m_left + p_p.GetX(), m_bottom + p_p.GetY()); + } + MxRect operator-(const MxPoint& p_p) const + { + return MxRect(m_left - p_p.GetX(), m_top - p_p.GetY(), m_left - p_p.GetX(), m_bottom - p_p.GetY()); + } + MxRect operator&(const MxRect& p_r) const + { + return MxRect( + Max(p_r.m_left, m_left), + Max(p_r.m_top, m_top), + Min(p_r.m_right, m_right), + Min(p_r.m_bottom, m_bottom) + ); + } + MxRect operator|(const MxRect& p_r) const + { + return MxRect( + Min(p_r.m_left, m_left), + Min(p_r.m_top, m_top), + Max(p_r.m_right, m_right), + Max(p_r.m_bottom, m_bottom) + ); + } +}; + +/******************************* MxPoint16 **********************************/ + +// SIZE 0x04 +class MxPoint16 : public MxPoint { +public: + MxPoint16() {} + MxPoint16(const MxPoint16& p_p) : MxPoint(p_p) {} + MxPoint16(MxS16 p_x, MxS16 p_y) : MxPoint(p_x, p_y) {} +}; + +class MxPoint16List : public MxPtrList { +public: + MxPoint16List(MxBool p_ownership) : MxPtrList(p_ownership) {} +}; + +class MxPoint16ListCursor : public MxPtrListCursor { +public: + MxPoint16ListCursor(MxPoint16List* p_list) : MxPtrListCursor(p_list) {} +}; + +/******************************* MxPoint32 **********************************/ + +// SIZE 0x08 +class MxPoint32 : public MxPoint { +public: + // FUNCTION: BETA10 0x10054d10 + MxPoint32() {} + + // FUNCTION: BETA10 0x10031a50 + MxPoint32(const MxPoint32& p_p) : MxPoint(p_p) {} + + // FUNCTION: LEGO1 0x10012170 + // FUNCTION: BETA10 0x1006aa70 + MxPoint32(MxS32 p_x, MxS32 p_y) : MxPoint(p_x, p_y) {} +}; + +class MxPoint32List : public MxPtrList { +public: + MxPoint32List(MxBool p_ownership) : MxPtrList(p_ownership) {} +}; + +class MxPoint32ListCursor : public MxPtrListCursor { +public: + MxPoint32ListCursor(MxPoint32List* p_list) : MxPtrListCursor(p_list) {} +}; + +// TEMPLATE: BETA10 0x10031a80 +// ??0?$MxPoint@H@@QAE@ABV0@@Z + +// TEMPLATE: BETA10 0x100318f0 +// MxPoint::GetX + +// TEMPLATE: BETA10 0x10031920 +// MxPoint::GetY + +// TEMPLATE: BETA10 0x10031cf0 +// ??0?$MxPoint@H@@QAE@HH@Z + +// TEMPLATE: BETA10 0x10054d40 +// ??0?$MxPoint@H@@QAE@XZ + +// TEMPLATE: BETA10 0x10142c90 +// MxPoint::SetX + +// TEMPLATE: BETA10 0x10142cb0 +// MxPoint::SetY + +/******************************** MxSize16 **********************************/ + +// SIZE 0x04 +class MxSize16 : public MxSize { +public: + MxSize16() {} + MxSize16(const MxSize16& p_s) : MxSize(p_s) {} + MxSize16(MxS16 p_width, MxS16 p_height) : MxSize(p_width, p_height) {} +}; + +class MxSize16List : public MxPtrList { +public: + MxSize16List(MxBool p_ownership) : MxPtrList(p_ownership) {} +}; + +class MxSize16ListCursor : public MxPtrListCursor { +public: + MxSize16ListCursor(MxSize16List* p_list) : MxPtrListCursor(p_list) {} +}; + +/******************************** MxSize32 **********************************/ + +// SIZE 0x08 +class MxSize32 : public MxSize { +public: + MxSize32() {} + MxSize32(const MxSize32& p_s) : MxSize(p_s) {} + + // FUNCTION: BETA10 0x10137030 + MxSize32(MxS32 p_width, MxS32 p_height) : MxSize(p_width, p_height) {} +}; + +class MxSize32List : public MxPtrList { +public: + MxSize32List(MxBool p_ownership) : MxPtrList(p_ownership) {} +}; + +class MxSize32ListCursor : public MxPtrListCursor { +public: + MxSize32ListCursor(MxSize32List* p_list) : MxPtrListCursor(p_list) {} +}; + +// TEMPLATE: BETA10 0x10031820 +// ??0?$MxSize@H@@QAE@HH@Z + +// TEMPLATE: BETA10 0x10031950 +// MxSize::GetWidth + +// TEMPLATE: BETA10 0x10031980 +// MxSize::GetHeight + +/******************************** MxRect16 **********************************/ + +// SIZE 0x08 +class MxRect16 : public MxRect { +public: + // FUNCTION: BETA10 0x10097eb0 + MxRect16() {} + MxRect16(const MxRect16& p_r) : MxRect(p_r) {} + MxRect16(MxS16 p_l, MxS16 p_t, MxS16 p_r, MxS16 p_b) : MxRect(p_l, p_t, p_r, p_b) {} + MxRect16(MxPoint16& p_p, MxSize16& p_s) : MxRect(p_p, p_s) {} +}; + +class MxRect16List : public MxPtrList { +public: + MxRect16List(MxBool p_ownership) : MxPtrList(p_ownership) {} +}; + +class MxRect16ListCursor : public MxPtrListCursor { +public: + MxRect16ListCursor(MxRect16List* p_list) : MxPtrListCursor(p_list) {} +}; + +// TEMPLATE: BETA10 0x10097ee0 +// ??0?$MxRect@F@@QAE@XZ + +// TEMPLATE: BETA10 0x100981f0 +// MxRect::SetLeft + +// TEMPLATE: BETA10 0x10098220 +// MxRect::SetTop + +// TEMPLATE: BETA10 0x10098250 +// MxRect::SetRight + +// TEMPLATE: BETA10 0x10098280 +// MxRect::SetBottom + +// TEMPLATE: BETA10 0x10098300 +// MxRect::GetLeft + +// TEMPLATE: BETA10 0x10098330 +// MxRect::GetTop + +// TEMPLATE: BETA10 0x10098360 +// MxRect::GetBottom + +// TEMPLATE: BETA10 0x10098390 +// MxRect::GetWidth + +// TEMPLATE: BETA10 0x100983c0 +// MxRect::GetHeight + +/******************************** MxRect32 **********************************/ + +// SIZE 0x10 +class MxRect32 : public MxRect { +public: + // FUNCTION: BETA10 0x1012df70 + MxRect32() {} + + // FUNCTION: BETA10 0x1012de40 + MxRect32(const MxRect32& p_r) : MxRect(p_r) {} + + // FUNCTION: BETA10 0x100d8e90 + MxRect32(MxS32 p_l, MxS32 p_t, MxS32 p_r, MxS32 p_b) : MxRect(p_l, p_t, p_r, p_b) {} + +#ifndef COMPAT_MODE + // FUNCTION: LEGO1 0x100b6fc0 + // FUNCTION: BETA10 0x10137060 + MxRect32(MxPoint32& p_p, MxSize32& p_s) : MxRect(p_p, p_s) {} +#else + MxRect32(const MxPoint32& p_p, const MxSize32& p_s) : MxRect(p_p, p_s) {} +#endif +}; + +// VTABLE: LEGO1 0x100dc3f0 +// VTABLE: BETA10 0x101c1fb8 +// SIZE 0x18 +class MxRect32List : public MxPtrList { +public: + // FUNCTION: BETA10 0x1013b980 + MxRect32List(MxBool p_ownership) : MxPtrList(p_ownership) {} +}; + +// VTABLE: LEGO1 0x100dc438 +// VTABLE: BETA10 0x101c2048 +// class MxListCursor + +// VTABLE: LEGO1 0x100dc408 +// VTABLE: BETA10 0x101c2030 +// class MxPtrListCursor + +// VTABLE: LEGO1 0x100dc420 +// VTABLE: BETA10 0x101c2018 +// SIZE 0x10 +class MxRect32ListCursor : public MxPtrListCursor { +public: + // FUNCTION: BETA10 0x1013bf10 + MxRect32ListCursor(MxRect32List* p_list) : MxPtrListCursor(p_list) {} +}; + +// TEMPLATE: BETA10 0x10031800 +// ??0?$MxRect@H@@QAE@XZ + +// TEMPLATE: BETA10 0x10031860 +// ??0?$MxRect@H@@QAE@ABV?$MxPoint@H@@ABV?$MxSize@H@@@Z + +// TEMPLATE: BETA10 0x100319b0 +// MxRect::operator= + +// TEMPLATE: BETA10 0x100d8090 +// MxRect::GetWidth + +// TEMPLATE: BETA10 0x100d80c0 +// MxRect::GetHeight + +// TEMPLATE: BETA10 0x100d8ed0 +// ??0?$MxRect@H@@QAE@HHHH@Z + +// TEMPLATE: BETA10 0x100ec100 +// MxRect::GetLeft + +// TEMPLATE: BETA10 0x100ec130 +// MxRect::GetTop + +// TEMPLATE: BETA10 0x100ec160 +// MxRect::GetRight + +// TEMPLATE: BETA10 0x100ec190 +// MxRect::GetBottom + +// TEMPLATE: BETA10 0x100ec1c0 +// MxRect::operator+= + +// TEMPLATE: BETA10 0x1012de70 +// ??0?$MxRect@H@@QAE@ABV0@@Z + +// TEMPLATE: BETA10 0x1012dec0 +// MxRect::operator&= + +// SYNTHETIC: BETA10 0x1012dfa0 +// MxRect32::operator= + +// TEMPLATE: BETA10 0x10031d30 +// MxRect::Contains + +// TEMPLATE: BETA10 0x10137090 +// MxRect::Intersects + +// TEMPLATE: BETA10 0x10137100 +// MxRect::operator-= + +// TEMPLATE: BETA10 0x1014b320 +// MxRect::operator|= + +// TEMPLATE: BETA10 0x1014b2d0 +// MxRect::Empty + +// TEMPLATE: BETA10 0x1014bd80 +// MxRect::SetLeft + +// TEMPLATE: BETA10 0x1014b270 +// MxRect::SetTop + +// TEMPLATE: BETA10 0x1014bda0 +// MxRect::SetRight + +// TEMPLATE: BETA10 0x1014b2a0 +// MxRect::SetBottom + +// VTABLE: LEGO1 0x100dc3d8 +// VTABLE: BETA10 0x101c1fd0 +// class MxPtrList + +// VTABLE: LEGO1 0x100dc450 +// VTABLE: BETA10 0x101c1fe8 +// class MxList + +// VTABLE: LEGO1 0x100dc468 +// VTABLE: BETA10 0x101c2000 +// class MxCollection + +// TEMPLATE: LEGO1 0x100b3c00 +// TEMPLATE: BETA10 0x1013ba00 +// MxCollection::Compare + +// TEMPLATE: LEGO1 0x100b3c10 +// TEMPLATE: BETA10 0x1013bb30 +// MxCollection::MxCollection + +// TEMPLATE: LEGO1 0x100b3c80 +// TEMPLATE: BETA10 0x1013bbc0 +// MxCollection::~MxCollection + +// TEMPLATE: LEGO1 0x100b3cd0 +// TEMPLATE: BETA10 0x1013bc60 +// MxCollection::Destroy + +// TEMPLATE: LEGO1 0x100b3ce0 +// TEMPLATE: BETA10 0x1013bc70 +// MxList::~MxList + +// TEMPLATE: LEGO1 0x100b3d70 +// TEMPLATE: BETA10 0x1013bd20 +// MxPtrList::Destroy + +// SYNTHETIC: LEGO1 0x100b3d80 +// SYNTHETIC: BETA10 0x1013bd50 +// MxRect32List::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100b3df0 +// TEMPLATE: BETA10 0x1013bd90 +// MxPtrList::~MxPtrList + +// SYNTHETIC: LEGO1 0x100b3e40 +// SYNTHETIC: BETA10 0x1013bdf0 +// MxCollection::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100b3eb0 +// SYNTHETIC: BETA10 0x1013be30 +// MxList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100b3f60 +// SYNTHETIC: BETA10 0x1013be70 +// MxPtrList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100b3fd0 +// SYNTHETIC: BETA10 0x1013beb0 +// MxRect32List::~MxRect32List + +// SYNTHETIC: LEGO1 0x100b4020 +// SYNTHETIC: BETA10 0x1013c0a0 +// MxRect32ListCursor::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100b4090 +// TEMPLATE: BETA10 0x1013c0e0 +// MxPtrListCursor::~MxPtrListCursor + +// SYNTHETIC: LEGO1 0x100b40e0 +// SYNTHETIC: BETA10 0x1013c140 +// MxListCursor::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100b4150 +// SYNTHETIC: BETA10 0x1013c180 +// MxPtrListCursor::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100b41c0 +// TEMPLATE: BETA10 0x1013c1c0 +// MxListCursor::~MxListCursor + +// SYNTHETIC: LEGO1 0x100b4210 +// SYNTHETIC: BETA10 0x1013c220 +// MxRect32ListCursor::~MxRect32ListCursor + +// TEMPLATE: BETA10 0x1013ba20 +// MxPtrList::MxPtrList + +// TEMPLATE: BETA10 0x1013baa0 +// MxList::MxList + +// TEMPLATE: BETA10 0x1013bc30 +// MxCollection::SetDestroy + +// TEMPLATE: BETA10 0x1013bce0 +// MxPtrList::SetOwnership + +// TEMPLATE: BETA10 0x1013bf90 +// MxPtrListCursor::MxPtrListCursor + +// TEMPLATE: BETA10 0x1013c010 +// MxListCursor::MxListCursor + +// TEMPLATE: BETA10 0x1013c3c0 +// MxList::DeleteAll + +// TEMPLATE: BETA10 0x1013c450 +// MxListCursor::Next + +// TEMPLATE: BETA10 0x1013c610 +// MxListEntry::GetNext + +// TEMPLATE: BETA10 0x1013c630 +// MxListEntry::GetValue + +// TEMPLATE: BETA10 0x10152860 +// MxList::Append + +// TEMPLATE: BETA10 0x10152890 +// MxList::InsertEntry + +// TEMPLATE: BETA10 0x10152980 +// MxListEntry::MxListEntry + +// TEMPLATE: BETA10 0x101529c0 +// MxListEntry::SetPrev + +// TEMPLATE: BETA10 0x101529f0 +// MxListEntry::SetNext + +#endif // MXGEOMETRY_H diff --git a/LEGO1/omni/include/mxpoint32.h b/LEGO1/omni/include/mxpoint32.h deleted file mode 100644 index b3ee2267..00000000 --- a/LEGO1/omni/include/mxpoint32.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef MXPOINT32_H -#define MXPOINT32_H - -#include "mxtypes.h" - -class MxPoint32 { -public: - MxPoint32() {} - - // FUNCTION: LEGO1 0x10012170 - MxPoint32(MxS32 p_x, MxS32 p_y) { CopyFrom(p_x, p_y); } - - MxPoint32(const MxPoint32& p_point) - { - this->m_x = p_point.m_x; - this->m_y = p_point.m_y; - } - - MxS32 GetX() const { return m_x; } - MxS32 GetY() const { return m_y; } - - void SetX(MxS32 p_x) { m_x = p_x; } - void SetY(MxS32 p_y) { m_y = p_y; } - -private: - void CopyFrom(MxS32 p_x, MxS32 p_y) - { - this->m_x = p_x; - this->m_y = p_y; - } - - MxS32 m_x; // 0x00 - MxS32 m_y; // 0x04 -}; - -#endif // MXPOINT32_H diff --git a/LEGO1/omni/include/mxpresenter.h b/LEGO1/omni/include/mxpresenter.h index 3151704e..e257f3c4 100644 --- a/LEGO1/omni/include/mxpresenter.h +++ b/LEGO1/omni/include/mxpresenter.h @@ -4,7 +4,7 @@ #include "decomp.h" #include "mxcore.h" #include "mxcriticalsection.h" -#include "mxpoint32.h" +#include "mxgeometry.h" class MxCompositePresenter; class MxDSAction; diff --git a/LEGO1/omni/include/mxrect16.h b/LEGO1/omni/include/mxrect16.h deleted file mode 100644 index 43e46548..00000000 --- a/LEGO1/omni/include/mxrect16.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef MXRECT16_H -#define MXRECT16_H - -#include "mxtypes.h" - -// SIZE 0x08 -struct MxRect16 { - // FUNCTION: BETA10 0x10097ee0 - MxRect16() {} - - // FUNCTION: BETA10 0x100981f0 - void SetLeft(MxS16 p_left) { m_left = p_left; } - - // FUNCTION: BETA10 0x10098220 - void SetTop(MxS16 p_top) { m_top = p_top; } - - // FUNCTION: BETA10 0x10098250 - void SetRight(MxS16 p_right) { m_right = p_right; } - - // FUNCTION: BETA10 0x10098280 - void SetBottom(MxS16 p_bottom) { m_bottom = p_bottom; } - - // FUNCTION: BETA10 0x10098300 - MxS16 GetLeft() const { return m_left; } - - // FUNCTION: BETA10 0x10098330 - MxS16 GetTop() const { return m_top; } - - // There is no GetRight() - - // FUNCTION: BETA10 0x10098360 - MxS16 GetBottom() const { return m_bottom; } - - // FUNCTION: BETA10 0x10098390 - MxS16 GetWidth() const { return m_right - m_left + 1; } - - // FUNCTION: BETA10 0x100983c0 - MxS16 GetHeight() const { return m_bottom - m_top + 1; } - -private: - MxS16 m_left; // 0x00 - MxS16 m_top; // 0x02 - MxS16 m_right; // 0x04 - MxS16 m_bottom; // 0x06 -}; - -#endif // MXRECT16_H diff --git a/LEGO1/omni/include/mxrect32.h b/LEGO1/omni/include/mxrect32.h deleted file mode 100644 index 1461cbb9..00000000 --- a/LEGO1/omni/include/mxrect32.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef MXRECT32_H -#define MXRECT32_H - -#include "mxpoint32.h" -#include "mxsize32.h" - -// SIZE 0x10 -class MxRect32 { -public: - MxRect32() {} - MxRect32(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) { CopyFrom(p_left, p_top, p_right, p_bottom); } - MxRect32(const MxPoint32& p_point, const MxSize32& p_size) { CopyFrom(p_point, p_size); } - MxRect32(const MxRect32& p_a, const MxRect32& p_b) - { - m_left = Max(p_a.m_left, p_b.m_left); - m_top = Max(p_a.m_top, p_b.m_top); - m_right = Min(p_a.m_right, p_b.m_right); - m_bottom = Min(p_a.m_bottom, p_b.m_bottom); - } - - MxRect32(const MxRect32& p_rect) { CopyFrom(p_rect); } - - MxRect32& operator=(const MxRect32& p_rect) - { - CopyFrom(p_rect); - return *this; - } - - void Intersect(const MxRect32& p_rect) - { - m_left = Max(p_rect.m_left, m_left); - m_top = Max(p_rect.m_top, m_top); - m_right = Min(p_rect.m_right, m_right); - m_bottom = Min(p_rect.m_bottom, m_bottom); - } - - void SetPoint(const MxPoint32& p_point) - { - this->m_left = p_point.GetX(); - this->m_top = p_point.GetY(); - } - - void AddPoint(const MxPoint32& p_point) - { - this->m_left += p_point.GetX(); - this->m_top += p_point.GetY(); - this->m_right += p_point.GetX(); - this->m_bottom += p_point.GetY(); - } - - void SubtractPoint(const MxPoint32& p_point) - { - this->m_left -= p_point.GetX(); - this->m_top -= p_point.GetY(); - this->m_right -= p_point.GetX(); - this->m_bottom -= p_point.GetY(); - } - - void UpdateBounds(const MxRect32& p_rect) - { - m_left = Min(m_left, p_rect.m_left); - m_top = Min(m_top, p_rect.m_top); - m_right = Max(m_right, p_rect.m_right); - m_bottom = Max(m_bottom, p_rect.m_bottom); - } - - MxBool IsValid() const { return m_left < m_right && m_top < m_bottom; } - - MxBool IntersectsWith(const MxRect32& p_rect) const - { - return m_left < p_rect.m_right && p_rect.m_left < m_right && m_top < p_rect.m_bottom && p_rect.m_top < m_bottom; - } - - MxS32 GetWidth() const { return (m_right - m_left) + 1; } - MxS32 GetHeight() const { return (m_bottom - m_top) + 1; } - - MxPoint32 GetPoint() const { return MxPoint32(this->m_left, this->m_top); } - MxSize32 GetSize() const { return MxSize32(this->m_right, this->m_bottom); } - - MxS32 GetLeft() const { return m_left; } - MxS32 GetTop() const { return m_top; } - MxS32 GetRight() const { return m_right; } - MxS32 GetBottom() const { return m_bottom; } - - void SetLeft(MxS32 p_left) { m_left = p_left; } - void SetTop(MxS32 p_top) { m_top = p_top; } - void SetRight(MxS32 p_right) { m_right = p_right; } - void SetBottom(MxS32 p_bottom) { m_bottom = p_bottom; } - -private: - void CopyFrom(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) - { - this->m_left = p_left; - this->m_top = p_top; - this->m_right = p_right; - this->m_bottom = p_bottom; - } - - void CopyFrom(const MxRect32& p_rect) - { - this->m_left = p_rect.m_left; - this->m_top = p_rect.m_top; - this->m_right = p_rect.m_right; - this->m_bottom = p_rect.m_bottom; - } - - // The address might also be the constructor that calls CopyFrom - // FUNCTION: LEGO1 0x100b6fc0 - MxRect32* CopyFrom(const MxPoint32& p_point, const MxSize32& p_size) - { - this->m_left = p_point.GetX(); - this->m_top = p_point.GetY(); - this->m_right = p_size.GetWidth() + p_point.GetX() - 1; - this->m_bottom = p_size.GetHeight() + p_point.GetY() - 1; - return this; - } - - static MxS32 Min(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_a : p_b; } - static MxS32 Max(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_b : p_a; } - - MxS32 m_left; // 0x00 - MxS32 m_top; // 0x04 - MxS32 m_right; // 0x08 - MxS32 m_bottom; // 0x0c -}; - -#endif // MXRECT32_H diff --git a/LEGO1/omni/include/mxrectlist.h b/LEGO1/omni/include/mxrectlist.h deleted file mode 100644 index c4be8dcd..00000000 --- a/LEGO1/omni/include/mxrectlist.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef MXRECTLIST_H -#define MXRECTLIST_H - -#include "mxlist.h" -#include "mxrect32.h" - -// VTABLE: LEGO1 0x100dc3f0 -// VTABLE: BETA10 0x101c1fb8 -// SIZE 0x18 -class MxRectList : public MxPtrList { -public: - // FUNCTION: BETA10 0x1013b980 - MxRectList(MxBool p_ownership = FALSE) : MxPtrList(p_ownership) {} -}; - -// VTABLE: LEGO1 0x100dc438 -// VTABLE: BETA10 0x101c2048 -// class MxListCursor - -// VTABLE: LEGO1 0x100dc408 -// VTABLE: BETA10 0x101c2030 -// class MxPtrListCursor - -// VTABLE: LEGO1 0x100dc420 -// VTABLE: BETA10 0x101c2018 -class MxRectListCursor : public MxPtrListCursor { -public: - // FUNCTION: BETA10 0x1013bf10 - MxRectListCursor(MxRectList* p_list) : MxPtrListCursor(p_list) {} -}; - -// VTABLE: LEGO1 0x100dc3d8 -// VTABLE: BETA10 0x101c1fd0 -// class MxPtrList - -// VTABLE: LEGO1 0x100dc450 -// VTABLE: BETA10 0x101c1fe8 -// class MxList - -// VTABLE: LEGO1 0x100dc468 -// VTABLE: BETA10 0x101c2000 -// class MxCollection - -// TEMPLATE: LEGO1 0x100b3c00 -// TEMPLATE: BETA10 0x1013ba00 -// MxCollection::Compare - -// TEMPLATE: LEGO1 0x100b3c10 -// TEMPLATE: BETA10 0x1013bb30 -// MxCollection::MxCollection - -// TEMPLATE: LEGO1 0x100b3c80 -// TEMPLATE: BETA10 0x1013bbc0 -// MxCollection::~MxCollection - -// TEMPLATE: LEGO1 0x100b3cd0 -// TEMPLATE: BETA10 0x1013bc60 -// MxCollection::Destroy - -// TEMPLATE: LEGO1 0x100b3ce0 -// TEMPLATE: BETA10 0x1013bc70 -// MxList::~MxList - -// TEMPLATE: LEGO1 0x100b3d70 -// TEMPLATE: BETA10 0x1013bd20 -// MxPtrList::Destroy - -// SYNTHETIC: LEGO1 0x100b3d80 -// SYNTHETIC: BETA10 0x1013bd50 -// MxRectList::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100b3df0 -// TEMPLATE: BETA10 0x1013bd90 -// MxPtrList::~MxPtrList - -// SYNTHETIC: LEGO1 0x100b3e40 -// SYNTHETIC: BETA10 0x1013bdf0 -// MxCollection::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100b3eb0 -// SYNTHETIC: BETA10 0x1013be30 -// MxList::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100b3f60 -// SYNTHETIC: BETA10 0x1013be70 -// MxPtrList::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100b3fd0 -// SYNTHETIC: BETA10 0x1013beb0 -// MxRectList::~MxRectList - -// SYNTHETIC: LEGO1 0x100b4020 -// SYNTHETIC: BETA10 0x1013c0a0 -// MxRectListCursor::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100b4090 -// TEMPLATE: BETA10 0x1013c0e0 -// MxPtrListCursor::~MxPtrListCursor - -// SYNTHETIC: LEGO1 0x100b40e0 -// SYNTHETIC: BETA10 0x1013c140 -// MxListCursor::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100b4150 -// SYNTHETIC: BETA10 0x1013c180 -// MxPtrListCursor::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100b41c0 -// TEMPLATE: BETA10 0x1013c1c0 -// MxListCursor::~MxListCursor - -// SYNTHETIC: LEGO1 0x100b4210 -// SYNTHETIC: BETA10 0x1013c220 -// MxRectListCursor::~MxRectListCursor - -// TEMPLATE: BETA10 0x1013ba20 -// MxPtrList::MxPtrList - -// TEMPLATE: BETA10 0x1013baa0 -// MxList::MxList - -// TEMPLATE: BETA10 0x1013bc30 -// MxCollection::SetDestroy - -// TEMPLATE: BETA10 0x1013bce0 -// MxPtrList::SetOwnership - -// TEMPLATE: BETA10 0x1013bf90 -// MxPtrListCursor::MxPtrListCursor - -// TEMPLATE: BETA10 0x1013c010 -// MxListCursor::MxListCursor - -// TEMPLATE: BETA10 0x1013c3c0 -// MxList::DeleteAll - -// TEMPLATE: BETA10 0x1013c450 -// MxListCursor::Next - -// TEMPLATE: BETA10 0x1013c610 -// MxListEntry::GetNext - -// TEMPLATE: BETA10 0x1013c630 -// MxListEntry::GetValue - -// TEMPLATE: BETA10 0x10152860 -// MxList::Append - -// TEMPLATE: BETA10 0x10152890 -// MxList::InsertEntry - -// TEMPLATE: BETA10 0x10152980 -// MxListEntry::MxListEntry - -// TEMPLATE: BETA10 0x101529c0 -// MxListEntry::SetPrev - -// TEMPLATE: BETA10 0x101529f0 -// MxListEntry::SetNext - -#endif // MXRECTLIST_H diff --git a/LEGO1/omni/include/mxregion.h b/LEGO1/omni/include/mxregion.h index c5f8e31e..997b658e 100644 --- a/LEGO1/omni/include/mxregion.h +++ b/LEGO1/omni/include/mxregion.h @@ -3,8 +3,8 @@ #include "decomp.h" #include "mxcore.h" +#include "mxgeometry.h" #include "mxlist.h" -#include "mxrect32.h" // should be mxgeometry.h // SIZE 0x08 class MxSegment { diff --git a/LEGO1/omni/include/mxsize32.h b/LEGO1/omni/include/mxsize32.h deleted file mode 100644 index 28ac7fcc..00000000 --- a/LEGO1/omni/include/mxsize32.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef MXSIZE32_H -#define MXSIZE32_H - -#include "mxtypes.h" - -class MxSize32 { -public: - MxSize32() {} - MxSize32(MxS32 p_width, MxS32 p_height) { CopyFrom(p_width, p_height); } - - MxS32 GetWidth() const { return m_width; } - MxS32 GetHeight() const { return m_height; } - -private: - void CopyFrom(MxS32 p_width, MxS32 p_height) - { - this->m_width = p_width; - this->m_height = p_height; - } - - MxS32 m_width; - MxS32 m_height; -}; - -#endif // MXSIZE32_H diff --git a/LEGO1/omni/include/mxsmk.h b/LEGO1/omni/include/mxsmk.h index ec611f97..d587149f 100644 --- a/LEGO1/omni/include/mxsmk.h +++ b/LEGO1/omni/include/mxsmk.h @@ -2,7 +2,7 @@ #define MXSMK_H #include "decomp.h" -#include "mxrectlist.h" +#include "mxgeometry.h" #include "mxtypes.h" #include @@ -46,7 +46,7 @@ struct MxSmk { MxSmk* p_mxSmk, MxU8* p_chunkData, MxBool p_paletteChanged, - MxRectList* p_list + MxRect32List* p_list ); static MxBool GetRect(MxU8* p_unk0x6b4, MxU16* p_und, u32* p_smackRect, MxRect32* p_rect); }; diff --git a/LEGO1/omni/include/mxutilities.h b/LEGO1/omni/include/mxutilities.h index c7a2bcfb..51b897b7 100644 --- a/LEGO1/omni/include/mxutilities.h +++ b/LEGO1/omni/include/mxutilities.h @@ -78,4 +78,10 @@ MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags); MxBool KeyValueStringParse(char*, const char*, const char*); +// TEMPLATE: BETA10 0x1012dfd0 +// ?Max@@YAHHH@Z + +// TEMPLATE: BETA10 0x1012dff0 +// ?Min@@YAHHH@Z + #endif // MXUTILITIES_H diff --git a/LEGO1/omni/include/mxvideoparam.h b/LEGO1/omni/include/mxvideoparam.h index e85ead69..c597eaf8 100644 --- a/LEGO1/omni/include/mxvideoparam.h +++ b/LEGO1/omni/include/mxvideoparam.h @@ -2,7 +2,7 @@ #define MXVIDEOPARAM_H #include "compat.h" -#include "mxrect32.h" +#include "mxgeometry.h" #include "mxtypes.h" #include "mxvideoparamflags.h" diff --git a/LEGO1/omni/include/mxvideopresenter.h b/LEGO1/omni/include/mxvideopresenter.h index a1794aec..c95445b9 100644 --- a/LEGO1/omni/include/mxvideopresenter.h +++ b/LEGO1/omni/include/mxvideopresenter.h @@ -3,8 +3,8 @@ #include "decomp.h" #include "mxbitmap.h" +#include "mxgeometry.h" #include "mxmediapresenter.h" -#include "mxrect32.h" #include diff --git a/LEGO1/omni/src/common/mxutilities.cpp b/LEGO1/omni/src/common/mxutilities.cpp index c1a102f5..7845d88f 100644 --- a/LEGO1/omni/src/common/mxutilities.cpp +++ b/LEGO1/omni/src/common/mxutilities.cpp @@ -6,8 +6,8 @@ #include "mxdsfile.h" #include "mxdsmultiaction.h" #include "mxdsobject.h" +#include "mxgeometry.h" #include "mxpresenterlist.h" -#include "mxrect32.h" #include @@ -15,6 +15,7 @@ void (*g_omniUserMessage)(const char*, MxS32) = NULL; // FUNCTION: LEGO1 0x100b6e10 +// FUNCTION: BETA10 0x10136970 MxBool GetRectIntersection( MxS32 p_rect1Width, MxS32 p_rect1Height, @@ -35,22 +36,22 @@ MxBool GetRectIntersection( MxRect32 rect2(MxPoint32(0, 0), MxSize32(p_rect2Width, p_rect2Height)); MxRect32 rect(0, 0, *p_width, *p_height); - rect.AddPoint(rect1Origin); + rect += rect1Origin; - if (!rect.IntersectsWith(rect1)) { + if (!rect.Intersects(rect1)) { return FALSE; } - rect.Intersect(rect1); - rect.SubtractPoint(rect1Origin); - rect.AddPoint(rect2Origin); + rect &= rect1; + rect -= rect1Origin; + rect += rect2Origin; - if (!rect.IntersectsWith(rect2)) { + if (!rect.Intersects(rect2)) { return FALSE; } - rect.Intersect(rect2); - rect.SubtractPoint(rect2Origin); + rect &= rect2; + rect -= rect2Origin; *p_rect1Left += rect.GetLeft(); *p_rect1Top += rect.GetTop(); diff --git a/LEGO1/omni/src/video/mxflcpresenter.cpp b/LEGO1/omni/src/video/mxflcpresenter.cpp index e618ea9e..57b734c1 100644 --- a/LEGO1/omni/src/video/mxflcpresenter.cpp +++ b/LEGO1/omni/src/video/mxflcpresenter.cpp @@ -70,7 +70,7 @@ void MxFlcPresenter::LoadFrame(MxStreamChunk* p_chunk) for (MxS32 i = 0; i < rectCount; i++) { MxRect32 rect(rects[i]); - rect.AddPoint(m_location); + rect += m_location; MVideoManager()->InvalidateRect(rect); } } diff --git a/LEGO1/omni/src/video/mxregion.cpp b/LEGO1/omni/src/video/mxregion.cpp index e2841f23..9b63ff7c 100644 --- a/LEGO1/omni/src/video/mxregion.cpp +++ b/LEGO1/omni/src/video/mxregion.cpp @@ -39,7 +39,7 @@ void MxRegion::AddRect(MxRect32& p_rect) MxSpanListCursor cursor(m_spanList); MxSpan* span; - while (rect.IsValid() && cursor.Next(span)) { + while (!rect.Empty() && cursor.Next(span)) { if (span->GetMin() >= rect.GetBottom()) { MxSpan* newSpan = new MxSpan(rect); cursor.Prepend(newSpan); @@ -75,19 +75,19 @@ void MxRegion::AddRect(MxRect32& p_rect) } } - if (rect.IsValid()) { + if (!rect.Empty()) { MxSpan* newSpan = new MxSpan(rect); m_spanList->Append(newSpan); } - m_boundingRect.UpdateBounds(p_rect); + m_boundingRect |= p_rect; } // FUNCTION: LEGO1 0x100c3e20 // FUNCTION: BETA10 0x10149535 MxBool MxRegion::Intersects(MxRect32& p_rect) { - if (!m_boundingRect.IntersectsWith(p_rect)) { + if (!m_boundingRect.Intersects(p_rect)) { return FALSE; } @@ -253,7 +253,7 @@ MxRect32* MxRegionCursor::Next(MxRect32& p_rect) if (span->IntersectsV(p_rect) && segment->IntersectsH(p_rect)) { SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); - m_rect->Intersect(p_rect); + *m_rect &= p_rect; } else { NextSpan(p_rect); @@ -278,7 +278,7 @@ MxRect32* MxRegionCursor::Prev(MxRect32& p_rect) if (span->IntersectsV(p_rect) && segment->IntersectsH(p_rect)) { SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); - m_rect->Intersect(p_rect); + *m_rect &= p_rect; } else { PrevSpan(p_rect); @@ -351,7 +351,7 @@ void MxRegionCursor::NextSpan(MxRect32& p_rect) if (p_rect.GetLeft() < segment->GetMax()) { SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); - m_rect->Intersect(p_rect); + *m_rect &= p_rect; return; } } @@ -382,7 +382,7 @@ void MxRegionCursor::PrevSpan(MxRect32& p_rect) if (segment->GetMin() < p_rect.GetRight()) { SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); - m_rect->Intersect(p_rect); + *m_rect &= p_rect; return; } } diff --git a/LEGO1/omni/src/video/mxsmk.cpp b/LEGO1/omni/src/video/mxsmk.cpp index 0f2bdd77..b0affc4b 100644 --- a/LEGO1/omni/src/video/mxsmk.cpp +++ b/LEGO1/omni/src/video/mxsmk.cpp @@ -165,7 +165,7 @@ MxResult MxSmk::LoadFrame( MxSmk* p_mxSmk, MxU8* p_chunkData, MxBool p_paletteChanged, - MxRectList* p_list + MxRect32List* p_list ) { p_bitmapInfo->m_bmiHeader.biHeight = -MxBitmap::HeightAbs(p_bitmapInfo->m_bmiHeader.biHeight); diff --git a/LEGO1/omni/src/video/mxsmkpresenter.cpp b/LEGO1/omni/src/video/mxsmkpresenter.cpp index 5bbddbe9..aa21f6ee 100644 --- a/LEGO1/omni/src/video/mxsmkpresenter.cpp +++ b/LEGO1/omni/src/video/mxsmkpresenter.cpp @@ -72,7 +72,7 @@ void MxSmkPresenter::LoadFrame(MxStreamChunk* p_chunk) m_currentFrame++; VTable0x88(); - MxRectList rects(TRUE); + MxRect32List rects(TRUE); MxSmk::LoadFrame(bitmapInfo, bitmapData, &m_mxSmk, chunkData, paletteChanged, &rects); if (((MxDSMediaAction*) m_action)->GetPaletteManagement() && paletteChanged) { @@ -80,12 +80,12 @@ void MxSmkPresenter::LoadFrame(MxStreamChunk* p_chunk) } MxRect32 invalidateRect; - MxRectListCursor cursor(&rects); + MxRect32ListCursor cursor(&rects); MxRect32* rect; while (cursor.Next(rect)) { invalidateRect = *rect; - invalidateRect.AddPoint(GetLocation()); + invalidateRect += GetLocation(); MVideoManager()->InvalidateRect(invalidateRect); } } diff --git a/LEGO1/omni/src/video/mxstillpresenter.cpp b/LEGO1/omni/src/video/mxstillpresenter.cpp index 7074ae26..03ffcb31 100644 --- a/LEGO1/omni/src/video/mxstillpresenter.cpp +++ b/LEGO1/omni/src/video/mxstillpresenter.cpp @@ -148,20 +148,21 @@ void MxStillPresenter::RepeatingTickle() } // FUNCTION: LEGO1 0x100ba040 +// FUNCTION: BETA10 0x10142724 void MxStillPresenter::SetPosition(MxS32 p_x, MxS32 p_y) { - MxS32 x = m_location.GetX(); - MxS32 y = m_location.GetY(); + MxPoint32 oldLocation(m_location); m_location.SetX(p_x); m_location.SetY(p_y); if (IsEnabled()) { - // Most likely needs to work with MxSize32 and MxPoint32 - MxS32 height = GetHeight() - 1; - MxS32 width = GetWidth() - 1; + MxRect32 area(0, 0, GetWidth() - 1, GetHeight() - 1); - MxRect32 rectA(x, y, width + x, height + y); - MxRect32 rectB(m_location.GetX(), m_location.GetY(), width + m_location.GetX(), height + m_location.GetY()); + MxRect32 rectA(area); + rectA += oldLocation; + + MxRect32 rectB(area); + rectB += m_location; MVideoManager()->InvalidateRect(rectA); MVideoManager()->UpdateView(rectA.GetLeft(), rectA.GetTop(), rectA.GetWidth(), rectA.GetHeight()); diff --git a/LEGO1/omni/src/video/mxvideomanager.cpp b/LEGO1/omni/src/video/mxvideomanager.cpp index 4a6072a0..cde2e1ca 100644 --- a/LEGO1/omni/src/video/mxvideomanager.cpp +++ b/LEGO1/omni/src/video/mxvideomanager.cpp @@ -84,11 +84,12 @@ void MxVideoManager::Destroy(MxBool p_fromDestructor) } // FUNCTION: LEGO1 0x100be3e0 +// FUNCTION: BETA10 0x1012cdaa void MxVideoManager::UpdateRegion() { if (m_region->IsEmpty() == FALSE) { MxRect32 rect(m_region->GetBoundingRect()); - rect.Intersect(m_videoParam.GetRect()); + rect &= m_videoParam.GetRect(); m_displaySurface ->Display(rect.GetLeft(), rect.GetTop(), rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight()); diff --git a/LEGO1/omni/src/video/mxvideopresenter.cpp b/LEGO1/omni/src/video/mxvideopresenter.cpp index a045ae95..7e7c9822 100644 --- a/LEGO1/omni/src/video/mxvideopresenter.cpp +++ b/LEGO1/omni/src/video/mxvideopresenter.cpp @@ -301,7 +301,7 @@ void MxVideoPresenter::PutFrame() MxDisplaySurface* displaySurface = MVideoManager()->GetDisplaySurface(); MxRegion* region = MVideoManager()->GetRegion(); MxRect32 rect(MxPoint32(0, 0), MxSize32(GetWidth(), GetHeight())); - rect.AddPoint(GetLocation()); + rect += GetLocation(); LPDIRECTDRAWSURFACE ddSurface = displaySurface->GetDirectDrawSurface2(); if (m_action->GetFlags() & MxDSAction::c_bit5) {