Spinoff some sources to static libraries (#484)

* cmake: use imported targets for 3rd party libs

* Fix casing of skateboard.h include

* cmake: tglrl realtime viewmanager mxgeometry

* cmake: spin off some source in static libraries

* dx5 for everyone

* ci: bump actions/checkout to v4

* move LEGO1/realtime/realtimeview.cpp to lego1 because it exports symbols

* add misc library

* Add omni library

* Return of the .def's

* Remove COMPAT_CONST in MxVideoParam::MxVideoParam

* Run clang-format

* move LEGO1/realtime/realtimeview.cpp to realtime lib

* Add 3dmanager library

* Rename .def files

* Remove incorrect deps to Omni

* Remove DLL expor decls

* Remove unnecessary library dep from ROI

* Remove COMPAT_CONST

* Move 3dmanager lib before Omni

* Remove mxgeometry lib (`geom` is actually `lego/sources/geom`, which we don't have in our decomp yet)

* viewmanager has a dependency on realtime + fix mingw's def

* Remove Smacker::Smacker from lego1 link libraries

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Anonymous Maarten
2024-01-25 03:16:29 +01:00
committed by GitHub
parent 2bebc09da3
commit 5f413165cc
61 changed files with 730 additions and 379 deletions

View File

@@ -14,9 +14,9 @@ enum LookupMode {
// SIZE 0x04
class MxAtomId {
public:
__declspec(dllexport) MxAtomId(const char*, LookupMode);
__declspec(dllexport) MxAtomId& operator=(const MxAtomId& p_atomId);
__declspec(dllexport) ~MxAtomId();
MxAtomId(const char*, LookupMode);
MxAtomId& operator=(const MxAtomId& p_atomId);
~MxAtomId();
MxAtomId() { this->m_internal = 0; }

View File

@@ -34,14 +34,14 @@ struct MxBITMAPINFO {
// VTABLE: LEGO1 0x100dc7b0
class MxBitmap : public MxCore {
public:
__declspec(dllexport) MxBitmap();
__declspec(dllexport) virtual ~MxBitmap(); // vtable+00
MxBitmap();
virtual ~MxBitmap(); // vtable+00
virtual MxResult ImportBitmap(MxBitmap* p_bitmap); // vtable+14
virtual MxResult ImportBitmapInfo(MxBITMAPINFO* p_info); // vtable+18
virtual MxResult SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, MxBool); // vtable+1c
virtual MxResult LoadFile(HANDLE p_handle); // vtable+20
__declspec(dllexport) virtual MxLong Read(const char* p_filename); // vtable+24
virtual MxLong Read(const char* p_filename); // vtable+24
// FUNCTION: LEGO1 0x1004e0d0
virtual int VTable0x28(int) { return -1; }; // vtable+28
@@ -63,10 +63,10 @@ public:
MxS32 p_bottom,
MxS32 p_width,
MxS32 p_height
); // vtable+30
__declspec(dllexport) virtual MxPalette* CreatePalette(); // vtable+34
virtual void ImportPalette(MxPalette* p_palette); // vtable+38
virtual MxResult SetBitDepth(MxBool); // vtable+3c
); // vtable+30
virtual MxPalette* CreatePalette(); // vtable+34
virtual void ImportPalette(MxPalette* p_palette); // vtable+38
virtual MxResult SetBitDepth(MxBool); // vtable+3c
virtual MxResult StretchBits(
HDC p_hdc,
MxS32 p_xSrc,

View File

@@ -12,9 +12,9 @@ class MxParam;
// SIZE 0x8
class MxCore {
public:
__declspec(dllexport) MxCore();
__declspec(dllexport) virtual ~MxCore(); // vtable+00
__declspec(dllexport) virtual MxLong Notify(MxParam& p_param); // vtable+04
MxCore();
virtual ~MxCore(); // vtable+00
virtual MxLong Notify(MxParam& p_param); // vtable+04
// FUNCTION: LEGO1 0x10001f70
virtual MxResult Tickle() { return SUCCESS; }; // vtable+08

View File

@@ -6,9 +6,9 @@
// SIZE 0x1c
class MxCriticalSection {
public:
__declspec(dllexport) MxCriticalSection();
__declspec(dllexport) ~MxCriticalSection();
__declspec(dllexport) static void SetDoMutex();
MxCriticalSection();
~MxCriticalSection();
static void SetDoMutex();
void Enter();
void Leave();

View File

@@ -24,8 +24,8 @@ public:
c_bit11 = 0x400,
};
__declspec(dllexport) MxDSAction();
__declspec(dllexport) virtual ~MxDSAction();
MxDSAction();
virtual ~MxDSAction();
void CopyFrom(MxDSAction& p_dsAction);
MxDSAction& operator=(MxDSAction& p_dsAction);

View File

@@ -11,8 +11,8 @@
// VTABLE: LEGO1 0x100dc890
class MxDSFile : public MxDSSource {
public:
__declspec(dllexport) MxDSFile(const char* p_filename, MxULong p_skipReadingChunks);
__declspec(dllexport) virtual ~MxDSFile(); // vtable+0x0
MxDSFile(const char* p_filename, MxULong p_skipReadingChunks);
virtual ~MxDSFile(); // vtable+0x0
// FUNCTION: LEGO1 0x100c0120
inline virtual const char* ClassName() const override // vtable+0x0c
@@ -27,12 +27,12 @@ public:
return !strcmp(p_name, MxDSFile::ClassName()) || MxDSSource::IsA(p_name);
}
__declspec(dllexport) virtual MxLong Open(MxULong); // vtable+0x14
__declspec(dllexport) virtual MxLong Close(); // vtable+0x18
__declspec(dllexport) virtual MxResult Read(unsigned char*, MxULong); // vtable+0x20
__declspec(dllexport) virtual MxLong Seek(MxLong, int); // vtable+0x24
__declspec(dllexport) virtual MxULong GetBufferSize(); // vtable+0x28
__declspec(dllexport) virtual MxULong GetStreamBuffersNum(); // vtable+0x2c
virtual MxLong Open(MxULong); // vtable+0x14
virtual MxLong Close(); // vtable+0x18
virtual MxResult Read(unsigned char*, MxULong); // vtable+0x20
virtual MxLong Seek(MxLong, int); // vtable+0x24
virtual MxULong GetBufferSize(); // vtable+0x28
virtual MxULong GetStreamBuffersNum(); // vtable+0x2c
inline void SetFileName(const char* p_filename) { m_filename = p_filename; }

View File

@@ -32,7 +32,7 @@ public:
void CopyFrom(MxDSObject& p_dsObject);
MxDSObject& operator=(MxDSObject& p_dsObject);
__declspec(dllexport) void SetObjectName(const char* p_objectName);
void SetObjectName(const char* p_objectName);
void SetSourceName(const char* p_sourceName);
// FUNCTION: LEGO1 0x100bf730

View File

@@ -12,7 +12,7 @@
class MXIOINFO {
public:
MXIOINFO();
__declspec(dllexport) ~MXIOINFO();
~MXIOINFO();
MxU16 Open(const char*, MxULong);
MxU16 Close(MxLong);

View File

@@ -28,14 +28,14 @@ class MxStreamController;
// SIZE 0x68
class MxOmni : public MxCore {
public:
__declspec(dllexport) static void DestroyInstance();
__declspec(dllexport) static const char* GetCD();
__declspec(dllexport) static const char* GetHD();
__declspec(dllexport) static MxOmni* GetInstance();
__declspec(dllexport) static MxBool IsSound3D();
__declspec(dllexport) static void SetCD(const char* p_cd);
__declspec(dllexport) static void SetHD(const char* p_hd);
__declspec(dllexport) static void SetSound3D(MxBool p_use3dSound);
static void DestroyInstance();
static const char* GetCD();
static const char* GetHD();
static MxOmni* GetInstance();
static MxBool IsSound3D();
static void SetCD(const char* p_cd);
static void SetHD(const char* p_hd);
static void SetSound3D(MxBool p_use3dSound);
MxOmni();
virtual ~MxOmni() override;
@@ -96,15 +96,15 @@ protected:
MxBool m_timerRunning; // 0x64
};
__declspec(dllexport) MxTickleManager* TickleManager();
__declspec(dllexport) MxTimer* Timer();
__declspec(dllexport) MxStreamer* Streamer();
__declspec(dllexport) MxSoundManager* MSoundManager();
__declspec(dllexport) MxVariableTable* VariableTable();
__declspec(dllexport) MxMusicManager* MusicManager();
__declspec(dllexport) MxEventManager* EventManager();
__declspec(dllexport) MxResult Start(MxDSAction*);
__declspec(dllexport) MxNotificationManager* NotificationManager();
MxTickleManager* TickleManager();
MxTimer* Timer();
MxStreamer* Streamer();
MxSoundManager* MSoundManager();
MxVariableTable* VariableTable();
MxMusicManager* MusicManager();
MxEventManager* EventManager();
MxResult Start(MxDSAction*);
MxNotificationManager* NotificationManager();
MxVideoManager* MVideoManager();
MxAtomIdCounterSet* AtomIdCounterSet();

View File

@@ -21,7 +21,7 @@ public:
c_createStreamer = 0x04
};
__declspec(dllexport) MxOmniCreateFlags();
MxOmniCreateFlags();
inline const MxBool CreateObjectFactory() const { return this->m_flags1 & c_createObjectFactory; }
inline const MxBool CreateVariableTable() const { return this->m_flags1 & c_createVariableTable; }

View File

@@ -11,7 +11,7 @@
// VTABLE: LEGO1 0x100dc218
class MxOmniCreateParam : public MxParam {
public:
__declspec(dllexport) MxOmniCreateParam(
MxOmniCreateParam(
const char* p_mediaPath,
struct HWND__* p_windowHandle,
MxVideoParam& p_vparam,

View File

@@ -10,8 +10,8 @@
// SIZE 0x414
class MxPalette : public MxCore {
public:
__declspec(dllexport) MxBool operator==(MxPalette& p_other);
__declspec(dllexport) void Detach();
MxBool operator==(MxPalette& p_other);
void Detach();
MxPalette();
MxPalette(const RGBQUAD*);

View File

@@ -28,14 +28,10 @@ public:
MxPresenter() { Init(); }
#ifdef ISLE_APP
__declspec(dllexport) virtual ~MxPresenter() override; // vtable+0x00
#else
// FUNCTION: LEGO1 0x1000bf00
__declspec(dllexport) virtual ~MxPresenter() override{}; // vtable+0x00
#endif
virtual ~MxPresenter() override{}; // vtable+0x00
__declspec(dllexport) virtual MxResult Tickle() override; // vtable+0x08
virtual MxResult Tickle() override; // vtable+0x08
// FUNCTION: LEGO1 0x1000bfe0
inline virtual const char* ClassName() const override // vtable+0xc
@@ -73,14 +69,10 @@ public:
virtual void Unk5Tickle() { ProgressTickleState(e_done); }; // vtable+0x28
protected:
#ifdef ISLE_APP
__declspec(dllexport) virtual void DoneTickle(); // vtable+0x2c
#else
// FUNCTION: LEGO1 0x1000bee0
__declspec(dllexport) virtual void DoneTickle() { ProgressTickleState(e_idle); }; // vtable+0x2c
#endif
virtual void DoneTickle() { ProgressTickleState(e_idle); }; // vtable+0x2c
__declspec(dllexport) virtual void ParseExtra(); // vtable+0x30
virtual void ParseExtra(); // vtable+0x30
inline void ProgressTickleState(TickleState p_tickleState)
{
@@ -95,8 +87,8 @@ public:
// FUNCTION: LEGO1 0x1000bf80
virtual void Destroy() { Init(); }; // vtable+0x38
__declspec(dllexport) virtual MxResult StartAction(MxStreamController*, MxDSAction*); // vtable+0x3c
__declspec(dllexport) virtual void EndAction(); // vtable+0x40
virtual MxResult StartAction(MxStreamController*, MxDSAction*); // vtable+0x3c
virtual void EndAction(); // vtable+0x40
// FUNCTION: LEGO1 0x1000bf90
virtual void SetTickleState(TickleState p_tickleState) { ProgressTickleState(p_tickleState); } // vtable+0x44
@@ -113,7 +105,7 @@ public:
// FUNCTION: LEGO1 0x1000bfd0
virtual MxBool IsHit(MxS32 p_x, MxS32 p_y) { return FALSE; }; // vtable+0x50
__declspec(dllexport) virtual void Enable(MxBool p_enable); // vtable+0x54
virtual void Enable(MxBool p_enable); // vtable+0x54
MxEntity* CreateEntity(const char* p_name);
void SendToCompositePresenter(MxOmni*);
@@ -133,7 +125,7 @@ public:
// MxPresenter::`scalar deleting destructor'
protected:
__declspec(dllexport) void Init();
void Init();
TickleState m_currentTickleState; // 0x8
MxU32 m_previousTickleStates; // 0x0c

View File

@@ -5,8 +5,8 @@
class MxScheduler {
public:
__declspec(dllexport) static MxScheduler* GetInstance();
__declspec(dllexport) void StartMultiTasking(MxULong);
static MxScheduler* GetInstance();
void StartMultiTasking(MxULong);
};
#endif // MXSCHEDULER_H

View File

@@ -78,8 +78,8 @@ public:
MxStreamer();
virtual ~MxStreamer() override; // vtable+0x0
__declspec(dllexport) MxStreamController* Open(const char* p_name, MxU16 p_openMode);
__declspec(dllexport) MxLong Close(const char* p_name);
MxStreamController* Open(const char* p_name, MxU16 p_openMode);
MxLong Close(const char* p_name);
virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4

View File

@@ -7,9 +7,9 @@
// SIZE 0x10
class MxString : public MxCore {
public:
__declspec(dllexport) MxString(const MxString& p_str);
__declspec(dllexport) virtual ~MxString();
__declspec(dllexport) const MxString& operator=(const char* p_data);
MxString(const MxString& p_str);
virtual ~MxString();
const MxString& operator=(const char* p_data);
MxString();
MxString(const char*);

View File

@@ -12,7 +12,7 @@ public:
void Start();
void Stop();
__declspec(dllexport) MxLong GetRealTime();
MxLong GetRealTime();
inline MxLong GetTime()
{

View File

@@ -69,10 +69,10 @@ MxBool GetRectIntersection(
MxS32* p_height
);
__declspec(dllexport) void MakeSourceName(char*, const char*);
__declspec(dllexport) void SetOmniUserMessage(void (*)(const char*, int));
void MakeSourceName(char*, const char*);
void SetOmniUserMessage(void (*)(const char*, int));
void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags);
__declspec(dllexport) MxDSObject* CreateStreamObject(MxDSFile*, MxS16);
MxDSObject* CreateStreamObject(MxDSFile*, MxS16);
MxBool KeyValueStringParse(char*, const char*, const char*);

View File

@@ -10,9 +10,9 @@
class MxVariableTable : public MxHashTable<MxVariable*> {
public:
MxVariableTable() { m_customDestructor = Destroy; }
__declspec(dllexport) void SetVariable(const char* p_key, const char* p_value);
__declspec(dllexport) void SetVariable(MxVariable* p_var);
__declspec(dllexport) const char* GetVariable(const char* p_key);
void SetVariable(const char* p_key, const char* p_value);
void SetVariable(MxVariable* p_var);
const char* GetVariable(const char* p_key);
static void Destroy(MxVariable* p_obj) { p_obj->Destroy(); }

View File

@@ -30,8 +30,8 @@ public:
); // vtable+0x28
virtual MxResult Create(MxVideoParam& p_videoParam, MxU32 p_frequencyMS, MxBool p_createThread); // vtable+0x2c
__declspec(dllexport) void InvalidateRect(MxRect32&);
__declspec(dllexport) virtual MxResult RealizePalette(MxPalette*); // vtable+0x30
void InvalidateRect(MxRect32&);
virtual MxResult RealizePalette(MxPalette*); // vtable+0x30
virtual void UpdateView(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height); // vtable+0x34
MxResult Init();

View File

@@ -13,17 +13,13 @@
// SIZE 0x24
class MxVideoParam {
public:
__declspec(dllexport) MxVideoParam();
__declspec(dllexport) MxVideoParam(MxVideoParam& p_videoParam);
__declspec(dllexport) MxVideoParam(
COMPAT_CONST MxRect32& p_rect,
MxPalette* p_palette,
MxULong p_backBuffers,
COMPAT_CONST MxVideoParamFlags& p_flags
);
__declspec(dllexport) MxVideoParam& operator=(const MxVideoParam& p_videoParam);
__declspec(dllexport) ~MxVideoParam();
__declspec(dllexport) void SetDeviceName(char* p_deviceId);
MxVideoParam();
MxVideoParam(MxVideoParam& p_videoParam);
__declspec(dllexport)
MxVideoParam(MxRect32& p_rect, MxPalette* p_palette, MxULong p_backBuffers, MxVideoParamFlags& p_flags);
MxVideoParam& operator=(const MxVideoParam& p_videoParam);
~MxVideoParam();
void SetDeviceName(char* p_deviceId);
inline MxVideoParamFlags& Flags() { return m_flags; }

View File

@@ -7,7 +7,7 @@
class MxVideoParamFlags {
public:
__declspec(dllexport) MxVideoParamFlags();
MxVideoParamFlags();
inline void SetFullScreen(BOOL p_e) { m_flags1.m_bit0 = p_e; }
inline void SetFlipSurfaces(BOOL p_e) { m_flags1.m_bit1 = p_e; }