Fix some vtables

This commit is contained in:
Christian Semmler 2023-12-12 06:30:54 -05:00
parent d11973eadd
commit a9016e9811
13 changed files with 54 additions and 36 deletions

View File

@ -24,7 +24,7 @@ LegoEntityPresenter::~LegoEntityPresenter()
} }
// FUNCTION: LEGO1 0x10053630 // FUNCTION: LEGO1 0x10053630
undefined4 LegoEntityPresenter::vtable6c(undefined4 p_unknown) undefined4 LegoEntityPresenter::VTable0x6c(undefined4 p_unknown)
{ {
m_unk0x4c = p_unknown; m_unk0x4c = p_unknown;
return 0; return 0;

View File

@ -23,9 +23,9 @@ class LegoEntityPresenter : public MxCompositePresenter {
return !strcmp(p_name, LegoEntityPresenter::ClassName()) || MxCompositePresenter::IsA(p_name); return !strcmp(p_name, LegoEntityPresenter::ClassName()) || MxCompositePresenter::IsA(p_name);
} }
virtual void Destroy() override; // vtable+0x38 virtual void Destroy() override; // vtable+0x38
virtual void Init(); // vtable+0x68 virtual void Init(); // vtable+0x68
virtual undefined4 vtable6c(undefined4 p_unknown); // vtable+0x6c virtual undefined4 VTable0x6c(undefined4 p_unknown); // vtable+0x6c
private: private:
void Destroy(MxBool p_fromDestructor); void Destroy(MxBool p_fromDestructor);

View File

@ -94,7 +94,7 @@ void LegoVideoManager::SetSkyColor(float p_red, float p_green, float p_blue)
m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE); m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE);
// TODO 3d manager // TODO 3d manager
// m_3dManager->m_pViewport->vtable1c(red, green, blue) // m_3dManager->m_pViewport->VTable0x1c(red, green, blue)
} }
// STUB: LEGO1 0x1007c560 // STUB: LEGO1 0x1007c560

View File

@ -27,7 +27,7 @@ inline MxLong _Abs(MxLong p_value)
} }
// FUNCTION: LEGO1 0x1004e0d0 // FUNCTION: LEGO1 0x1004e0d0
int MxBitmap::vtable28(int) int MxBitmap::VTable0x28(int)
{ {
return -1; return -1;
} }
@ -232,12 +232,12 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle)
} }
// STUB: LEGO1 0x100bce70 // STUB: LEGO1 0x100bce70
void MxBitmap::vtable2c(int, int, int, int, int, int, int) void MxBitmap::VTable0x2c(int, int, int, int, int, int, int)
{ {
} }
// STUB: LEGO1 0x100bd020 // STUB: LEGO1 0x100bd020
void MxBitmap::vtable30(int, int, int, int, int, int, int) void MxBitmap::VTable0x30(int, int, int, int, int, int, int)
{ {
} }

View File

@ -40,9 +40,9 @@ class MxBitmap : public MxCore {
virtual MxResult SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, MxBool); // vtable+1c virtual MxResult SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, MxBool); // vtable+1c
virtual MxResult LoadFile(HANDLE p_handle); // vtable+20 virtual MxResult LoadFile(HANDLE p_handle); // vtable+20
__declspec(dllexport) virtual MxLong Read(const char* p_filename); // vtable+24 __declspec(dllexport) virtual MxLong Read(const char* p_filename); // vtable+24
virtual int vtable28(int); virtual int VTable0x28(int);
virtual void vtable2c(int, int, int, int, int, int, int); virtual void VTable0x2c(int, int, int, int, int, int, int);
virtual void vtable30(int, int, int, int, int, int, int); virtual void VTable0x30(int, int, int, int, int, int, int);
__declspec(dllexport) virtual MxPalette* CreatePalette(); // vtable+34 __declspec(dllexport) virtual MxPalette* CreatePalette(); // vtable+34
virtual void ImportPalette(MxPalette* p_palette); // vtable+38 virtual void ImportPalette(MxPalette* p_palette); // vtable+38
virtual MxResult SetBitDepth(MxBool); // vtable+3c virtual MxResult SetBitDepth(MxBool); // vtable+3c

View File

