diff --git a/LEGO1/dllmain.cpp b/LEGO1/dllmain.cpp index 58d0149f..43654cb6 100644 --- a/LEGO1/dllmain.cpp +++ b/LEGO1/dllmain.cpp @@ -1,4 +1,4 @@ -#include +#include "legoinc.h" // OFFSET: LEGO1 0x10091ee0 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) diff --git a/LEGO1/legoinc.h b/LEGO1/legoinc.h new file mode 100644 index 00000000..d1377c23 --- /dev/null +++ b/LEGO1/legoinc.h @@ -0,0 +1,10 @@ +#ifndef LEGOINC_H +#define LEGOINC_H + +// It is recommended to include this over directly because this way +// we can undef stuff that might cause issues with our code. + +#include +#undef GetClassName + +#endif // LEGOINC_H diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index a49344a7..062764f7 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -1,5 +1,17 @@ #include "legoomni.h" +// OFFSET: LEGO1 0x10058a00 +LegoOmni::LegoOmni() +{ + Init(); +} + +// OFFSET: LEGO1 0x10058b50 +LegoOmni::~LegoOmni() +{ + Destroy(); +} + // OFFSET: LEGO1 0x1005ad10 LegoOmni *LegoOmni::GetInstance() { @@ -17,3 +29,87 @@ LegoVideoManager *VideoManager() { return LegoOmni::GetInstance()->GetVideoManager(); } + +// OFFSET: LEGO1 0x1005b5f0 +long LegoOmni::Notify(MxParam &p) +{ + // FIXME: Stub + return 0; +} + +// OFFSET: LEGO1 0x10058aa0 +const char *LegoOmni::GetClassName() const +{ + return "LegoOmni"; +} + +// OFFSET: LEGO1 0x10058ab0 +MxBool LegoOmni::IsClass(const char *name) const +{ + return strcmp("LegoOmni", name) == 0; +} + +// OFFSET: LEGO1 0x10058bd0 +void LegoOmni::Init() +{ + // FIXME: Stub +} + +// OFFSET: LEGO1 0x10058e70 +MxResult LegoOmni::Create(MxOmniCreateParam &p) +{ + // FIXME: Stub + return SUCCESS; +} + +void LegoOmni::Destroy() +{ + // FIXME: Stub +} + +void LegoOmni::vtable20() +{ + // FIXME: Stub +} + +void LegoOmni::vtable24(MxDSAction &ds) +{ + // FIXME: Stub +} + +MxBool LegoOmni::vtable28(MxDSAction &ds) +{ + // FIXME: Stub + return MX_TRUE; +} + +void LegoOmni::vtable2c() +{ + // FIXME: Stub +} + +void LegoOmni::vtable30() +{ + // FIXME: Stub +} + +void LegoOmni::vtable34() +{ + // FIXME: Stub +} + +void LegoOmni::vtable38() +{ + // FIXME: Stub +} + +void LegoOmni::vtable3c() +{ + // FIXME: Stub +} + +unsigned char LegoOmni::vtable40() +{ + // FIXME: Stub + return 0; +} diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index 778d0ac4..2b28e820 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -26,6 +26,7 @@ class LegoOmni : public MxOmni __declspec(dllexport) static void CreateInstance(); __declspec(dllexport) static LegoOmni *GetInstance(); + LegoOmni(); virtual ~LegoOmni(); // vtable+00 virtual long Notify(MxParam &p); // vtable+04 diff --git a/LEGO1/mxcriticalsection.h b/LEGO1/mxcriticalsection.h index 81d96d37..5b905741 100644 --- a/LEGO1/mxcriticalsection.h +++ b/LEGO1/mxcriticalsection.h @@ -1,7 +1,7 @@ #ifndef MXCRITICALSECTION_H #define MXCRITICALSECTION_H -#include +#include "legoinc.h" class MxCriticalSection { diff --git a/LEGO1/mxomni.cpp b/LEGO1/mxomni.cpp index bd58ee16..67b23000 100644 --- a/LEGO1/mxomni.cpp +++ b/LEGO1/mxomni.cpp @@ -3,6 +3,35 @@ // 0x101015b0 MxOmni* MxOmni::m_instance = NULL; +// OFFSET: LEGO1 0x100aef10 +MxOmni::MxOmni() +{ + Init(); +} + +// OFFSET: LEGO1 0x100aeff0 +MxOmni::~MxOmni() +{ + Destroy(); +} + +void MxOmni::Init() +{ + m_windowHandle = NULL; + m_objectFactory = NULL; + m_variableTable = NULL; + m_tickleManager = NULL; + m_notificationManager = NULL; + m_videoManager = NULL; + m_soundManager = NULL; + m_musicManager = NULL; + m_eventManager = NULL; + m_timer = NULL; + m_streamer = NULL; + m_unk44 = NULL; + m_unk64 = NULL; +} + // OFFSET: LEGO1 0x100b0680 MxOmni *MxOmni::GetInstance() { @@ -23,3 +52,16 @@ MxResult MxOmni::Create(MxOmniCreateParam &p) return SUCCESS; } + +// OFFSET: LEGO1 0x100afe90 +void MxOmni::Destroy() +{ + // FIXME: Stub +} + +// OFFSET: LEGO1 0x100b07f0 +long MxOmni::Notify(MxParam &p) +{ + // FIXME: Stub + return 0; +} diff --git a/LEGO1/mxomni.h b/LEGO1/mxomni.h index 59c1828a..a8d6e10e 100644 --- a/LEGO1/mxomni.h +++ b/LEGO1/mxomni.h @@ -53,11 +53,11 @@ class MxOmni : public MxCore MxTimer* m_timer; //0x3C MxStreamer* m_streamer; //0x40 - char unknown44[0x4]; // 0x44 + int m_unk44; // 0x44 MxCriticalSection m_criticalsection; // 0x48 - char unknown64[0x4]; // 0x64 + int m_unk64; // 0x64 }; diff --git a/LEGO1/mxomnicreateparam.h b/LEGO1/mxomnicreateparam.h index 31dcd447..ad11cb55 100644 --- a/LEGO1/mxomnicreateparam.h +++ b/LEGO1/mxomnicreateparam.h @@ -1,8 +1,7 @@ #ifndef MXOMNICREATEPARAM_H #define MXOMNICREATEPARAM_H -#include - +#include "legoinc.h" #include "mxomnicreateflags.h" #include "mxomnicreateparambase.h" #include "mxstring.h" diff --git a/LEGO1/mxtimer.cpp b/LEGO1/mxtimer.cpp index ee917218..8be837d4 100644 --- a/LEGO1/mxtimer.cpp +++ b/LEGO1/mxtimer.cpp @@ -1,6 +1,6 @@ #include "mxtimer.h" -#include +#include "legoinc.h" // 0x10101414 long MxTimer::s_LastTimeCalculated = 0; diff --git a/LEGO1/mxvideoparam.cpp b/LEGO1/mxvideoparam.cpp index 893124b6..2a33736a 100644 --- a/LEGO1/mxvideoparam.cpp +++ b/LEGO1/mxvideoparam.cpp @@ -1,5 +1,8 @@ #include "mxvideoparam.h" +#include +#include + // OFFSET: LEGO1 0x100bec70 MxVideoParam::MxVideoParam() { diff --git a/LEGO1/mxvideoparam.h b/LEGO1/mxvideoparam.h index 8dcc2746..eedf3167 100644 --- a/LEGO1/mxvideoparam.h +++ b/LEGO1/mxvideoparam.h @@ -25,7 +25,7 @@ class MxVideoParam int m_right; int m_bottom; MxPalette *m_palette; - BOOL m_backBuffers; + int m_backBuffers; MxVideoParamFlags m_flags; int m_unk1c; char *m_deviceId; diff --git a/LEGO1/mxvideoparamflags.h b/LEGO1/mxvideoparamflags.h index 49a4ecc1..50c9a1c9 100644 --- a/LEGO1/mxvideoparamflags.h +++ b/LEGO1/mxvideoparamflags.h @@ -1,7 +1,7 @@ #ifndef MXVIDEOPARAMFLAGS_H #define MXVIDEOPARAMFLAGS_H -#include +#include "mxbool.h" class MxVideoParamFlags { @@ -24,22 +24,22 @@ class MxVideoParamFlags __declspec(dllexport) MxVideoParamFlags(); - inline void EnableFullScreen(BOOL e) + inline void EnableFullScreen(MxBool e) { m_flags1 = (m_flags1 ^ (e << 0)) & FULL_SCREEN ^ m_flags1; } - inline void EnableFlipSurfaces(BOOL e) + inline void EnableFlipSurfaces(MxBool e) { m_flags1 = (m_flags1 ^ (e << 1)) & FLIP_SURFACES ^ m_flags1; } - inline void EnableBackBuffers(BOOL e) + inline void EnableBackBuffers(MxBool e) { m_flags1 = (m_flags1 ^ ((!e) << 2)) & BACK_BUFFERS ^ m_flags1; } - inline void SetUnknown3(BOOL e) + inline void SetUnknown3(MxBool e) { m_flags1 = (m_flags1 ^ (e << 7)) & UNKNOWN3 ^ m_flags1; } @@ -59,17 +59,17 @@ class MxVideoParamFlags m_flags1 = ((e << 5) ^ m_flags1) & ENABLE_16BIT ^ m_flags1; } - inline void EnableWideViewAngle(BOOL e) + inline void EnableWideViewAngle(MxBool e) { m_flags1 = (m_flags1 ^ (e << 6)) & WIDE_VIEW_ANGLE ^ m_flags1; } - inline void EnableUnknown1(BOOL e) + inline void EnableUnknown1(MxBool e) { m_flags2 = (m_flags2 ^ ((!e) << 0)) & UNKNOWN1 ^ m_flags2; } - inline void EnableUnknown2(BOOL e) + inline void EnableUnknown2(MxBool e) { m_flags2 = (m_flags2 ^ (e << 1)) & UNKNOWN2 ^ m_flags2; }