Implement a few Mx* functions / add data types (#25)

* Implement a few Mx* functions / add data types

* added more information, fixed formatting issues

* further cleanup

---------

Co-authored-by: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
This commit is contained in:
ecumber 2023-06-18 22:36:07 -07:00 committed by GitHub
parent 1152feab8d
commit 526c6af1f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 164 additions and 91 deletions

View file

@ -1,7 +1,12 @@
#include "isle.h" #include "isle.h"
#include "define.h" #include "define.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legomodelpresenter.h"
#include "legoomni.h" #include "legoomni.h"
#include "legopartpresenter.h"
#include "legoworldpresenter.h"
#include "mxdirectdraw.h" #include "mxdirectdraw.h"
#include "mxdsaction.h" #include "mxdsaction.h"
#include "mxomni.h" #include "mxomni.h"

View file

@ -1,6 +1,8 @@
#ifndef LEGOINPUTMANAGER_H #ifndef LEGOINPUTMANAGER_H
#define LEGOINPUTMANAGER_H #define LEGOINPUTMANAGER_H
#include "mxcore.h"
__declspec(dllexport) enum NotificationId __declspec(dllexport) enum NotificationId
{ {
NONE = 0, NONE = 0,

View file

@ -1,17 +1,15 @@
#include "legoomni.h" #include "legoomni.h"
LegoOmni *LegoOmni::m_instance = NULL;
// OFFSET: LEGO1 0x1005ad10 // OFFSET: LEGO1 0x1005ad10
LegoOmni *LegoOmni::GetInstance() LegoOmni *LegoOmni::GetInstance()
{ {
return m_instance; return (LegoOmni *) m_instance;
} }
// OFFSET: LEGO1 0x10015700 // OFFSET: LEGO1 0x10015700
LegoOmni *Lego() LegoOmni *Lego()
{ {
return LegoOmni::GetInstance(); return (LegoOmni *) MxOmni::GetInstance();
} }
// OFFSET: LEGO1 0x10015720 // OFFSET: LEGO1 0x10015720

View file

@ -1,35 +1,23 @@
#ifndef LEGOOMNI_H #ifndef LEGOOMNI_H
#define LEGOOMNI_H #define LEGOOMNI_H
#include "legoentity.h"
#include "legoinputmanager.h"
#include "legogamestate.h"
#include "legonavcontroller.h"
#include "legoroi.h"
#include "legovideomanager.h"
#include "mxatomid.h"
#include "mxbackgroundaudiomanager.h" #include "mxbackgroundaudiomanager.h"
#include "mxdsaction.h" #include "mxdsaction.h"
#include "mxdsfile.h" #include "mxdsfile.h"
#include "mxdsobject.h" #include "mxdsobject.h"
#include "mxomnicreateparam.h" #include "mxomni.h"
#include "mxresult.h"
#include "mxstreamer.h"
#include "mxticklemanager.h"
#include "mxtimer.h"
#include "mxtransitionmanager.h" #include "mxtransitionmanager.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legoentity.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legomodelpresenter.h"
#include "legopartpresenter.h"
#include "legoroi.h"
#include "legoworldpresenter.h"
#include "legovideomanager.h"
class LegoSoundManager; class LegoSoundManager;
class MxEventManager;
class MxMusicManager;
class MxNotificationManager;
class MxSoundManager;
// class LegoOmni : public MxOmni class LegoOmni : public MxOmni
class LegoOmni
{ {
public: public:
__declspec(dllexport) void CreateBackgroundAudio(); __declspec(dllexport) void CreateBackgroundAudio();
@ -38,15 +26,14 @@ class LegoOmni
__declspec(dllexport) static void CreateInstance(); __declspec(dllexport) static void CreateInstance();
__declspec(dllexport) static LegoOmni *GetInstance(); __declspec(dllexport) static LegoOmni *GetInstance();
virtual ~LegoOmni(); virtual ~LegoOmni(); // vtable+00
virtual void vtable04(); virtual long Notify(MxParam &p); // vtable+04
virtual void vtable08(); virtual const char *GetClassName() const; // vtable+0c
virtual void vtable0c(); virtual MxBool IsClass(const char *name) const; // vtable+10;
virtual void vtable10(); virtual void Init(); // vtable+14
virtual void vtable14(); virtual MxResult Create(MxOmniCreateParam &p); // vtable+18
virtual MxResult Create(const MxOmniCreateParam &p); virtual void Destroy(); // vtable+1c
virtual void vtable1c();
virtual void vtable20(); virtual void vtable20();
virtual void vtable24(MxDSAction &ds); virtual void vtable24(MxDSAction &ds);
virtual MxBool vtable28(MxDSAction &ds); virtual MxBool vtable28(MxDSAction &ds);
@ -57,40 +44,20 @@ class LegoOmni
virtual void vtable3c(); virtual void vtable3c();
virtual unsigned char vtable40(); virtual unsigned char vtable40();
LegoVideoManager *GetVideoManager() { return m_videoMgr; } LegoVideoManager *GetVideoManager() { return (LegoVideoManager *) m_videoManager; }
LegoInputManager *GetInputManager() { return m_inputMgr; } LegoInputManager *GetInputManager() { return m_inputMgr; }
private: private:
int m_unk04;
int m_unk08;
int m_unk0c;
int m_unk10;
int m_unk14;
int m_unk18;
int m_unk1c;
int m_unk20;
int m_unk24;
int m_unk28;
LegoVideoManager *m_videoMgr;
int m_unk30;
int m_unk34;
int m_unk38;
int m_unk3c;
int m_unk40;
int m_unk44;
int m_unk48;
int m_unk4c;
int m_unk50;
int m_unk54;
int m_unk58;
int m_unk5c;
int m_unk60;
int m_unk64;
int m_unk68; int m_unk68;
int m_unk6c; int m_unk6c;
LegoInputManager *m_inputMgr; LegoInputManager *m_inputMgr; // 0x70
char m_unk74[0x10];
static LegoOmni *m_instance; LegoNavController *m_navController; // 0x84
char m_unk88[0x14];
LegoGameState *m_gameState; // 0x9c
char m_unka0[0x94];
MxBackgroundAudioManager *m_bkgAudioManager; // 0x134
MxTransitionManager *m_transitionManager; // 0x138
}; };

View file

@ -9,11 +9,11 @@ class MxCore
{ {
public: public:
__declspec(dllexport) MxCore(); __declspec(dllexport) MxCore();
__declspec(dllexport) virtual ~MxCore(); __declspec(dllexport) virtual ~MxCore(); // vtable+00
__declspec(dllexport) virtual long Notify(MxParam &p); __declspec(dllexport) virtual long Notify(MxParam &p); // vtable+04
virtual long Tickle(); virtual long Tickle(); // vtable+08
virtual const char *GetClassName() const; virtual const char *GetClassName() const; // vtable+0c
virtual MxBool IsClass(const char *name) const; virtual MxBool IsClass(const char *name) const; // vtable+10
private: private:
unsigned int m_id; unsigned int m_id;

6
LEGO1/mxdsfile.cpp Normal file
View file

@ -0,0 +1,6 @@
#include "mxdsfile.h"
unsigned long MxDSFile::GetBufferSize()
{
return this->m_buffersize;
}

View file

@ -12,6 +12,9 @@ class MxDSFile
__declspec(dllexport) virtual long Open(unsigned long); __declspec(dllexport) virtual long Open(unsigned long);
__declspec(dllexport) virtual long Read(unsigned char *,unsigned long); __declspec(dllexport) virtual long Read(unsigned char *,unsigned long);
__declspec(dllexport) virtual long Seek(long,int); __declspec(dllexport) virtual long Seek(long,int);
private:
char m_unknown[0x70];
unsigned long m_buffersize;
}; };
#endif // MXDSFILE_H #endif // MXDSFILE_H

9
LEGO1/mxeventmanager.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef MXEVENTMANAGER_H
#define MXEVENTMANAGER_H
class MxEventManager
{
};
#endif // MXEVENTMANAGER_H

9
LEGO1/mxmusicmanager.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef MXMUSICMANAGER_H
#define MXMUSICMANAGER_H
class MxMusicManager
{
};
#endif // MXMUSICMANAGER_H

View file

@ -0,0 +1,9 @@
#ifndef MXNOTIFICATIONMANAGER_H
#define MXNOTIFICATIONMANAGER_H
class MxNotificationManager
{
};
#endif // MXNOTIFICATIONMANAGER_H

9
LEGO1/mxobjectfactory.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef MXOBJECTFACTORY_H
#define MXOBJECTFACTORY_H
class MxObjectFactory
{
};
#endif MXOBJECTFACTORY_H

View file

@ -1,16 +1,25 @@
#include "mxomni.h" #include "mxomni.h"
// OFFSET: LEGO1 0x100af0c0 // 0x101015b0
MxResult MxOmni::Create(const MxOmniCreateParam &p) MxOmni* MxOmni::m_instance = NULL;
{
if (p.CreateFlags().CreateTimer()) // OFFSET: LEGO1 0x100b0680
{ MxOmni *MxOmni::GetInstance()
MxTimer *timer = new MxTimer(); {
this->m_Timer = timer; return m_instance;
}
if (timer == NULL)
return FAILURE; // OFFSET: LEGO1 0x100af0c0
} MxResult MxOmni::Create(MxOmniCreateParam &p)
{
return SUCCESS; if (p.CreateFlags().CreateTimer())
} {
MxTimer *timer = new MxTimer();
this->m_timer = timer;
if (timer == NULL)
return FAILURE;
}
return SUCCESS;
}

View file

@ -1,12 +1,22 @@
#ifndef MXOMNI_H #ifndef MXOMNI_H
#define MXOMNI_H #define MXOMNI_H
#include "mxresult.h" #include "mxcriticalsection.h"
#include "mxomnicreateparam.h" #include "mxeventmanager.h"
#include "mxmusicmanager.h"
#include "mxnotificationmanager.h"
#include "mxobjectfactory.h"
#include "mxomnicreateflags.h" #include "mxomnicreateflags.h"
#include "mxomnicreateparam.h"
#include "mxresult.h"
#include "mxsoundmanager.h"
#include "mxstreamer.h"
#include "mxticklemanager.h"
#include "mxtimer.h" #include "mxtimer.h"
#include "mxvariabletable.h"
#include "mxvideomanager.h"
class MxOmni class MxOmni : public MxCore
{ {
public: public:
__declspec(dllexport) static void DestroyInstance(); __declspec(dllexport) static void DestroyInstance();
@ -18,13 +28,37 @@ class MxOmni
__declspec(dllexport) static void SetHD(const char *s); __declspec(dllexport) static void SetHD(const char *s);
__declspec(dllexport) static void SetSound3D(unsigned char); __declspec(dllexport) static void SetSound3D(unsigned char);
MxResult MxOmni::Create(const MxOmniCreateParam &p); virtual ~MxOmni();
MxTimer* GetTimer() const { return this->m_Timer; } virtual long Notify(MxParam &p); // vtable+04
virtual void Init(); // vtable+14
virtual MxResult Create(MxOmniCreateParam &p); // vtable+18
virtual void Destroy(); // vtable+1c
MxTimer* GetTimer() const { return this->m_timer; }
protected:
static MxOmni* m_instance;
MxString m_mediaPath; // 0x8
HWND *m_windowHandle; // 0x18;
MxObjectFactory *m_objectFactory; // 0x1C
MxVariableTable* m_variableTable; //0x20
MxTickleManager* m_tickleManager; //0x24
MxNotificationManager* m_notificationManager; //0x28
MxVideoManager *m_videoManager; //0x2C
MxSoundManager* m_soundManager; //0x30
MxMusicManager* m_musicManager; //0x34
MxEventManager* m_eventManager; //0x38
MxTimer* m_timer; //0x3C
MxStreamer* m_streamer; //0x40
char unknown44[0x4]; // 0x44
MxCriticalSection m_criticalsection; // 0x48
char unknown64[0x4]; // 0x64
private:
char padding[0x3c];
MxTimer* m_Timer;
}; };
#endif // MXOMNI_H #endif // MXOMNI_H

9
LEGO1/mxsoundmanager.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef MXSOUNDMANAGER_H
#define MXSOUNDMANAGER_H
class MxSoundManager
{
};
#endif // MXSOUNDMANAGER_H

View file

@ -1,6 +1,8 @@
#ifndef MXSTREAMCONTROLLER_H #ifndef MXSTREAMCONTROLLER_H
#define MXSTREAMCONTROLLER_H #define MXSTREAMCONTROLLER_H
#include "mxatomid.h"
class MxStreamController class MxStreamController
{ {
public: public:

View file

@ -1,6 +1,8 @@
#ifndef MXTICKLEMANAGER_H #ifndef MXTICKLEMANAGER_H
#define MXTICKLEMANAGER_H #define MXTICKLEMANAGER_H
#include "mxcore.h"
class MxTickleManager : public MxCore class MxTickleManager : public MxCore
{ {
public: public: