From 30989aec9cea0fed6b62641319fb35cd113fcb64 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sun, 18 Jun 2023 13:45:39 +0200 Subject: [PATCH] add Lego3DManager and related, fix a function signature --- ISLE/isle.cpp | 7 ++----- LEGO1/lego3dmanager.h | 17 +++++++++++++++++ LEGO1/lego3dview.h | 16 ++++++++++++++++ LEGO1/legoomni.cpp | 5 +++++ LEGO1/legoomni.h | 6 ++++-- LEGO1/legovideomanager.h | 11 ++++++----- 6 files changed, 50 insertions(+), 12 deletions(-) create mode 100755 LEGO1/lego3dmanager.h create mode 100755 LEGO1/lego3dview.h diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index e3483cd5..96479e93 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isle.cpp @@ -85,10 +85,7 @@ void Isle::close() InputManager()->QueueEvent(KEYDOWN, 0, 0, 0, 0x20); } - // FIXME: Untangle - //VideoManager()->GetViewManager()->RemoveAll(NULL); - //ViewManager::RemoveAll - // (*(ViewManager **)(*(int *)(*(int *)(pLVar4 + 0x68) + 8) + 0x88), NULL); + VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveAll(NULL); long local_88 = 0; Lego()->RemoveWorld(ds.m_atomId, local_88); @@ -102,7 +99,7 @@ void Isle::close() } while (lVar8 == 0); while (Lego()) { - if (Lego()->vtable28(ds) != 0) { + if (Lego()->vtable28(ds) != MX_FALSE) { break; } diff --git a/LEGO1/lego3dmanager.h b/LEGO1/lego3dmanager.h new file mode 100755 index 00000000..3e4de5ce --- /dev/null +++ b/LEGO1/lego3dmanager.h @@ -0,0 +1,17 @@ +#ifndef LEGO3DMANAGER_H +#define LEGO3DMANAGER_H + +#include "lego3dview.h" + +class Lego3DManager +{ +public: + inline Lego3DView *GetLego3DView() { return this->m_3dView; } + +private: + int m_unk00; + int m_unk04; + Lego3DView *m_3dView; +}; + +#endif // LEGO3DMANAGER_H diff --git a/LEGO1/lego3dview.h b/LEGO1/lego3dview.h new file mode 100755 index 00000000..3ab2da30 --- /dev/null +++ b/LEGO1/lego3dview.h @@ -0,0 +1,16 @@ +#ifndef LEGO3DVIEW_H +#define LEGO3DVIEW_H + +#include "viewmanager.h" + +class Lego3DView +{ +public: + inline ViewManager *GetViewManager() { return this->m_viewManager; } + +private: + char unknown[0x88]; + ViewManager *m_viewManager; +}; + +#endif // LEGO3DVIEW_H diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index e43be3bd..5ab9e866 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -11,3 +11,8 @@ LegoOmni *Lego() { return LegoOmni::GetInstance(); } + +LegoVideoManager *VideoManager() +{ + return LegoOmni::GetInstance()->GetVideoManager(); +} \ No newline at end of file diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index 1d4d92ef..42421e22 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -28,6 +28,7 @@ class MxMusicManager; class MxNotificationManager; class MxSoundManager; +// class LegoOmni : public MxOmni class LegoOmni { public: @@ -48,7 +49,7 @@ class LegoOmni virtual void vtable1c(); virtual void vtable20(); virtual void vtable24(MxDSAction &ds); - virtual int vtable28(MxDSAction &ds); + virtual MxBool vtable28(MxDSAction &ds); virtual void vtable2c(); virtual void vtable30(); virtual void vtable34(); @@ -56,6 +57,7 @@ class LegoOmni virtual void vtable3c(); virtual unsigned char vtable40(); + LegoVideoManager *GetVideoManager() { return m_videoMgr; } LegoInputManager *GetInputManager() { return m_inputMgr; } private: @@ -69,7 +71,7 @@ class LegoOmni int m_unk20; int m_unk24; int m_unk28; - int m_unk2c; + LegoVideoManager *m_videoMgr; int m_unk30; int m_unk34; int m_unk38; diff --git a/LEGO1/legovideomanager.h b/LEGO1/legovideomanager.h index fd370715..a221504f 100644 --- a/LEGO1/legovideomanager.h +++ b/LEGO1/legovideomanager.h @@ -1,17 +1,19 @@ #ifndef LEGOVIDEOMANAGER_H #define LEGOVIDEOMANAGER_H +#include "lego3dmanager.h" + +// class LegoVideoManager : public MxVideoManager class LegoVideoManager { public: __declspec(dllexport) int EnableRMDevice(); - __declspec(dllexport) int DisableRMDevice(); - __declspec(dllexport) void EnableFullScreenMovie(unsigned char a, unsigned char b); - __declspec(dllexport) void MoveCursor(int x, int y); + inline Lego3DManager *Get3DManager() { return this->m_3dManager; } + int m_unk00; int m_unk04; int m_unk08; @@ -38,11 +40,10 @@ class LegoVideoManager int m_unk5c; int m_unk60; int m_unk64; - int m_unk68; + Lego3DManager *m_3dManager; int m_unk6c; int m_unk70; int *m_unk74; - }; #endif // LEGOVIDEOMANAGER_H