@ -185,13 +185,13 @@ void MxDisplaySurface::SetPalette(MxPalette* p_palette)
} }
// STUB: LEGO1 0x100bacc0 // STUB: LEGO1 0x100bacc0
MxBool MxDisplaySurface::vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4) MxBool MxDisplaySurface::VTable0x28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
{ {
return 0; return 0;
} }
// STUB: LEGO1 0x100bb1d0 // STUB: LEGO1 0x100bb1d0
MxBool MxDisplaySurface::vtable30( MxBool MxDisplaySurface::VTable0x30(
undefined4, undefined4,
undefined4, undefined4,
undefined4, undefined4,
@ -206,7 +206,7 @@ MxBool MxDisplaySurface::vtable30(
} }
// STUB: LEGO1 0x100bb850 // STUB: LEGO1 0x100bb850
undefined4 MxDisplaySurface::vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4) undefined4 MxDisplaySurface::VTable0x34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
{ {
return 0; return 0;
} }
@ -233,13 +233,13 @@ void MxDisplaySurface::ReleaseDC(HDC p_hdc)
} }
// STUB: LEGO1 0x100bbc60 // STUB: LEGO1 0x100bbc60
LPDIRECTDRAWSURFACE MxDisplaySurface::vtable44(MxBitmap*, undefined4*, undefined4, undefined4) LPDIRECTDRAWSURFACE MxDisplaySurface::VTable0x44(MxBitmap*, undefined4*, undefined4, undefined4)
{ {
return NULL; return NULL;
} }
// STUB: LEGO1 0x100bc200 // STUB: LEGO1 0x100bc200
void MxDisplaySurface::vtable24( void MxDisplaySurface::VTable0x24(
LPDDSURFACEDESC, LPDDSURFACEDESC,
MxBitmap*, MxBitmap*,
undefined4, undefined4,
@ -253,8 +253,17 @@ void MxDisplaySurface::vtable24(
} }
// STUB: LEGO1 0x100bc630 // STUB: LEGO1 0x100bc630
MxBool MxDisplaySurface:: MxBool MxDisplaySurface::VTable0x2c(
vtable2c(LPDDSURFACEDESC, MxBitmap*, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool) LPDDSURFACEDESC,
MxBitmap*,
undefined4,
undefined4,
undefined4,
undefined4,
undefined4,
undefined4,
MxBool
)
{ {
return 0; return 0;
} }

View File

@ -29,7 +29,7 @@ class MxDisplaySurface : public MxCore {
virtual MxResult Create(MxVideoParam& p_videoParam); virtual MxResult Create(MxVideoParam& p_videoParam);
virtual void Clear(); virtual void Clear();
virtual void SetPalette(MxPalette* p_palette); virtual void SetPalette(MxPalette* p_palette);
virtual void vtable24( virtual void VTable0x24(
LPDDSURFACEDESC, LPDDSURFACEDESC,
MxBitmap*, MxBitmap*,
undefined4, undefined4,
@ -39,8 +39,8 @@ class MxDisplaySurface : public MxCore {
undefined4, undefined4,
undefined4 undefined4
); );
virtual MxBool vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4); virtual MxBool VTable0x28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
virtual MxBool vtable2c( virtual MxBool VTable0x2c(
LPDDSURFACEDESC, LPDDSURFACEDESC,
MxBitmap*, MxBitmap*,
undefined4, undefined4,
@ -51,12 +51,21 @@ class MxDisplaySurface : public MxCore {
undefined4, undefined4,
MxBool MxBool
); );
virtual MxBool vtable30(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool); virtual MxBool VTable0x30(
virtual undefined4 vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4); undefined4,
undefined4,
undefined4,
undefined4,
undefined4,
undefined4,
undefined4,
MxBool
);
virtual undefined4 VTable0x34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
virtual void Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4); virtual void Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
virtual void GetDC(HDC* p_hdc); virtual void GetDC(HDC* p_hdc);
virtual void ReleaseDC(HDC p_hdc); virtual void ReleaseDC(HDC p_hdc);
virtual LPDIRECTDRAWSURFACE vtable44(MxBitmap*, undefined4*, undefined4, undefined4); virtual LPDIRECTDRAWSURFACE VTable0x44(MxBitmap*, undefined4*, undefined4, undefined4);
inline LPDIRECTDRAWSURFACE GetDirectDrawSurface1() { return this->m_ddSurface1; } inline LPDIRECTDRAWSURFACE GetDirectDrawSurface1() { return this->m_ddSurface1; }
inline LPDIRECTDRAWSURFACE GetDirectDrawSurface2() { return this->m_ddSurface2; } inline LPDIRECTDRAWSURFACE GetDirectDrawSurface2() { return this->m_ddSurface2; }

View File

@ -15,7 +15,7 @@ MxRegion::MxRegion()
} }
// FUNCTION: LEGO1 0x100c3660 // FUNCTION: LEGO1 0x100c3660
MxBool MxRegion::vtable20() MxBool MxRegion::VTable0x20()
{ {
return m_list->GetCount() == 0; return m_list->GetCount() == 0;
} }
@ -36,7 +36,7 @@ void MxRegion::Reset()
} }
// FUNCTION: LEGO1 0x100c3750 // FUNCTION: LEGO1 0x100c3750
void MxRegion::vtable18(MxRect32& p_rect) void MxRegion::VTable0x18(MxRect32& p_rect)
{ {
MxRect32 rect(p_rect.GetPoint(), MxSize32(p_rect.GetRight(), p_rect.GetBottom())); MxRect32 rect(p_rect.GetPoint(), MxSize32(p_rect.GetRight(), p_rect.GetBottom()));
MxRegionListCursor cursor(m_list); MxRegionListCursor cursor(m_list);
@ -105,7 +105,7 @@ void MxRegion::vtable18(MxRect32& p_rect)
// MxRegionListCursor::~MxRegionListCursor // MxRegionListCursor::~MxRegionListCursor
// FUNCTION: LEGO1 0x100c3e20 // FUNCTION: LEGO1 0x100c3e20
MxBool MxRegion::vtable1c(MxRect32& p_rect) MxBool MxRegion::VTable0x1c(MxRect32& p_rect)
{ {
if (!m_rect.IntersectsWith(p_rect)) if (!m_rect.IntersectsWith(p_rect))
return FALSE; return FALSE;

View File

@ -58,9 +58,9 @@ class MxRegion : public MxCore {
virtual ~MxRegion() override; virtual ~MxRegion() override;
virtual void Reset(); virtual void Reset();
virtual void vtable18(MxRect32& p_rect); virtual void VTable0x18(MxRect32& p_rect);
virtual MxBool vtable1c(MxRect32& p_rect); virtual MxBool VTable0x1c(MxRect32& p_rect);
virtual MxBool vtable20(); virtual MxBool VTable0x20();
inline MxRect32& GetRect() { return this->m_rect; } inline MxRect32& GetRect() { return this->m_rect; }

View File

@ -30,7 +30,7 @@ class MxRegionList : public MxPtrList<MxRegionTopBottom> {
// class MxListCursor<MxRegionTopBottom *> // class MxListCursor<MxRegionTopBottom *>
// TODO: The initialize list param type should be MxRegionList, but doing that // TODO: The initialize list param type should be MxRegionList, but doing that
// drastically reduced the match percentage for MxRegion::vtable18. // drastically reduced the match percentage for MxRegion::VTable0x18.
// It also works with MxPtrList, so we'll do that until we figure this out. // It also works with MxPtrList, so we'll do that until we figure this out.
// VTABLE: LEGO1 0x100dcb88 // VTABLE: LEGO1 0x100dcb88

View File

@ -93,7 +93,7 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
if (m_flags & Flag_Bit2) { if (m_flags & Flag_Bit2) {
undefined4 unk = 0; undefined4 unk = 0;
m_unk0x58 = MxOmni::GetInstance()->GetVideoManager()->GetDisplaySurface()->vtable44( m_unk0x58 = MxOmni::GetInstance()->GetVideoManager()->GetDisplaySurface()->VTable0x44(
m_bitmap, m_bitmap,
&unk, &unk,
(m_flags & Flag_Bit4) / 8, (m_flags & Flag_Bit4) / 8,

View File

@ -572,7 +572,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc)
if ((m_waitIndicator->GetAction()->GetFlags() & MxDSAction::Flag_Bit5) != 0) { if ((m_waitIndicator->GetAction()->GetFlags() & MxDSAction::Flag_Bit5) != 0) {
MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface(); MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface();
MxBool unkbool = FALSE; MxBool unkbool = FALSE;
displaySurface->vtable2c( displaySurface->VTable0x2c(
ddsc, ddsc,
m_waitIndicator->GetBitmap(), m_waitIndicator->GetBitmap(),
0, 0,
@ -586,7 +586,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc)
} }
else { else {
MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface(); MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface();
displaySurface->vtable24( displaySurface->VTable0x24(
ddsc, ddsc,
m_waitIndicator->GetBitmap(), m_waitIndicator->GetBitmap(),
0, 0,

View File

@ -74,7 +74,7 @@ void MxVideoManager::Destroy(MxBool p_fromDestructor)
// FUNCTION: LEGO1 0x100be3e0 // FUNCTION: LEGO1 0x100be3e0
void MxVideoManager::UpdateRegion() void MxVideoManager::UpdateRegion()
{ {
if (m_region->vtable20() == FALSE) { if (m_region->VTable0x20() == FALSE) {
MxRect32 rect(m_region->GetRect(), m_videoParam.GetRect()); MxRect32 rect(m_region->GetRect(), m_videoParam.GetRect());
m_displaySurface m_displaySurface
->Display(rect.GetLeft(), rect.GetTop(), rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight()); ->Display(rect.GetLeft(), rect.GetTop(), rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight());
@ -268,7 +268,7 @@ void MxVideoManager::InvalidateRect(MxRect32& p_rect)
m_criticalSection.Enter(); m_criticalSection.Enter();
if (m_region) if (m_region)
m_region->vtable18(p_rect); m_region->VTable0x18(p_rect);
m_criticalSection.Leave(); m_criticalSection.Leave();
} }