diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a33e2b9..eabeb295 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: toolchain: - { name: 'MSVC', shell: 'sh', setup-cmake: true, setup-ninja: true, setup-msvc: true } - { name: 'msys2 mingw32', shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686, clang-tidy: true, werror: true } - - { name: 'msys2 clang32', shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686, clang-tidy: true, werror: true, no-dx5-libs: true } + # - { name: 'msys2 clang32', shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686, clang-tidy: true, werror: true, no-dx5-libs: true } steps: - name: Set up MSYS2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 76bdb406..5b337e0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,7 +264,6 @@ function(add_lego_libraries NAME) LEGO1/omni/src/audio/mxloopingmidipresenter.cpp LEGO1/omni/src/event/mxeventpresenter.cpp LEGO1/omni/src/stream/mxstreamchunk.cpp - LEGO1/omni/src/video/mxregioncursor.cpp LEGO1/omni/src/video/mxregion.cpp LEGO1/omni/src/video/mxsmk.cpp LEGO1/omni/src/stream/mxramstreamcontroller.cpp diff --git a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp index 6b24bc80..3449423e 100644 --- a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp @@ -192,7 +192,7 @@ MxBool MxControlPresenter::FUN_10044480(LegoControlManagerNotificationParam* p_p void MxControlPresenter::VTable0x6c(MxS16 p_unk0x4e) { if (p_unk0x4e == -1) { - if ((MxS16) ((MxDSMultiAction*) m_action)->GetActionList()->GetCount() - m_unk0x4e == 1) { + if ((MxS16) ((MxDSMultiAction*) m_action)->GetActionList()->GetNumElements() - m_unk0x4e == 1) { m_unk0x4e = 0; } else { diff --git a/LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp b/LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp index 691ddb40..3a47f2da 100644 --- a/LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp +++ b/LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp @@ -58,7 +58,7 @@ void LegoControlManager::Unregister(MxCore* p_listener) // FUNCTION: LEGO1 0x10029210 MxBool LegoControlManager::FUN_10029210(LegoEventNotificationParam& p_param, MxPresenter* p_presenter) { - if (m_presenterList != NULL && m_presenterList->GetCount() != 0) { + if (m_presenterList != NULL && m_presenterList->GetNumElements() != 0) { m_unk0x14 = p_presenter; if (p_param.GetNotification() == c_notificationButtonUp || diff --git a/LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp index 90b6533e..0272e50d 100644 --- a/LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp @@ -114,7 +114,7 @@ void LegoLocomotionAnimPresenter::StartingTickle() m_subscriber->FreeDataChunk(chunk); } - if (m_roiMapList->GetCount() != 0) { + if (m_roiMapList->GetNumElements() != 0) { ProgressTickleState(e_streaming); } } diff --git a/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp b/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp index 60f33d89..fba9373f 100644 --- a/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp @@ -250,7 +250,7 @@ void LegoPartPresenter::Store() ViewLODList* lodList = GetViewLODListManager()->Lookup(part->GetName()->GetData()); if (lodList == NULL) { - lodList = GetViewLODListManager()->Create(part->GetName()->GetData(), part->GetList()->GetCount()); + lodList = GetViewLODListManager()->Create(part->GetName()->GetData(), part->GetList()->GetNumElements()); LegoLODListCursor lodCursor(part->GetList()); LegoLOD* lod; diff --git a/LEGO1/omni/include/mxlist.h b/LEGO1/omni/include/mxlist.h index 6ab165e2..f6954168 100644 --- a/LEGO1/omni/include/mxlist.h +++ b/LEGO1/omni/include/mxlist.h @@ -52,7 +52,7 @@ public: void Prepend(T p_obj) { InsertEntry(p_obj, NULL, this->m_first); } void DeleteAll(); void Empty(); - MxU32 GetCount() { return this->m_count; } + MxU32 GetNumElements() { return this->m_count; } friend class MxListCursor; using MxCollection::SetDestroy; diff --git a/LEGO1/omni/include/mxregion.h b/LEGO1/omni/include/mxregion.h index d6f5f720..c5f8e31e 100644 --- a/LEGO1/omni/include/mxregion.h +++ b/LEGO1/omni/include/mxregion.h @@ -1,34 +1,559 @@ -#ifndef MXREGION_H -#define MXREGION_H +#ifndef __MXREGION_H +#define __MXREGION_H #include "decomp.h" #include "mxcore.h" -#include "mxrect32.h" -#include "mxregionlist.h" +#include "mxlist.h" +#include "mxrect32.h" // should be mxgeometry.h + +// SIZE 0x08 +class MxSegment { +protected: + MxS32 m_min; // 0x00 + MxS32 m_max; // 0x04 + +public: + // FUNCTION: BETA10 0x1014c360 + MxSegment(MxS32 p_min, MxS32 p_max) + { + m_min = p_min; + m_max = p_max; + } + + // FUNCTION: BETA10 0x1014b910 + MxS32 GetMin() { return m_min; } + + // FUNCTION: BETA10 0x1014b930 + MxS32 GetMax() { return m_max; } + + MxSegment* Clone() { return new MxSegment(m_min, m_max); } + MxBool Combine(MxSegment& p_seg); + MxBool Adjacent(MxSegment& p_seg) { return m_max == p_seg.m_min || m_min == p_seg.m_max; } + MxBool IntersectsH(MxRect32& p_rect) { return p_rect.GetRight() > m_min && p_rect.GetTop() < m_max; } + MxBool operator==(MxSegment& p_seg) { return m_min == p_seg.m_min && m_max == p_seg.m_max; } + MxBool operator!=(MxSegment& p_seg) { return !operator==(p_seg); } +}; + +// VTABLE: LEGO1 0x100dcc40 +// VTABLE: BETA10 0x101c2628 +// class MxCollection + +// VTABLE: LEGO1 0x100dcc58 +// VTABLE: BETA10 0x101c2610 +// class MxList + +// VTABLE: LEGO1 0x100dcc70 +// VTABLE: BETA10 0x101c25f8 +// class MxPtrList + +// VTABLE: LEGO1 0x100dcc88 +// VTABLE: BETA10 0x101c25e0 +// SIZE 0x18 +class MxSegmentList : public MxPtrList { +public: + // FUNCTION: BETA10 0x1014bdd0 + MxSegmentList() : MxPtrList(TRUE) {} + + // SYNTHETIC: LEGO1 0x100c4e90 + // SYNTHETIC: BETA10 0x1014c1a0 + // MxSegmentList::`scalar deleting destructor' +}; + +// VTABLE: LEGO1 0x100dcbf8 +// VTABLE: BETA10 0x101c25b0 +// class MxPtrListCursor + +// VTABLE: LEGO1 0x100dcc28 +// VTABLE: BETA10 0x101c25c8 +// class MxListCursor + +// VTABLE: LEGO1 0x100dcc10 +// VTABLE: BETA10 0x101c2598 +class MxSegmentListCursor : public MxPtrListCursor { +public: + // FUNCTION: BETA10 0x1014ba10 + MxSegmentListCursor(MxSegmentList* p_list) : MxPtrListCursor(p_list) {} +}; + +// SIZE 0x0c +class MxSpan { +protected: + MxS32 m_min; // 0x00 + MxS32 m_max; // 0x04 + MxSegmentList* m_segList; // 0x08 + +public: + MxSpan(MxS32 p_min, MxS32 p_max); + MxSpan(MxRect32& p_rect); + + // FUNCTION: BETA10 0x1014b0f0 + ~MxSpan() { delete m_segList; } + + // FUNCTION: BETA10 0x1014b3b0 + MxS32 GetMin() { return m_min; } + + void SetMin(MxS32 p_min) { m_min = p_min; } + + // FUNCTION: BETA10 0x1014b3f0 + MxS32 GetMax() { return m_max; } + + void SetMax(MxS32 p_max) { m_max = p_max; } + MxSpan* Clone(); + void Compact(); + MxBool Combine(MxSpan& p_span); + MxBool Adjacent(MxSpan& p_span) { return m_max == p_span.m_min || m_min == p_span.m_max; } + MxBool HasSameSegments(MxSpan& p_span); + MxBool IntersectsV(MxRect32& p_rect) { return p_rect.GetBottom() > m_min && p_rect.GetTop() < m_max; } + MxBool IntersectsH(MxRect32& p_rect); + void AddSegment(MxS32 p_min, MxS32 p_max); + MxBool operator==(MxSpan& p_span) + { + return m_min == p_span.m_min && m_max == p_span.m_max && HasSameSegments(p_span); + } + MxBool operator!=(MxSpan& p_span) { return !operator==(p_span); } + friend class MxRegionCursor; + + // SYNTHETIC: BETA10 0x1014b0b0 + // MxSpan::`scalar deleting destructor' +}; + +// VTABLE: LEGO1 0x100dcb10 +// VTABLE: BETA10 0x101c24f8 +// class MxCollection + +// VTABLE: LEGO1 0x100dcb28 +// VTABLE: BETA10 0x101c24e0 +// class MxList + +// VTABLE: LEGO1 0x100dcb40 +// VTABLE: BETA10 0x101c24c8 +// class MxPtrList + +// VTABLE: LEGO1 0x100dcb58 +// VTABLE: BETA10 0x101c24b0 +// SIZE 0x18 +class MxSpanList : public MxPtrList { +public: + // FUNCTION: BETA10 0x1014abb0 + MxSpanList() : MxPtrList(TRUE) {} + + // SYNTHETIC: LEGO1 0x100c3410 + // SYNTHETIC: BETA10 0x1014af90 + // MxSpanList::`scalar deleting destructor' +}; + +// VTABLE: LEGO1 0x100dcb70 +// VTABLE: BETA10 0x101c2528 +// class MxPtrListCursor + +// VTABLE: LEGO1 0x100dcba0 +// VTABLE: BETA10 0x101c2540 +// class MxListCursor + +// TODO: The initialize list param type should be MxSpanList, but doing that +// drastically reduced the match percentage for MxRegion::AddRect. +// (developer provided MxRegion.h file also uses MxSpanList*.) +// It also works with MxPtrList, so we'll do that until we figure this out. + +// VTABLE: LEGO1 0x100dcb88 +// VTABLE: BETA10 0x101c2510 +class MxSpanListCursor : public MxPtrListCursor { +public: + // FUNCTION: BETA10 0x1014b470 + MxSpanListCursor(MxPtrList* p_list) : MxPtrListCursor(p_list) {} +}; // VTABLE: LEGO1 0x100dcae8 // SIZE 0x1c class MxRegion : public MxCore { +protected: + MxSpanList* m_spanList; // 0x08 + MxRect32 m_boundingRect; // 0x0c + public: MxRegion(); ~MxRegion() override; - + MxRect32& GetBoundingRect() { return m_boundingRect; } virtual void Reset(); // vtable+0x14 - virtual void VTable0x18(MxRect32& p_rect); // vtable+0x18 - virtual MxBool VTable0x1c(MxRect32& p_rect); // vtable+0x1c - virtual MxBool VTable0x20(); // vtable+0x20 + virtual void AddRect(MxRect32& p_rect); // vtable+0x18 + virtual MxBool Intersects(MxRect32& p_rect); // vtable+0x1c - MxRegionTopBottomList* GetTopBottomList() const { return m_list; } - const MxRect32& GetRect() const { return m_rect; } + // FUNCTION: LEGO1 0x100c3660 + // FUNCTION: BETA10 0x1014b1d0 + virtual MxBool IsEmpty() { return m_spanList->GetNumElements() == 0; } // vtable+0x20 + void Compact(); friend class MxRegionCursor; // SYNTHETIC: LEGO1 0x100c3670 + // SYNTHETIC: BETA10 0x1014b230 // MxRegion::`scalar deleting destructor' - -private: - MxRegionTopBottomList* m_list; // 0x08 - MxRect32 m_rect; // 0x0c }; -#endif // MXREGION_H +// VTABLE: LEGO1 0x100dcbb8 +// SIZE 0x18 +class MxRegionCursor : public MxCore { +protected: + MxRegion* m_region; // 0x08 + MxRect32* m_rect; // 0x0c + MxSpanListCursor* m_spanListCursor; // 0x10 + MxSegmentListCursor* m_segListCursor; // 0x14 + void CreateSegmentListCursor(MxSegmentList* p_segList); + void SetRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom); + void NextSpan(MxRect32& p_rect); + void PrevSpan(MxRect32& p_rect); + +public: + MxRegionCursor(MxRegion* p_region); + ~MxRegionCursor() override; + virtual MxRect32* Head(); // vtable+0x18 + virtual MxRect32* Tail(); // vtable+0x20 + virtual MxRect32* Next(); // vtable+0x28 + virtual MxRect32* Prev(); // vtable+0x30 + virtual MxRect32* Head(MxRect32& p_rect); // vtable+0x14 + virtual MxRect32* Tail(MxRect32& p_rect); // vtable+0x1c + virtual MxRect32* Next(MxRect32& p_rect); // vtable+0x24 + virtual MxRect32* Prev(MxRect32& p_rect); // vtable+0x2c + + // FUNCTION: LEGO1 0x100c4070 + virtual MxRect32* GetRect() { return m_rect; } // vtable+0x34 + + // FUNCTION: LEGO1 0x100c4080 + virtual MxBool Valid() { return m_rect != NULL; } // vtable+0x38 + + virtual void Reset(); // vtable+0x3c + + // SYNTHETIC: LEGO1 0x100c4090 + // MxRegionCursor::`scalar deleting destructor' +}; + +#ifdef REGION_SANITY_CHECK + +class MxRectIntersection { +protected: + MxRect32 m_rect; + MxS32 m_numRects; + +public: + MxRect32& GetRect() { return m_rect; } + void SetRect(MxRect32& p_rect) { m_rect = p_rect; } + MxS32 GetNumRects() { return m_numRects; } + void SetNumRects(MxS32 p_numRects) { m_numRects = p_numRects; } +}; + +class MxRectIntersectionList : public MxPtrList { +public: + MxRectIntersectionList() : MxPtrList(TRUE) {} +}; + +class MxRectIntersectionListCursor : public MxPtrListCursor { +public: + MxRectIntersectionListCursor(MxRectIntersectionList* p_list) : MxPtrListCursor(p_list) {} +}; + +class MxRegionSanityCheck { +protected: + MxRectIntersectionList* m_rectIntersectionList; + +public: + MxRegionSanityCheck(); + ~MxRegionSanityCheck(); + void Reset() { m_rectIntersectionList->Delete(); } + void AddRect(MxRect32& p_rect); + MxS32 CalculateArea(); +}; + +#endif + +// TEMPLATE: LEGO1 0x100c32e0 +// TEMPLATE: BETA10 0x1014ac30 +// MxCollection::Compare + +// TEMPLATE: LEGO1 0x100c32f0 +// TEMPLATE: BETA10 0x1014adf0 +// MxCollection::~MxCollection + +// TEMPLATE: LEGO1 0x100c3340 +// TEMPLATE: BETA10 0x1014ae90 +// MxCollection::Destroy + +// TEMPLATE: LEGO1 0x100c3350 +// TEMPLATE: BETA10 0x1014aea0 +// MxList::~MxList + +// TEMPLATE: LEGO1 0x100c33e0 +// TEMPLATE: BETA10 0x1014af50 +// MxPtrList::Destroy + +// TEMPLATE: LEGO1 0x100c3480 +// TEMPLATE: BETA10 0x1014afd0 +// MxPtrList::~MxPtrList + +// SYNTHETIC: LEGO1 0x100c34d0 +// SYNTHETIC: BETA10 0x1014b030 +// MxCollection::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100c3540 +// SYNTHETIC: BETA10 0x1014b070 +// MxList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100c35f0 +// SYNTHETIC: BETA10 0x1014b130 +// MxPtrList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100c3be0 +// SYNTHETIC: BETA10 0x1014b600 +// MxSpanListCursor::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100c3c50 +// TEMPLATE: BETA10 0x1014b640 +// MxPtrListCursor::~MxPtrListCursor + +// SYNTHETIC: LEGO1 0x100c3ca0 +// SYNTHETIC: BETA10 0x1014b6a0 +// MxListCursor::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100c3d10 +// SYNTHETIC: BETA10 0x1014b6e0 +// MxPtrListCursor::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100c3d80 +// TEMPLATE: BETA10 0x1014b720 +// MxListCursor::~MxListCursor + +// FUNCTION: LEGO1 0x100c3dd0 +// FUNCTION: BETA10 0x1014b780 +// MxSpanListCursor::~MxSpanListCursor + +// SYNTHETIC: LEGO1 0x100c4790 +// SYNTHETIC: BETA10 0x1014bba0 +// MxSegmentListCursor::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100c4800 +// TEMPLATE: BETA10 0x1014bbe0 +// MxPtrListCursor::~MxPtrListCursor + +// SYNTHETIC: LEGO1 0x100c4850 +// SYNTHETIC: BETA10 0x1014bc40 +// MxListCursor::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100c48c0 +// SYNTHETIC: BETA10 0x1014bc80 +// MxPtrListCursor::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100c4930 +// TEMPLATE: BETA10 0x1014bcc0 +// MxListCursor::~MxListCursor + +// TEMPLATE: LEGO1 0x100c4d80 +// TEMPLATE: BETA10 0x1014be50 +// MxCollection::Compare + +// TEMPLATE: LEGO1 0x100c4d90 +// TEMPLATE: BETA10 0x1014c010 +// MxCollection::~MxCollection + +// TEMPLATE: LEGO1 0x100c4de0 +// TEMPLATE: BETA10 0x1014c0b0 +// MxCollection::Destroy + +// TEMPLATE: LEGO1 0x100c4df0 +// TEMPLATE: BETA10 0x1014c0c0 +// MxList::~MxList + +// TEMPLATE: LEGO1 0x100c4f00 +// TEMPLATE: BETA10 0x1014c1e0 +// MxPtrList::~MxPtrList + +// SYNTHETIC: LEGO1 0x100c4f50 +// SYNTHETIC: BETA10 0x1014c240 +// MxCollection::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100c4e80 +// TEMPLATE: BETA10 0x1014c170 +// MxPtrList::Destroy + +// SYNTHETIC: LEGO1 0x100c4fc0 +// SYNTHETIC: BETA10 0x1014c280 +// MxList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x100c5070 +// SYNTHETIC: BETA10 0x1014c2c0 +// MxPtrList::`scalar deleting destructor' + +// TEMPLATE: LEGO1 0x100c54f0 +// MxListCursor::MxListCursor + +// FUNCTION: LEGO1 0x100c5560 +// MxSegmentListCursor::~MxSegmentListCursor + +// TEMPLATE: LEGO1 0x100c55b0 +// MxListCursor::operator= + +// TEMPLATE: LEGO1 0x100c58c0 +// TEMPLATE: BETA10 0x1014c650 +// MxList::InsertEntry + +// TEMPLATE: LEGO1 0x100c5970 +// TEMPLATE: BETA10 0x1014cb20 +// MxList::InsertEntry + +// TEMPLATE: LEGO1 0x100c5a20 +// TEMPLATE: BETA10 0x1014d050 +// MxListEntry::MxListEntry + +// TEMPLATE: LEGO1 0x100c5a40 +// TEMPLATE: BETA10 0x1014d150 +// MxList::DeleteEntry + +// TEMPLATE: BETA10 0x1014ac50 +// MxPtrList::MxPtrList + +// TEMPLATE: BETA10 0x1014acd0 +// MxList::MxList + +// TEMPLATE: BETA10 0x1014ad60 +// MxCollection::MxCollection + +// TEMPLATE: BETA10 0x1014ae60 +// MxCollection::SetDestroy + +// TEMPLATE: BETA10 0x1014af10 +// MxPtrList::SetOwnership + +// FUNCTION: BETA10 0x1014b170 +// MxSpanList::~MxSpanList + +// TEMPLATE: BETA10 0x1014b440 +// MxList::Append + +// TEMPLATE: BETA10 0x1014b4f0 +// MxPtrListCursor::MxPtrListCursor + +// TEMPLATE: BETA10 0x1014b570 +// MxListCursor::MxListCursor + +// TEMPLATE: BETA10 0x1014ba90 +// MxPtrListCursor::MxPtrListCursor + +// TEMPLATE: BETA10 0x1014bb10 +// MxListCursor::MxListCursor + +// FUNCTION: BETA10 0x1014bd20 +// MxSegmentListCursor::~MxSegmentListCursor + +// TEMPLATE: BETA10 0x1014be70 +// MxPtrList::MxPtrList + +// TEMPLATE: BETA10 0x1014bef0 +// MxList::MxList + +// TEMPLATE: BETA10 0x1014bf80 +// MxCollection::MxCollection + +// TEMPLATE: BETA10 0x1014c080 +// MxCollection::SetDestroy + +// TEMPLATE: BETA10 0x1014c130 +// MxPtrList::SetOwnership + +// FUNCTION: BETA10 0x1014c300 +// MxSegmentList::~MxSegmentList + +// TEMPLATE: BETA10 0x1014c390 +// MxList::Append + +// SYNTHETIC: BETA10 0x1014c3c0 +// MxSegmentListCursor::operator= + +// SYNTHETIC: BETA10 0x1014c3f0 +// MxPtrListCursor::operator= + +// SYNTHETIC: BETA10 0x1014c420 +// MxListCursor::operator= + +// TEMPLATE: BETA10 0x1014c740 +// MxList::DeleteAll + +// TEMPLATE: BETA10 0x1014c7d0 +// MxListCursor::First + +// TEMPLATE: BETA10 0x1014c830 +// MxListCursor::Last + +// TEMPLATE: BETA10 0x1014c890 +// MxListCursor::Next + +// TEMPLATE: BETA10 0x1014c970 +// MxListCursor::Prev + +// TEMPLATE: BETA10 0x1014c9f0 +// MxListCursor::Current + +// TEMPLATE: BETA10 0x1014ca40 +// MxListCursor::Prepend + +// TEMPLATE: BETA10 0x1014ca90 +// MxListCursor::Destroy + +// TEMPLATE: BETA10 0x1014caf0 +// MxListCursor::HasMatch + +// TEMPLATE: BETA10 0x1014cc10 +// MxList::DeleteAll + +// TEMPLATE: BETA10 0x1014cd20 +// MxListCursor::Next + +// TEMPLATE: BETA10 0x1014cda0 +// MxListCursor::Prev + +// TEMPLATE: BETA10 0x1014ce70 +// MxListCursor::Prepend + +// TEMPLATE: BETA10 0x1014cec0 +// MxListCursor::Destroy + +// TEMPLATE: BETA10 0x1014cf50 +// MxListEntry::MxListEntry + +// TEMPLATE: BETA10 0x1014cf90 +// MxListEntry::GetPrev + +// TEMPLATE: BETA10 0x1014cfb0 +// MxListEntry::SetPrev + +// TEMPLATE: BETA10 0x1014cfe0 +// MxListEntry::GetNext + +// TEMPLATE: BETA10 0x1014d000 +// MxListEntry::SetNext + +// TEMPLATE: BETA10 0x1014d030 +// MxListEntry::GetValue + +// TEMPLATE: BETA10 0x1014d090 +// MxListEntry::GetPrev + +// TEMPLATE: BETA10 0x1014d0b0 +// MxListEntry::SetPrev + +// TEMPLATE: BETA10 0x1014d0e0 +// MxListEntry::GetNext + +// TEMPLATE: BETA10 0x1014d100 +// MxListEntry::SetNext + +// TEMPLATE: BETA10 0x1014d130 +// MxListEntry::GetValue + +// TEMPLATE: BETA10 0x1014d200 +// MxList::DeleteEntry + +// TEMPLATE: BETA10 0x1014b210 +// MxList::GetNumElements + +// TEMPLATE: BETA10 0x1014c910 +// ?Next@?$MxListCursor@PAVMxSegment@@@@QAEEXZ + +#endif // __MXREGION_H diff --git a/LEGO1/omni/include/mxregioncursor.h b/LEGO1/omni/include/mxregioncursor.h deleted file mode 100644 index 692ccce9..00000000 --- a/LEGO1/omni/include/mxregioncursor.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef MXREGIONCURSOR_H -#define MXREGIONCURSOR_H - -#include "mxregion.h" - -// VTABLE: LEGO1 0x100dcbb8 -// SIZE 0x18 -class MxRegionCursor : public MxCore { -public: - MxRegionCursor(MxRegion* p_region); - ~MxRegionCursor() override; - - virtual MxRect32* VTable0x14(MxRect32& p_rect); // vtable+0x14 - virtual MxRect32* VTable0x18(); // vtable+0x18 - virtual MxRect32* VTable0x1c(MxRect32& p_rect); // vtable+0x1c - virtual MxRect32* VTable0x20(); // vtable+0x20 - virtual MxRect32* VTable0x24(MxRect32& p_rect); // vtable+0x24 - virtual MxRect32* VTable0x28(); // vtable+0x28 - virtual MxRect32* VTable0x2c(MxRect32& p_rect); // vtable+0x2c - virtual MxRect32* VTable0x30(); // vtable+0x30 - - // FUNCTION: LEGO1 0x100c4070 - virtual MxRect32* GetRect() { return m_rect; } // vtable+0x34 - - // FUNCTION: LEGO1 0x100c4080 - virtual MxBool HasRect() { return m_rect != NULL; } // vtable+0x38 - - virtual void Reset(); // vtable+0x3c - -private: - void ResetAndInitializeCursor(MxRegionLeftRightList& p_leftRightList); - void UpdateRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom); - void ProcessRectOverlapAscending(MxRect32& p_rect); - void ProcessOverlapWithRect(MxRect32& p_rect); - - MxRegion* m_region; // 0x08 - MxRect32* m_rect; // 0x0c - MxRegionTopBottomListCursor* m_topBottomCursor; // 0x10 - MxRegionLeftRightListCursor* m_leftRightCursor; // 0x14 -}; - -// SYNTHETIC: LEGO1 0x100c4090 -// MxRegionCursor::`scalar deleting destructor' - -#endif // MXREGIONCURSOR_H diff --git a/LEGO1/omni/include/mxregionlist.h b/LEGO1/omni/include/mxregionlist.h deleted file mode 100644 index 3fc220ff..00000000 --- a/LEGO1/omni/include/mxregionlist.h +++ /dev/null @@ -1,427 +0,0 @@ -#ifndef MXREGIONLIST_H -#define MXREGIONLIST_H - -#include "mxlist.h" - -// SIZE 0x08 -struct MxRegionLeftRight { - MxRegionLeftRight(MxS32 p_left, MxS32 p_right) - { - m_left = p_left; - m_right = p_right; - } - - MxRegionLeftRight* Clone() { return new MxRegionLeftRight(m_left, m_right); } - - MxS32 GetLeft() { return m_left; } - MxS32 GetRight() { return m_right; } - - void SetLeft(MxS32 p_left) { m_left = p_left; } - void SetRight(MxS32 p_right) { m_right = p_right; } - - MxBool IntersectsWith(MxRect32& p_rect) { return m_left < p_rect.GetRight() && p_rect.GetTop() < m_right; } - -private: - MxS32 m_left; // 0x00 - MxS32 m_right; // 0x04 -}; - -// VTABLE: LEGO1 0x100dcc40 -// VTABLE: BETA10 0x101c2628 -// class MxCollection - -// VTABLE: LEGO1 0x100dcc58 -// VTABLE: BETA10 0x101c2610 -// class MxList - -// VTABLE: LEGO1 0x100dcc70 -// VTABLE: BETA10 0x101c25f8 -// class MxPtrList - -// VTABLE: LEGO1 0x100dcc88 -// VTABLE: BETA10 0x101c25e0 -// SIZE 0x18 -class MxRegionLeftRightList : public MxPtrList { -public: - // FUNCTION: BETA10 0x1014bdd0 - MxRegionLeftRightList() : MxPtrList(TRUE) {} - - // SYNTHETIC: LEGO1 0x100c4e90 - // SYNTHETIC: BETA10 0x1014c1a0 - // MxRegionLeftRightList::`scalar deleting destructor' -}; - -// VTABLE: LEGO1 0x100dcbf8 -// VTABLE: BETA10 0x101c25b0 -// class MxPtrListCursor - -// VTABLE: LEGO1 0x100dcc28 -// VTABLE: BETA10 0x101c25c8 -// class MxListCursor - -// VTABLE: LEGO1 0x100dcc10 -// VTABLE: BETA10 0x101c2598 -class MxRegionLeftRightListCursor : public MxPtrListCursor { -public: - // FUNCTION: BETA10 0x1014ba10 - MxRegionLeftRightListCursor(MxRegionLeftRightList* p_list) : MxPtrListCursor(p_list) {} -}; - -// SIZE 0x0c -struct MxRegionTopBottom { - MxRegionTopBottom(MxRect32& p_rect); - MxRegionTopBottom(MxS32 p_top, MxS32 p_bottom); - ~MxRegionTopBottom() { delete m_leftRightList; } - - MxRegionTopBottom* Clone(); - void MergeOrExpandRegions(MxS32 p_left, MxS32 p_right); - MxBool CheckHorizontalOverlap(MxRect32& p_rect); - - MxS32 GetTop() { return m_top; } - MxS32 GetBottom() { return m_bottom; } - - void SetTop(MxS32 p_top) { m_top = p_top; } - void SetBottom(MxS32 p_bottom) { m_bottom = p_bottom; } - - MxBool IntersectsWith(MxRect32& p_rect) { return m_top < p_rect.GetBottom() && p_rect.GetTop() < m_bottom; } - - friend class MxRegionTopBottomList; - friend class MxRegionCursor; - -private: - MxS32 m_top; // 0x00 - MxS32 m_bottom; // 0x04 - MxRegionLeftRightList* m_leftRightList; // 0x08 -}; - -// VTABLE: LEGO1 0x100dcb10 -// VTABLE: BETA10 0x101c24f8 -// class MxCollection - -// VTABLE: LEGO1 0x100dcb28 -// VTABLE: BETA10 0x101c24e0 -// class MxList - -// VTABLE: LEGO1 0x100dcb40 -// VTABLE: BETA10 0x101c24c8 -// class MxPtrList - -// VTABLE: LEGO1 0x100dcb58 -// VTABLE: BETA10 0x101c24b0 -// SIZE 0x18 -class MxRegionTopBottomList : public MxPtrList { -public: - // FUNCTION: BETA10 0x1014abb0 - MxRegionTopBottomList() : MxPtrList(TRUE) {} - - // SYNTHETIC: LEGO1 0x100c3410 - // SYNTHETIC: BETA10 0x1014af90 - // MxRegionTopBottomList::`scalar deleting destructor' -}; - -// VTABLE: LEGO1 0x100dcb70 -// VTABLE: BETA10 0x101c2528 -// class MxPtrListCursor - -// VTABLE: LEGO1 0x100dcba0 -// VTABLE: BETA10 0x101c2540 -// class MxListCursor - -// TODO: The initialize list param type should be MxRegionTopBottomList, but doing that -// drastically reduced the match percentage for MxRegion::VTable0x18. -// It also works with MxPtrList, so we'll do that until we figure this out. - -// VTABLE: LEGO1 0x100dcb88 -// VTABLE: BETA10 0x101c2510 -class MxRegionTopBottomListCursor : public MxPtrListCursor { -public: - // FUNCTION: BETA10 0x1014b470 - MxRegionTopBottomListCursor(MxPtrList* p_list) : MxPtrListCursor(p_list) {} -}; - -// TEMPLATE: LEGO1 0x100c32e0 -// TEMPLATE: BETA10 0x1014ac30 -// MxCollection::Compare - -// TEMPLATE: LEGO1 0x100c32f0 -// TEMPLATE: BETA10 0x1014adf0 -// MxCollection::~MxCollection - -// TEMPLATE: LEGO1 0x100c3340 -// TEMPLATE: BETA10 0x1014ae90 -// MxCollection::Destroy - -// TEMPLATE: LEGO1 0x100c3350 -// TEMPLATE: BETA10 0x1014aea0 -// MxList::~MxList - -// TEMPLATE: LEGO1 0x100c33e0 -// TEMPLATE: BETA10 0x1014af50 -// MxPtrList::Destroy - -// TEMPLATE: LEGO1 0x100c3480 -// TEMPLATE: BETA10 0x1014afd0 -// MxPtrList::~MxPtrList - -// SYNTHETIC: LEGO1 0x100c34d0 -// SYNTHETIC: BETA10 0x1014b030 -// MxCollection::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100c3540 -// SYNTHETIC: BETA10 0x1014b070 -// MxList::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100c35f0 -// SYNTHETIC: BETA10 0x1014b130 -// MxPtrList::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100c3be0 -// SYNTHETIC: BETA10 0x1014b600 -// MxRegionTopBottomListCursor::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100c3c50 -// TEMPLATE: BETA10 0x1014b640 -// MxPtrListCursor::~MxPtrListCursor - -// SYNTHETIC: LEGO1 0x100c3ca0 -// SYNTHETIC: BETA10 0x1014b6a0 -// MxListCursor::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100c3d10 -// SYNTHETIC: BETA10 0x1014b6e0 -// MxPtrListCursor::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100c3d80 -// TEMPLATE: BETA10 0x1014b720 -// MxListCursor::~MxListCursor - -// FUNCTION: LEGO1 0x100c3dd0 -// FUNCTION: BETA10 0x1014b780 -// MxRegionTopBottomListCursor::~MxRegionTopBottomListCursor - -// SYNTHETIC: LEGO1 0x100c4790 -// SYNTHETIC: BETA10 0x1014bba0 -// MxRegionLeftRightListCursor::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100c4800 -// TEMPLATE: BETA10 0x1014bbe0 -// MxPtrListCursor::~MxPtrListCursor - -// SYNTHETIC: LEGO1 0x100c4850 -// SYNTHETIC: BETA10 0x1014bc40 -// MxListCursor::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100c48c0 -// SYNTHETIC: BETA10 0x1014bc80 -// MxPtrListCursor::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100c4930 -// TEMPLATE: BETA10 0x1014bcc0 -// MxListCursor::~MxListCursor - -// TEMPLATE: LEGO1 0x100c4d80 -// TEMPLATE: BETA10 0x1014be50 -// MxCollection::Compare - -// TEMPLATE: LEGO1 0x100c4d90 -// TEMPLATE: BETA10 0x1014c010 -// MxCollection::~MxCollection - -// TEMPLATE: LEGO1 0x100c4de0 -// TEMPLATE: BETA10 0x1014c0b0 -// MxCollection::Destroy - -// TEMPLATE: LEGO1 0x100c4df0 -// TEMPLATE: BETA10 0x1014c0c0 -// MxList::~MxList - -// TEMPLATE: LEGO1 0x100c4f00 -// TEMPLATE: BETA10 0x1014c1e0 -// MxPtrList::~MxPtrList - -// SYNTHETIC: LEGO1 0x100c4f50 -// SYNTHETIC: BETA10 0x1014c240 -// MxCollection::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100c4e80 -// TEMPLATE: BETA10 0x1014c170 -// MxPtrList::Destroy - -// SYNTHETIC: LEGO1 0x100c4fc0 -// SYNTHETIC: BETA10 0x1014c280 -// MxList::`scalar deleting destructor' - -// SYNTHETIC: LEGO1 0x100c5070 -// SYNTHETIC: BETA10 0x1014c2c0 -// MxPtrList::`scalar deleting destructor' - -// TEMPLATE: LEGO1 0x100c54f0 -// MxListCursor::MxListCursor - -// FUNCTION: LEGO1 0x100c5560 -// MxRegionLeftRightListCursor::~MxRegionLeftRightListCursor - -// TEMPLATE: LEGO1 0x100c55b0 -// MxListCursor::operator= - -// TEMPLATE: LEGO1 0x100c58c0 -// TEMPLATE: BETA10 0x1014c650 -// MxList::InsertEntry - -// TEMPLATE: LEGO1 0x100c5970 -// TEMPLATE: BETA10 0x1014cb20 -// MxList::InsertEntry - -// TEMPLATE: LEGO1 0x100c5a20 -// TEMPLATE: BETA10 0x1014d050 -// MxListEntry::MxListEntry - -// TEMPLATE: LEGO1 0x100c5a40 -// TEMPLATE: BETA10 0x1014d150 -// MxList::DeleteEntry - -// TEMPLATE: BETA10 0x1014ac50 -// MxPtrList::MxPtrList - -// TEMPLATE: BETA10 0x1014acd0 -// MxList::MxList - -// TEMPLATE: BETA10 0x1014ad60 -// MxCollection::MxCollection - -// TEMPLATE: BETA10 0x1014ae60 -// MxCollection::SetDestroy - -// TEMPLATE: BETA10 0x1014af10 -// MxPtrList::SetOwnership - -// FUNCTION: BETA10 0x1014b170 -// MxRegionTopBottomList::~MxRegionTopBottomList - -// TEMPLATE: BETA10 0x1014b440 -// MxList::Append - -// TEMPLATE: BETA10 0x1014b4f0 -// MxPtrListCursor::MxPtrListCursor - -// TEMPLATE: BETA10 0x1014b570 -// MxListCursor::MxListCursor - -// TEMPLATE: BETA10 0x1014ba90 -// MxPtrListCursor::MxPtrListCursor - -// TEMPLATE: BETA10 0x1014bb10 -// MxListCursor::MxListCursor - -// FUNCTION: BETA10 0x1014bd20 -// MxRegionLeftRightListCursor::~MxRegionLeftRightListCursor - -// TEMPLATE: BETA10 0x1014be70 -// MxPtrList::MxPtrList - -// TEMPLATE: BETA10 0x1014bef0 -// MxList::MxList - -// TEMPLATE: BETA10 0x1014bf80 -// MxCollection::MxCollection - -// TEMPLATE: BETA10 0x1014c080 -// MxCollection::SetDestroy - -// TEMPLATE: BETA10 0x1014c130 -// MxPtrList::SetOwnership - -// FUNCTION: BETA10 0x1014c300 -// MxRegionLeftRightList::~MxRegionLeftRightList - -// TEMPLATE: BETA10 0x1014c390 -// MxList::Append - -// SYNTHETIC: BETA10 0x1014c3c0 -// MxRegionLeftRightListCursor::operator= - -// SYNTHETIC: BETA10 0x1014c3f0 -// MxPtrListCursor::operator= - -// SYNTHETIC: BETA10 0x1014c420 -// MxListCursor::operator= - -// TEMPLATE: BETA10 0x1014c740 -// MxList::DeleteAll - -// TEMPLATE: BETA10 0x1014c7d0 -// MxListCursor::First - -// TEMPLATE: BETA10 0x1014c830 -// MxListCursor::Last - -// TEMPLATE: BETA10 0x1014c890 -// MxListCursor::Next - -// TEMPLATE: BETA10 0x1014c970 -// MxListCursor::Prev - -// TEMPLATE: BETA10 0x1014c9f0 -// MxListCursor::Current - -// TEMPLATE: BETA10 0x1014ca40 -// MxListCursor::Prepend - -// TEMPLATE: BETA10 0x1014ca90 -// MxListCursor::Destroy - -// TEMPLATE: BETA10 0x1014caf0 -// MxListCursor::HasMatch - -// TEMPLATE: BETA10 0x1014cc10 -// MxList::DeleteAll - -// TEMPLATE: BETA10 0x1014cd20 -// MxListCursor::Next - -// TEMPLATE: BETA10 0x1014cda0 -// MxListCursor::Prev - -// TEMPLATE: BETA10 0x1014ce70 -// MxListCursor::Prepend - -// TEMPLATE: BETA10 0x1014cec0 -// MxListCursor::Destroy - -// TEMPLATE: BETA10 0x1014cf50 -// MxListEntry::MxListEntry - -// TEMPLATE: BETA10 0x1014cf90 -// MxListEntry::GetPrev - -// TEMPLATE: BETA10 0x1014cfb0 -// MxListEntry::SetPrev - -// TEMPLATE: BETA10 0x1014cfe0 -// MxListEntry::GetNext - -// TEMPLATE: BETA10 0x1014d000 -// MxListEntry::SetNext - -// TEMPLATE: BETA10 0x1014d030 -// MxListEntry::GetValue - -// TEMPLATE: BETA10 0x1014d090 -// MxListEntry::GetPrev - -// TEMPLATE: BETA10 0x1014d0b0 -// MxListEntry::SetPrev - -// TEMPLATE: BETA10 0x1014d0e0 -// MxListEntry::GetNext - -// TEMPLATE: BETA10 0x1014d100 -// MxListEntry::SetNext - -// TEMPLATE: BETA10 0x1014d130 -// MxListEntry::GetValue - -// TEMPLATE: BETA10 0x1014d200 -// MxList::DeleteEntry - -#endif // MXREGIONLIST_H diff --git a/LEGO1/omni/include/mxvideomanager.h b/LEGO1/omni/include/mxvideomanager.h index 163f18b0..78411dcb 100644 --- a/LEGO1/omni/include/mxvideomanager.h +++ b/LEGO1/omni/include/mxvideomanager.h @@ -30,13 +30,12 @@ public: MxBool p_createThread ); // vtable+0x28 virtual MxResult Create(MxVideoParam& p_videoParam, MxU32 p_frequencyMS, MxBool p_createThread); // vtable+0x2c - - void InvalidateRect(MxRect32&); - virtual MxResult RealizePalette(MxPalette*); // vtable+0x30 - virtual void UpdateView(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height); // vtable+0x34 + virtual MxResult RealizePalette(MxPalette* p_palette); // vtable+0x30 + virtual void UpdateView(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height); // vtable+0x34 MxResult Init(); void Destroy(MxBool p_fromDestructor); + void InvalidateRect(MxRect32& p_rect); void SortPresenterList(); void UpdateRegion(); diff --git a/LEGO1/omni/src/video/mxregion.cpp b/LEGO1/omni/src/video/mxregion.cpp index f294d3a5..e2841f23 100644 --- a/LEGO1/omni/src/video/mxregion.cpp +++ b/LEGO1/omni/src/video/mxregion.cpp @@ -2,108 +2,104 @@ #include -DECOMP_SIZE_ASSERT(MxRegion, 0x1c); -DECOMP_SIZE_ASSERT(MxRegionTopBottom, 0x0c); -DECOMP_SIZE_ASSERT(MxRegionLeftRight, 0x08); +DECOMP_SIZE_ASSERT(MxRegion, 0x1c) +DECOMP_SIZE_ASSERT(MxSpan, 0x0c) +DECOMP_SIZE_ASSERT(MxSegment, 0x08) +DECOMP_SIZE_ASSERT(MxRegionCursor, 0x18) // FUNCTION: LEGO1 0x100c31c0 // FUNCTION: BETA10 0x10148f00 MxRegion::MxRegion() { - m_list = new MxRegionTopBottomList; - m_rect = MxRect32(INT_MAX, INT_MAX, -1, -1); -} - -// FUNCTION: LEGO1 0x100c3660 -MxBool MxRegion::VTable0x20() -{ - return m_list->GetCount() == 0; + m_spanList = new MxSpanList; + m_boundingRect = MxRect32(INT_MAX, INT_MAX, -1, -1); } // FUNCTION: LEGO1 0x100c3690 +// FUNCTION: BETA10 0x10148fe8 MxRegion::~MxRegion() { - if (m_list) { - delete m_list; - } + delete m_spanList; } // FUNCTION: LEGO1 0x100c3700 // FUNCTION: BETA10 0x1014907a void MxRegion::Reset() { - m_list->DeleteAll(); - m_rect = MxRect32(INT_MAX, INT_MAX, -1, -1); + m_spanList->DeleteAll(); + m_boundingRect = MxRect32(INT_MAX, INT_MAX, -1, -1); } // FUNCTION: LEGO1 0x100c3750 // FUNCTION: BETA10 0x101490bd -void MxRegion::VTable0x18(MxRect32& p_rect) +void MxRegion::AddRect(MxRect32& p_rect) { MxRect32 rect(p_rect); MxRect32 newRect; - MxRegionTopBottomListCursor cursor(m_list); - MxRegionTopBottom* topBottom; + MxSpanListCursor cursor(m_spanList); + MxSpan* span; - while (rect.IsValid() && cursor.Next(topBottom)) { - if (topBottom->GetTop() >= rect.GetBottom()) { - MxRegionTopBottom* newTopBottom = new MxRegionTopBottom(rect); - cursor.Prepend(newTopBottom); + while (rect.IsValid() && cursor.Next(span)) { + if (span->GetMin() >= rect.GetBottom()) { + MxSpan* newSpan = new MxSpan(rect); + cursor.Prepend(newSpan); rect.SetTop(rect.GetBottom()); } - else if (rect.GetTop() < topBottom->GetBottom()) { - if (rect.GetTop() < topBottom->GetTop()) { + else if (rect.GetTop() < span->GetMax()) { + if (rect.GetTop() < span->GetMin()) { newRect = rect; - newRect.SetBottom(topBottom->GetTop()); - MxRegionTopBottom* newTopBottom = new MxRegionTopBottom(newRect); - cursor.Prepend(newTopBottom); - rect.SetTop(topBottom->GetTop()); + newRect.SetBottom(span->GetMin()); + MxSpan* newSpan = new MxSpan(newRect); + cursor.Prepend(newSpan); + rect.SetTop(span->GetMin()); } - else if (topBottom->GetTop() < rect.GetTop()) { - MxRegionTopBottom* newTopBottom = topBottom->Clone(); - newTopBottom->SetBottom(rect.GetTop()); - topBottom->SetTop(rect.GetTop()); - cursor.Prepend(newTopBottom); + else if (span->GetMin() < rect.GetTop()) { + MxSpan* newSpan = span->Clone(); + newSpan->SetMax(rect.GetTop()); + span->SetMin(rect.GetTop()); + cursor.Prepend(newSpan); } - if (rect.GetBottom() < topBottom->GetBottom()) { - MxRegionTopBottom* newTopBottom = topBottom->Clone(); - newTopBottom->SetBottom(rect.GetBottom()); - topBottom->SetTop(rect.GetBottom()); - newTopBottom->MergeOrExpandRegions(rect.GetLeft(), rect.GetRight()); - cursor.Prepend(newTopBottom); + if (rect.GetBottom() < span->GetMax()) { + MxSpan* newSpan = span->Clone(); + newSpan->SetMax(rect.GetBottom()); + span->SetMin(rect.GetBottom()); + newSpan->AddSegment(rect.GetLeft(), rect.GetRight()); + cursor.Prepend(newSpan); rect.SetTop(rect.GetBottom()); } else { - topBottom->MergeOrExpandRegions(rect.GetLeft(), rect.GetRight()); - rect.SetTop(topBottom->GetBottom()); + span->AddSegment(rect.GetLeft(), rect.GetRight()); + rect.SetTop(span->GetMax()); } } } if (rect.IsValid()) { - MxRegionTopBottom* newTopBottom = new MxRegionTopBottom(rect); - m_list->Append(newTopBottom); + MxSpan* newSpan = new MxSpan(rect); + m_spanList->Append(newSpan); } - m_rect.UpdateBounds(p_rect); + m_boundingRect.UpdateBounds(p_rect); } // FUNCTION: LEGO1 0x100c3e20 -MxBool MxRegion::VTable0x1c(MxRect32& p_rect) +// FUNCTION: BETA10 0x10149535 +MxBool MxRegion::Intersects(MxRect32& p_rect) { - if (!m_rect.IntersectsWith(p_rect)) { + if (!m_boundingRect.IntersectsWith(p_rect)) { return FALSE; } - MxRegionTopBottomListCursor cursor(m_list); - MxRegionTopBottom* topBottom; + MxSpanListCursor cursor(m_spanList); + MxSpan* span; - while (cursor.Next(topBottom)) { - if (topBottom->GetTop() >= p_rect.GetBottom()) { + while (cursor.Next(span)) { + if (span->GetMin() >= p_rect.GetBottom()) { return FALSE; } - if (topBottom->GetBottom() > p_rect.GetTop() && topBottom->CheckHorizontalOverlap(p_rect)) { + + if (span->GetMax() > p_rect.GetTop() && span->IntersectsH(p_rect)) { return TRUE; } } @@ -111,57 +107,338 @@ MxBool MxRegion::VTable0x1c(MxRect32& p_rect) return FALSE; } -// FUNCTION: LEGO1 0x100c4c90 -MxRegionTopBottom::MxRegionTopBottom(MxS32 p_top, MxS32 p_bottom) +// FUNCTION: LEGO1 0x100c3f70 +// FUNCTION: BETA10 0x10149663 +MxRegionCursor::MxRegionCursor(MxRegion* p_region) { - m_top = p_top; - m_bottom = p_bottom; - m_leftRightList = new MxRegionLeftRightList; + m_region = p_region; + m_rect = NULL; + m_spanListCursor = new MxSpanListCursor(m_region->m_spanList); + m_segListCursor = NULL; +} + +// FUNCTION: LEGO1 0x100c40b0 +MxRegionCursor::~MxRegionCursor() +{ + if (m_rect) { + delete m_rect; + } + + if (m_spanListCursor) { + delete m_spanListCursor; + } + + if (m_segListCursor) { + delete m_segListCursor; + } +} + +// FUNCTION: LEGO1 0x100c4140 +MxRect32* MxRegionCursor::Head() +{ + m_spanListCursor->Head(); + + MxSpan* span; + if (m_spanListCursor->Current(span)) { + CreateSegmentListCursor(span->m_segList); + + MxSegment* segment; + m_segListCursor->First(segment); + + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + } + else { + Reset(); + } + + return m_rect; +} + +// FUNCTION: LEGO1 0x100c41d0 +MxRect32* MxRegionCursor::Tail() +{ + m_spanListCursor->Tail(); + + MxSpan* span; + if (m_spanListCursor->Current(span)) { + CreateSegmentListCursor(span->m_segList); + + MxSegment* segment; + m_segListCursor->Last(segment); + + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + } + else { + Reset(); + } + + return m_rect; +} + +// FUNCTION: LEGO1 0x100c4260 +MxRect32* MxRegionCursor::Next() +{ + MxSegment* segment; + MxSpan* span; + + if (m_segListCursor && m_segListCursor->Next(segment)) { + m_spanListCursor->Current(span); + + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + return m_rect; + } + + if (m_spanListCursor->Next(span)) { + CreateSegmentListCursor(span->m_segList); + m_segListCursor->First(segment); + + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + return m_rect; + } + + Reset(); + return m_rect; +} + +// FUNCTION: LEGO1 0x100c4360 +MxRect32* MxRegionCursor::Prev() +{ + MxSegment* segment; + MxSpan* span; + + if (m_segListCursor && m_segListCursor->Prev(segment)) { + m_spanListCursor->Current(span); + + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + return m_rect; + } + + if (m_spanListCursor->Prev(span)) { + CreateSegmentListCursor(span->m_segList); + m_segListCursor->Last(segment); + + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + return m_rect; + } + + Reset(); + return m_rect; +} + +// FUNCTION: LEGO1 0x100c4460 +MxRect32* MxRegionCursor::Head(MxRect32& p_rect) +{ + m_spanListCursor->Reset(); + NextSpan(p_rect); + return m_rect; +} + +// FUNCTION: LEGO1 0x100c4480 +MxRect32* MxRegionCursor::Tail(MxRect32& p_rect) +{ + m_spanListCursor->Reset(); + PrevSpan(p_rect); + return m_rect; +} + +// FUNCTION: LEGO1 0x100c44a0 +MxRect32* MxRegionCursor::Next(MxRect32& p_rect) +{ + MxSegment* segment; + + if (m_segListCursor && m_segListCursor->Next(segment)) { + MxSpan* span; + + m_spanListCursor->Current(span); + + if (span->IntersectsV(p_rect) && segment->IntersectsH(p_rect)) { + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + m_rect->Intersect(p_rect); + } + else { + NextSpan(p_rect); + } + } + else { + NextSpan(p_rect); + } + + return m_rect; +} + +// FUNCTION: LEGO1 0x100c4590 +MxRect32* MxRegionCursor::Prev(MxRect32& p_rect) +{ + MxSegment* segment; + + if (m_segListCursor && m_segListCursor->Prev(segment)) { + MxSpan* span; + + m_spanListCursor->Current(span); + + if (span->IntersectsV(p_rect) && segment->IntersectsH(p_rect)) { + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + m_rect->Intersect(p_rect); + } + else { + PrevSpan(p_rect); + } + } + else { + PrevSpan(p_rect); + } + + return m_rect; +} + +// FUNCTION: LEGO1 0x100c4680 +void MxRegionCursor::Reset() +{ + if (m_rect) { + delete m_rect; + m_rect = NULL; + } + + m_spanListCursor->Reset(); + + if (m_segListCursor) { + delete m_segListCursor; + m_segListCursor = NULL; + } +} + +// FUNCTION: LEGO1 0x100c46c0 +void MxRegionCursor::CreateSegmentListCursor(MxSegmentList* p_segList) +{ + if (m_segListCursor) { + delete m_segListCursor; + } + + m_segListCursor = new MxSegmentListCursor(p_segList); +} + +// FUNCTION: LEGO1 0x100c4980 +void MxRegionCursor::SetRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) +{ + if (!m_rect) { + m_rect = new MxRect32; + } + + m_rect->SetLeft(p_left); + m_rect->SetTop(p_top); + m_rect->SetRight(p_right); + m_rect->SetBottom(p_bottom); +} + +// FUNCTION: LEGO1 0x100c4a20 +void MxRegionCursor::NextSpan(MxRect32& p_rect) +{ + MxSpan* span; + while (m_spanListCursor->Next(span)) { + if (p_rect.GetBottom() <= span->GetMin()) { + Reset(); + return; + } + + if (p_rect.GetTop() < span->GetMax()) { + CreateSegmentListCursor(span->m_segList); + + MxSegment* segment; + while (m_segListCursor->Next(segment)) { + if (p_rect.GetRight() <= segment->GetMin()) { + break; + } + + if (p_rect.GetLeft() < segment->GetMax()) { + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + m_rect->Intersect(p_rect); + return; + } + } + } + } + + Reset(); +} + +// FUNCTION: LEGO1 0x100c4b50 +void MxRegionCursor::PrevSpan(MxRect32& p_rect) +{ + MxSpan* span; + while (m_spanListCursor->Prev(span)) { + if (span->GetMax() <= p_rect.GetTop()) { + Reset(); + return; + } + + if (span->GetMin() < p_rect.GetBottom()) { + CreateSegmentListCursor(span->m_segList); + + MxSegment* segment; + while (m_segListCursor->Prev(segment)) { + if (segment->GetMax() <= p_rect.GetLeft()) { + break; + } + + if (segment->GetMin() < p_rect.GetRight()) { + SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax()); + m_rect->Intersect(p_rect); + return; + } + } + } + } + + Reset(); +} + +// FUNCTION: LEGO1 0x100c4c90 +MxSpan::MxSpan(MxS32 p_min, MxS32 p_max) +{ + m_min = p_min; + m_max = p_max; + m_segList = new MxSegmentList; } // FUNCTION: LEGO1 0x100c50e0 // FUNCTION: BETA10 0x1014a2d6 -MxRegionTopBottom::MxRegionTopBottom(MxRect32& p_rect) +MxSpan::MxSpan(MxRect32& p_rect) { - m_top = p_rect.GetTop(); - m_bottom = p_rect.GetBottom(); - m_leftRightList = new MxRegionLeftRightList; + m_min = p_rect.GetTop(); + m_max = p_rect.GetBottom(); + m_segList = new MxSegmentList; - MxRegionLeftRight* leftRight = new MxRegionLeftRight(p_rect.GetLeft(), p_rect.GetRight()); - m_leftRightList->Append(leftRight); + MxSegment* segment = new MxSegment(p_rect.GetLeft(), p_rect.GetRight()); + m_segList->Append(segment); } // FUNCTION: LEGO1 0x100c5280 // FUNCTION: BETA10 0x1014a3fc -void MxRegionTopBottom::MergeOrExpandRegions(MxS32 p_left, MxS32 p_right) +void MxSpan::AddSegment(MxS32 p_min, MxS32 p_max) { - MxRegionLeftRightListCursor a(m_leftRightList); - MxRegionLeftRightListCursor b(m_leftRightList); + MxSegmentListCursor a(m_segList); + MxSegmentListCursor b(m_segList); - MxRegionLeftRight* leftRight; - while (a.Next(leftRight) && leftRight->GetRight() < p_left) { + MxSegment* segment; + while (a.Next(segment) && segment->GetMax() < p_min) { ; } - if (!a.HasMatch()) { - MxRegionLeftRight* copy = new MxRegionLeftRight(p_left, p_right); - m_leftRightList->Append(copy); - } - else { - if (p_left > leftRight->GetLeft()) { - p_left = leftRight->GetLeft(); + if (a.HasMatch()) { + if (p_min > segment->GetMin()) { + p_min = segment->GetMin(); } - while (leftRight->GetLeft() < p_right) { - if (p_right < leftRight->GetRight()) { - p_right = leftRight->GetRight(); + while (segment->GetMin() < p_max) { + if (p_max < segment->GetMax()) { + p_max = segment->GetMax(); } b = a; b.Next(); a.Destroy(); - if (!b.Current(leftRight)) { + if (!b.Current(segment)) { break; } @@ -169,42 +446,48 @@ void MxRegionTopBottom::MergeOrExpandRegions(MxS32 p_left, MxS32 p_right) } if (a.HasMatch()) { - MxRegionLeftRight* copy = new MxRegionLeftRight(p_left, p_right); + MxSegment* copy = new MxSegment(p_min, p_max); a.Prepend(copy); } else { - MxRegionLeftRight* copy = new MxRegionLeftRight(p_left, p_right); - m_leftRightList->Append(copy); + MxSegment* copy = new MxSegment(p_min, p_max); + m_segList->Append(copy); } } + else { + MxSegment* copy = new MxSegment(p_min, p_max); + m_segList->Append(copy); + } } // FUNCTION: LEGO1 0x100c55d0 -MxRegionTopBottom* MxRegionTopBottom::Clone() +MxSpan* MxSpan::Clone() { - MxRegionTopBottom* clone = new MxRegionTopBottom(m_top, m_bottom); + MxSpan* clone = new MxSpan(m_min, m_max); - MxRegionLeftRightListCursor cursor(m_leftRightList); - MxRegionLeftRight* leftRight; + MxSegmentListCursor cursor(m_segList); + MxSegment* segment; - while (cursor.Next(leftRight)) { - clone->m_leftRightList->Append(leftRight->Clone()); + while (cursor.Next(segment)) { + clone->m_segList->Append(segment->Clone()); } return clone; } // FUNCTION: LEGO1 0x100c57b0 -MxBool MxRegionTopBottom::CheckHorizontalOverlap(MxRect32& p_rect) +// FUNCTION: BETA10 0x1014aa46 +MxBool MxSpan::IntersectsH(MxRect32& p_rect) { - MxRegionLeftRightListCursor cursor(m_leftRightList); - MxRegionLeftRight* leftRight; + MxSegmentListCursor cursor(m_segList); + MxSegment* segment; - while (cursor.Next(leftRight)) { - if (p_rect.GetRight() <= leftRight->GetLeft()) { + while (cursor.Next(segment)) { + if (p_rect.GetRight() <= segment->GetMin()) { return FALSE; } - if (leftRight->GetRight() > p_rect.GetLeft()) { + + if (segment->GetMax() > p_rect.GetLeft()) { return TRUE; } } diff --git a/LEGO1/omni/src/video/mxregioncursor.cpp b/LEGO1/omni/src/video/mxregioncursor.cpp deleted file mode 100644 index 827c1947..00000000 --- a/LEGO1/omni/src/video/mxregioncursor.cpp +++ /dev/null @@ -1,298 +0,0 @@ -#include "mxregioncursor.h" - -DECOMP_SIZE_ASSERT(MxRegionCursor, 0x18); - -// FUNCTION: LEGO1 0x100c3f70 -// FUNCTION: BETA10 0x10149663 -MxRegionCursor::MxRegionCursor(MxRegion* p_region) -{ - m_region = p_region; - m_rect = NULL; - m_topBottomCursor = new MxRegionTopBottomListCursor(m_region->m_list); - m_leftRightCursor = NULL; -} - -// FUNCTION: LEGO1 0x100c40b0 -MxRegionCursor::~MxRegionCursor() -{ - if (m_rect) { - delete m_rect; - } - - if (m_topBottomCursor) { - delete m_topBottomCursor; - } - - if (m_leftRightCursor) { - delete m_leftRightCursor; - } -} - -// FUNCTION: LEGO1 0x100c4140 -MxRect32* MxRegionCursor::VTable0x18() -{ - m_topBottomCursor->Head(); - - MxRegionTopBottom* topBottom; - if (m_topBottomCursor->Current(topBottom)) { - ResetAndInitializeCursor(*topBottom->m_leftRightList); - - MxRegionLeftRight* leftRight; - m_leftRightCursor->First(leftRight); - - UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); - } - else { - Reset(); - } - - return m_rect; -} - -// FUNCTION: LEGO1 0x100c41d0 -MxRect32* MxRegionCursor::VTable0x20() -{ - m_topBottomCursor->Tail(); - - MxRegionTopBottom* topBottom; - if (m_topBottomCursor->Current(topBottom)) { - ResetAndInitializeCursor(*topBottom->m_leftRightList); - - MxRegionLeftRight* leftRight; - m_leftRightCursor->Last(leftRight); - - UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); - } - else { - Reset(); - } - - return m_rect; -} - -// FUNCTION: LEGO1 0x100c4260 -MxRect32* MxRegionCursor::VTable0x28() -{ - MxRegionLeftRight* leftRight; - MxRegionTopBottom* topBottom; - - if (m_leftRightCursor && m_leftRightCursor->Next(leftRight)) { - m_topBottomCursor->Current(topBottom); - - UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); - return m_rect; - } - - if (m_topBottomCursor->Next(topBottom)) { - ResetAndInitializeCursor(*topBottom->m_leftRightList); - m_leftRightCursor->First(leftRight); - - UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); - return m_rect; - } - - Reset(); - return m_rect; -} - -// FUNCTION: LEGO1 0x100c4360 -MxRect32* MxRegionCursor::VTable0x30() -{ - MxRegionLeftRight* leftRight; - MxRegionTopBottom* topBottom; - - if (m_leftRightCursor && m_leftRightCursor->Prev(leftRight)) { - m_topBottomCursor->Current(topBottom); - - UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); - return m_rect; - } - - if (m_topBottomCursor->Prev(topBottom)) { - ResetAndInitializeCursor(*topBottom->m_leftRightList); - m_leftRightCursor->Last(leftRight); - - UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); - return m_rect; - } - - Reset(); - return m_rect; -} - -// FUNCTION: LEGO1 0x100c4460 -MxRect32* MxRegionCursor::VTable0x14(MxRect32& p_rect) -{ - m_topBottomCursor->Reset(); - ProcessRectOverlapAscending(p_rect); - return m_rect; -} - -// FUNCTION: LEGO1 0x100c4480 -MxRect32* MxRegionCursor::VTable0x1c(MxRect32& p_rect) -{ - m_topBottomCursor->Reset(); - ProcessOverlapWithRect(p_rect); - return m_rect; -} - -// FUNCTION: LEGO1 0x100c44a0 -MxRect32* MxRegionCursor::VTable0x24(MxRect32& p_rect) -{ - MxRegionLeftRight* leftRight; - - if (m_leftRightCursor && m_leftRightCursor->Next(leftRight)) { - MxRegionTopBottom* topBottom; - - m_topBottomCursor->Current(topBottom); - - if (topBottom->IntersectsWith(p_rect) && leftRight->IntersectsWith(p_rect)) { - UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); - m_rect->Intersect(p_rect); - } - else { - ProcessRectOverlapAscending(p_rect); - } - } - else { - ProcessRectOverlapAscending(p_rect); - } - - return m_rect; -} - -// FUNCTION: LEGO1 0x100c4590 -MxRect32* MxRegionCursor::VTable0x2c(MxRect32& p_rect) -{ - MxRegionLeftRight* leftRight; - - if (m_leftRightCursor && m_leftRightCursor->Prev(leftRight)) { - MxRegionTopBottom* topBottom; - - m_topBottomCursor->Current(topBottom); - - if (topBottom->IntersectsWith(p_rect) && leftRight->IntersectsWith(p_rect)) { - UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); - m_rect->Intersect(p_rect); - } - else { - ProcessOverlapWithRect(p_rect); - } - } - else { - ProcessOverlapWithRect(p_rect); - } - - return m_rect; -} - -// FUNCTION: LEGO1 0x100c4680 -void MxRegionCursor::Reset() -{ - if (m_rect) { - delete m_rect; - m_rect = NULL; - } - - m_topBottomCursor->Reset(); - - if (m_leftRightCursor) { - delete m_leftRightCursor; - m_leftRightCursor = NULL; - } -} - -// FUNCTION: LEGO1 0x100c46c0 -void MxRegionCursor::ResetAndInitializeCursor(MxRegionLeftRightList& p_leftRightList) -{ - if (m_leftRightCursor) { - delete m_leftRightCursor; - } - - m_leftRightCursor = new MxRegionLeftRightListCursor(&p_leftRightList); -} - -// FUNCTION: LEGO1 0x100c4980 -void MxRegionCursor::UpdateRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) -{ - if (!m_rect) { - m_rect = new MxRect32; - } - - m_rect->SetLeft(p_left); - m_rect->SetTop(p_top); - m_rect->SetRight(p_right); - m_rect->SetBottom(p_bottom); -} - -// FUNCTION: LEGO1 0x100c4a20 -void MxRegionCursor::ProcessRectOverlapAscending(MxRect32& p_rect) -{ - MxRegionTopBottom* topBottom; - while (m_topBottomCursor->Next(topBottom)) { - if (p_rect.GetBottom() <= topBottom->GetTop()) { - Reset(); - return; - } - - if (p_rect.GetTop() < topBottom->GetBottom()) { - ResetAndInitializeCursor(*topBottom->m_leftRightList); - - MxRegionLeftRight* leftRight; - while (m_leftRightCursor->Next(leftRight)) { - if (p_rect.GetRight() <= leftRight->GetLeft()) { - break; - } - - if (p_rect.GetLeft() < leftRight->GetRight()) { - UpdateRect( - leftRight->GetLeft(), - topBottom->GetTop(), - leftRight->GetRight(), - topBottom->GetBottom() - ); - m_rect->Intersect(p_rect); - return; - } - } - } - } - - Reset(); -} - -// FUNCTION: LEGO1 0x100c4b50 -void MxRegionCursor::ProcessOverlapWithRect(MxRect32& p_rect) -{ - MxRegionTopBottom* topBottom; - while (m_topBottomCursor->Prev(topBottom)) { - if (topBottom->GetBottom() <= p_rect.GetTop()) { - Reset(); - return; - } - - if (topBottom->GetTop() < p_rect.GetBottom()) { - ResetAndInitializeCursor(*topBottom->m_leftRightList); - - MxRegionLeftRight* leftRight; - while (m_leftRightCursor->Prev(leftRight)) { - if (leftRight->GetRight() <= p_rect.GetLeft()) { - break; - } - - if (leftRight->GetLeft() < p_rect.GetRight()) { - UpdateRect( - leftRight->GetLeft(), - topBottom->GetTop(), - leftRight->GetRight(), - topBottom->GetBottom() - ); - m_rect->Intersect(p_rect); - return; - } - } - } - } - - Reset(); -} diff --git a/LEGO1/omni/src/video/mxvideomanager.cpp b/LEGO1/omni/src/video/mxvideomanager.cpp index f6040ce8..4a6072a0 100644 --- a/LEGO1/omni/src/video/mxvideomanager.cpp +++ b/LEGO1/omni/src/video/mxvideomanager.cpp @@ -32,12 +32,12 @@ MxVideoManager::~MxVideoManager() // FUNCTION: LEGO1 0x100be320 MxResult MxVideoManager::Init() { - this->m_pDirectDraw = NULL; - this->m_pDirect3D = NULL; - this->m_displaySurface = NULL; - this->m_region = NULL; - this->m_videoParam.SetPalette(NULL); - this->m_unk0x60 = FALSE; + m_pDirectDraw = NULL; + m_pDirect3D = NULL; + m_displaySurface = NULL; + m_region = NULL; + m_videoParam.SetPalette(NULL); + m_unk0x60 = FALSE; return SUCCESS; } @@ -86,8 +86,8 @@ void MxVideoManager::Destroy(MxBool p_fromDestructor) // FUNCTION: LEGO1 0x100be3e0 void MxVideoManager::UpdateRegion() { - if (m_region->VTable0x20() == FALSE) { - MxRect32 rect(m_region->GetRect()); + if (m_region->IsEmpty() == FALSE) { + MxRect32 rect(m_region->GetBoundingRect()); rect.Intersect(m_videoParam.GetRect()); m_displaySurface @@ -99,13 +99,13 @@ void MxVideoManager::UpdateRegion() // FUNCTION: BETA10 0x1012ce5e void MxVideoManager::SortPresenterList() { - if (this->m_presenters->GetCount() <= 1) { + if (m_presenters->GetNumElements() <= 1) { return; } - MxPresenterListCursor a(this->m_presenters); - MxPresenterListCursor b(this->m_presenters); - MxU32 count = this->m_presenters->GetCount() - 1; + MxPresenterListCursor a(m_presenters); + MxPresenterListCursor b(m_presenters); + MxU32 count = m_presenters->GetNumElements() - 1; MxBool finished; if (count != 0) { @@ -302,7 +302,7 @@ void MxVideoManager::InvalidateRect(MxRect32& p_rect) m_criticalSection.Enter(); if (m_region) { - m_region->VTable0x18(p_rect); + m_region->AddRect(p_rect); } m_criticalSection.Leave(); @@ -316,7 +316,7 @@ MxResult MxVideoManager::Tickle() SortPresenterList(); MxPresenter* presenter; - MxPresenterListCursor cursor(this->m_presenters); + MxPresenterListCursor cursor(m_presenters); while (cursor.Next(presenter)) { presenter->Tickle(); @@ -339,14 +339,14 @@ MxResult MxVideoManager::RealizePalette(MxPalette* p_palette) { PALETTEENTRY paletteEntries[256]; - this->m_criticalSection.Enter(); + m_criticalSection.Enter(); - if (p_palette && this->m_videoParam.GetPalette()) { + if (p_palette && m_videoParam.GetPalette()) { p_palette->GetEntries(paletteEntries); - this->m_videoParam.GetPalette()->SetEntries(paletteEntries); - this->m_displaySurface->SetPalette(this->m_videoParam.GetPalette()); + m_videoParam.GetPalette()->SetEntries(paletteEntries); + m_displaySurface->SetPalette(m_videoParam.GetPalette()); } - this->m_criticalSection.Leave(); + m_criticalSection.Leave(); return SUCCESS; } diff --git a/LEGO1/omni/src/video/mxvideopresenter.cpp b/LEGO1/omni/src/video/mxvideopresenter.cpp index c92e5dc4..a045ae95 100644 --- a/LEGO1/omni/src/video/mxvideopresenter.cpp +++ b/LEGO1/omni/src/video/mxvideopresenter.cpp @@ -5,7 +5,7 @@ #include "mxdsmediaaction.h" #include "mxdssubscriber.h" #include "mxmisc.h" -#include "mxregioncursor.h" +#include "mxregion.h" #include "mxvideomanager.h" DECOMP_SIZE_ASSERT(MxVideoPresenter, 0x64); @@ -342,7 +342,7 @@ void MxVideoPresenter::PutFrame() MxRegionCursor cursor(region); MxRect32* regionRect; - while ((regionRect = cursor.VTable0x24(rect))) { + while ((regionRect = cursor.Next(rect))) { if (regionRect->GetWidth() >= 1 && regionRect->GetHeight() >= 1) { RECT src, dest;