diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index 6024b8f6..f8d9711b 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.GetAtomId(), 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 diff --git a/LEGO1/mxomnicreateparam.cpp b/LEGO1/mxomnicreateparam.cpp index 06a3567c..96bd541d 100644 --- a/LEGO1/mxomnicreateparam.cpp +++ b/LEGO1/mxomnicreateparam.cpp @@ -1,9 +1,9 @@ #include "mxomnicreateparam.h" -MxOmniCreateParam::MxOmniCreateParam(const char *mediaPath, HWND windowHandle, MxVideoParam &vparam, MxOmniCreateFlags flags) +MxOmniCreateParam::MxOmniCreateParam(const char *mediaPath, struct HWND__ *windowHandle, MxVideoParam &vparam, MxOmniCreateFlags flags) { this->m_mediaPath = mediaPath; - this->m_windowHandle = windowHandle; + this->m_windowHandle = (HWND) windowHandle; this->m_videoParam = vparam; this->m_createFlags = flags; } diff --git a/LEGO1/mxomnicreateparam.h b/LEGO1/mxomnicreateparam.h index c1e8570f..3729e969 100644 --- a/LEGO1/mxomnicreateparam.h +++ b/LEGO1/mxomnicreateparam.h @@ -11,7 +11,7 @@ class MxOmniCreateParam : public MxOmniCreateParamBase { public: - __declspec(dllexport) MxOmniCreateParam(const char *mediaPath, HWND windowHandle, MxVideoParam &vparam, MxOmniCreateFlags flags); + __declspec(dllexport) MxOmniCreateParam(const char *mediaPath, struct HWND__ *windowHandle, MxVideoParam &vparam, MxOmniCreateFlags flags); // virtual void vtable00(); seems to be a destructor const MxOmniCreateFlags& CreateFlags() const { return this->m_createFlags; } diff --git a/LEGO1/viewmanager.h b/LEGO1/viewmanager.h index 3554c6c9..9abe5612 100644 --- a/LEGO1/viewmanager.h +++ b/LEGO1/viewmanager.h @@ -1,6 +1,8 @@ #ifndef VIEWMANAGER_H #define VIEWMANAGER_H +class ViewROI; + class ViewManager { public: diff --git a/isle.mak b/isle.mak index fb2e0e1c..3048fc03 100644 --- a/isle.mak +++ b/isle.mak @@ -489,6 +489,8 @@ SOURCE=.\LEGO1\dllmain.cpp SOURCE=.\LEGO1\legoomni.cpp DEP_CPP_LEGOO=\ + ".\LEGO1\lego3dmanager.h"\ + ".\LEGO1\lego3dview.h"\ ".\LEGO1\legoanimationmanager.h"\ ".\LEGO1\legobuildingmanager.h"\ ".\LEGO1\legoentity.h"\ @@ -522,6 +524,7 @@ DEP_CPP_LEGOO=\ ".\LEGO1\mxvariabletable.h"\ ".\LEGO1\mxvideoparam.h"\ ".\LEGO1\mxvideoparamflags.h"\ + ".\LEGO1\viewmanager.h"\ "$(INTDIR)\legoomni.obj" : $(SOURCE) $(DEP_CPP_LEGOO) "$(INTDIR)" @@ -660,8 +663,12 @@ DEP_CPP_MXOMNIC=\ ".\LEGO1\mxomnicreateflags.h"\ ".\LEGO1\mxomnicreateparam.h"\ ".\LEGO1\mxomnicreateparambase.h"\ + ".\LEGO1\mxpalette.h"\ + ".\LEGO1\mxrect32.h"\ ".\LEGO1\mxstring.h"\ + ".\LEGO1\mxvariabletable.h"\ ".\LEGO1\mxvideoparam.h"\ + ".\LEGO1\mxvideoparamflags.h"\ "$(INTDIR)\mxomnicreateparambase.obj" : $(SOURCE) $(DEP_CPP_MXOMNIC)\ @@ -767,6 +774,8 @@ DEP_CPP_ISLE_=\ ".\ISLE\define.h"\ ".\ISLE\isle.h"\ ".\ISLE\res\resource.h"\ + ".\LEGO1\lego3dmanager.h"\ + ".\LEGO1\lego3dview.h"\ ".\LEGO1\legoanimationmanager.h"\ ".\LEGO1\legobuildingmanager.h"\ ".\LEGO1\legoentity.h"\ @@ -802,6 +811,7 @@ DEP_CPP_ISLE_=\ ".\LEGO1\mxvariabletable.h"\ ".\LEGO1\mxvideoparam.h"\ ".\LEGO1\mxvideoparamflags.h"\ + ".\LEGO1\viewmanager.h"\ "$(INTDIR)\isle.obj" : $(SOURCE) $(DEP_CPP_ISLE_) "$(INTDIR)"