Implement/match MxVideoManager::InvalidateRect and UpdateRegion ()

* Implement/match MxVideoManager::InvalidateRect and UpdateRegion

* Update comment
This commit is contained in:
Christian Semmler 2023-10-16 19:20:52 -04:00 committed by GitHub
parent 8b1c8f7abe
commit 727c748ecd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 12 deletions

View file

@ -21,7 +21,7 @@ void MxRegion::Reset()
} }
// OFFSET: LEGO1 0x100c3750 STUB // OFFSET: LEGO1 0x100c3750 STUB
void MxRegion::vtable18() void MxRegion::vtable18(MxRect32 &p_rect)
{ {
// TODO // TODO
} }
@ -33,7 +33,8 @@ void MxRegion::vtable1c()
} }
// OFFSET: LEGO1 0x100c3660 STUB // OFFSET: LEGO1 0x100c3660 STUB
void MxRegion::vtable20() MxBool MxRegion::vtable20()
{ {
// TODO // TODO
return FALSE;
} }

View file

@ -2,6 +2,7 @@
#define MXREGION_H #define MXREGION_H
#include "mxcore.h" #include "mxcore.h"
#include "mxrect32.h"
#include "decomp.h" #include "decomp.h"
// VTABLE 0x100dcae8 // VTABLE 0x100dcae8
@ -13,16 +14,17 @@ public:
virtual ~MxRegion() override; virtual ~MxRegion() override;
virtual void Reset(); virtual void Reset();
virtual void vtable18(); virtual void vtable18(MxRect32 &p_rect);
virtual void vtable1c(); virtual void vtable1c();
virtual void vtable20(); virtual MxBool vtable20();
inline MxRect32 &GetRect() { return this->m_rect; }
private: private:
// A container (probably MxList) holding MxRect32 // A container (probably MxList) holding MxRect32
// MxList<MxRect32> *m_rects; // MxList<MxRect32*> *m_rects;
// 4 coordinates (could be MxRect32) undefined4 m_unk08;
// MxS32 left, top, right, bottom; MxRect32 m_rect;
undefined pad[0x14];
}; };
#endif // MXREGION_H #endif // MXREGION_H

View file

@ -120,10 +120,34 @@ void MxVideoManager::SortPresenterList()
} }
} }
// OFFSET: LEGO1 0x100be3e0 STUB // OFFSET: LEGO1 0x100be3e0
void MxVideoManager::UpdateRegion() void MxVideoManager::UpdateRegion()
{ {
// TODO if (m_region->vtable20() == FALSE) {
MxS32 left, top, right, bottom;
MxRect32 &regionRect = m_region->GetRect();
left = m_videoParam.GetRect().m_left;
if (left <= regionRect.m_left)
left = regionRect.m_left;
top = regionRect.m_top;
if (top <= m_videoParam.GetRect().m_top)
top = m_videoParam.GetRect().m_top;
right = regionRect.m_right;
if (right >= m_videoParam.GetRect().m_right)
right = m_videoParam.GetRect().m_right;
bottom = m_videoParam.GetRect().m_bottom;
if (bottom >= regionRect.m_bottom)
bottom = regionRect.m_bottom;
m_displaySurface->Display(
left, top, left, top,
right - left + 1, bottom - top + 1
);
}
} }
// OFFSET: LEGO1 0x100bea50 // OFFSET: LEGO1 0x100bea50
@ -132,10 +156,15 @@ void MxVideoManager::Destroy()
Destroy(FALSE); Destroy(FALSE);
} }
// OFFSET: LEGO1 0x100bea60 STUB // OFFSET: LEGO1 0x100bea60
void MxVideoManager::InvalidateRect(MxRect32 &p_rect) void MxVideoManager::InvalidateRect(MxRect32 &p_rect)
{ {
// TODO m_criticalSection.Enter();
if (m_region)
m_region->vtable18(p_rect);
m_criticalSection.Leave();
} }
// OFFSET: LEGO1 0x100bebe0 // OFFSET: LEGO1 0x100bebe0