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

@@ -32,7 +32,7 @@ public:
void FUN_1005f720(undefined4);
void FUN_10064670(MxBool);
__declspec(dllexport) static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig);
static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig);
// SYNTHETIC: LEGO1 0x1005ed10
// LegoAnimationManager::`scalar deleting destructor'

View File

@@ -7,7 +7,7 @@
// SIZE 0x30
class LegoBackgroundColor : public MxVariable {
public:
__declspec(dllexport) LegoBackgroundColor(const char* p_key, const char* p_value);
LegoBackgroundColor(const char* p_key, const char* p_value);
virtual void SetValue(const char* p_colorString) override;
private:

View File

@@ -19,7 +19,7 @@ public:
return "LegoBuildingManager";
}
__declspec(dllexport) static void configureLegoBuildingManager(MxS32);
static void configureLegoBuildingManager(MxS32);
void FUN_1002fa00();

View File

@@ -19,12 +19,8 @@ public:
// Inlined at 0x100853f7
inline LegoEntity() { Init(); }
#ifdef ISLE_APP
__declspec(dllexport) virtual ~LegoEntity() override;
#else
// FUNCTION: LEGO1 0x1000c290
__declspec(dllexport) virtual ~LegoEntity() override { Destroy(TRUE); }
#endif
virtual ~LegoEntity() override { Destroy(TRUE); }
virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4

View File

@@ -20,13 +20,13 @@ struct ColorStringStruct {
// SIZE 0x430
class LegoGameState {
public:
__declspec(dllexport) LegoGameState();
__declspec(dllexport) ~LegoGameState();
__declspec(dllexport) MxResult Load(MxULong);
__declspec(dllexport) MxResult Save(MxULong);
__declspec(dllexport) void SerializePlayersInfo(MxS16);
__declspec(dllexport) void SerializeScoreHistory(MxS16 p_flags);
__declspec(dllexport) void SetSavePath(char*);
LegoGameState();
~LegoGameState();
MxResult Load(MxULong);
MxResult Save(MxULong);
void SerializePlayersInfo(MxS16);
void SerializeScoreHistory(MxS16 p_flags);
void SetSavePath(char*);
LegoState* GetState(const char* p_stateName);
LegoState* CreateState(const char* p_stateName);

View File

@@ -32,9 +32,9 @@ public:
LegoInputManager();
virtual ~LegoInputManager() override;
__declspec(dllexport) void QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key);
__declspec(dllexport) void Register(MxCore*);
__declspec(dllexport) void UnRegister(MxCore*);
void QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key);
void Register(MxCore*);
void UnRegister(MxCore*);
virtual MxResult Tickle() override; // vtable+0x8

View File

@@ -9,7 +9,7 @@ class AutoROI;
// SIZE 0x6c (discovered through inline constructor at 0x10009ae6)
class LegoModelPresenter : public MxVideoPresenter {
public:
__declspec(dllexport) static void configureLegoModelPresenter(MxS32 p_modelPresenterConfig);
static void configureLegoModelPresenter(MxS32 p_modelPresenterConfig);
// FUNCTION: LEGO1 0x1000ccb0
inline const char* ClassName() const override // vtable+0xc

View File

@@ -9,7 +9,7 @@
// SIZE 0x70
class LegoNavController : public MxCore {
public:
__declspec(dllexport) static void GetDefaults(
static void GetDefaults(
int* p_mouseDeadzone,
float* p_movementMaxSpeed,
float* p_turnMaxSpeed,
@@ -22,7 +22,7 @@ public:
float* p_rotationSensitivity,
MxBool* p_turnUseVelocity
);
__declspec(dllexport) static void SetDefaults(
static void SetDefaults(
int p_mouseDeadzone,
float p_movementMaxSpeed,
float p_turnMaxSpeed,

View File

@@ -68,11 +68,11 @@ public:
c_clearScreen = 0x04
};
__declspec(dllexport) void CreateBackgroundAudio();
__declspec(dllexport) void RemoveWorld(const MxAtomId&, MxLong);
__declspec(dllexport) static int GetCurrPathInfo(LegoPathBoundary**, MxS32&);
__declspec(dllexport) static void CreateInstance();
__declspec(dllexport) static LegoOmni* GetInstance();
void CreateBackgroundAudio();
void RemoveWorld(const MxAtomId&, MxLong);
static int GetCurrPathInfo(LegoPathBoundary**, MxS32&);
static void CreateInstance();
static LegoOmni* GetInstance();
LegoOmni();
virtual ~LegoOmni(); // vtable+00
@@ -153,16 +153,16 @@ private:
MxBool m_unk0x13c; // 0x13c
};
__declspec(dllexport) MxBackgroundAudioManager* BackgroundAudioManager();
__declspec(dllexport) LegoGameState* GameState();
__declspec(dllexport) const char* GetNoCD_SourceName();
__declspec(dllexport) LegoInputManager* InputManager();
__declspec(dllexport) LegoOmni* Lego();
__declspec(dllexport) LegoEntity* PickEntity(MxLong, MxLong);
__declspec(dllexport) LegoROI* PickROI(MxLong, MxLong);
__declspec(dllexport) LegoSoundManager* SoundManager();
__declspec(dllexport) MxTransitionManager* TransitionManager();
__declspec(dllexport) LegoVideoManager* VideoManager();
MxBackgroundAudioManager* BackgroundAudioManager();
LegoGameState* GameState();
const char* GetNoCD_SourceName();
LegoInputManager* InputManager();
LegoOmni* Lego();
LegoEntity* PickEntity(MxLong, MxLong);
LegoROI* PickROI(MxLong, MxLong);
LegoSoundManager* SoundManager();
MxTransitionManager* TransitionManager();
LegoVideoManager* VideoManager();
LegoAnimationManager* AnimationManager();
LegoBuildingManager* BuildingManager();

View File

@@ -24,7 +24,7 @@ public:
virtual MxResult AddToManager() override; // vtable+0x34
virtual void Destroy() override; // vtable+0x38
__declspec(dllexport) static void configureLegoPartPresenter(MxS32, MxS32);
static void configureLegoPartPresenter(MxS32, MxS32);
// SYNTHETIC: LEGO1 0x1000d060
// LegoPartPresenter::`scalar deleting destructor'

View File

@@ -19,11 +19,11 @@ public:
LegoVideoManager();
virtual ~LegoVideoManager() override;
__declspec(dllexport) int EnableRMDevice();
__declspec(dllexport) int DisableRMDevice();
int EnableRMDevice();
int DisableRMDevice();
void EnableFullScreenMovie(MxBool p_enable);
__declspec(dllexport) void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale);
__declspec(dllexport) void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY);
void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale);
void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY);
virtual MxResult Tickle() override; // vtable+0x8
virtual void Destroy() override; // vtable+0x18

View File

@@ -22,8 +22,8 @@ typedef set<MxPresenter*, PresenterSetCompare> MxPresenterSet;
// SIZE 0xf8
class LegoWorld : public LegoEntity {
public:
__declspec(dllexport) LegoWorld();
__declspec(dllexport) virtual ~LegoWorld() override; // vtable+0x0
LegoWorld();
virtual ~LegoWorld() override; // vtable+0x0
virtual MxLong Notify(MxParam& p_param) override; // vtable+0x4
virtual MxResult Tickle() override; // vtable+0x8

View File

@@ -10,7 +10,7 @@ public:
LegoWorldPresenter();
virtual ~LegoWorldPresenter() override; // vtable+0x0
__declspec(dllexport) static void configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality);
static void configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality);
// FUNCTION: LEGO1 0x10066630
inline virtual const char* ClassName() const override // vtable+0x0c

View File

@@ -39,7 +39,7 @@ public:
void FUN_1007ef40();
void FadeInOrFadeOut();
__declspec(dllexport) void Enable(MxBool p_enable);
void Enable(MxBool p_enable);
virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS);
void Stop();

View File

@@ -13,7 +13,7 @@ public:
MxTransitionManager();
virtual ~MxTransitionManager() override; // vtable+0x0
__declspec(dllexport) void SetWaitIndicator(MxVideoPresenter* p_waitIndicator);
void SetWaitIndicator(MxVideoPresenter* p_waitIndicator);
virtual MxResult Tickle(); // vtable+0x8

View File

@@ -13,6 +13,9 @@
#include "mxtransitionmanager.h"
DECOMP_SIZE_ASSERT(Helicopter, 0x230)
DECOMP_SIZE_ASSERT(Mx3DPointFloat, 0x14)
DECOMP_SIZE_ASSERT(Mx4DPointFloat, 0x18)
DECOMP_SIZE_ASSERT(MxMatrix, 0x48)
// FUNCTION: LEGO1 0x10001e60
Helicopter::Helicopter()

View File

@@ -1,4 +1,4 @@
#include "SkateBoard.h"
#include "skateboard.h"
#include "decomp.h"
#include "mxnotificationmanager.h"

View File

@@ -7,10 +7,10 @@ DECOMP_SIZE_ASSERT(LegoROI, 0x10c);
// SIZE 0x14
typedef struct {
const char* m_name;
MxS32 m_red;
MxS32 m_green;
MxS32 m_blue;
MxS32 m_unk0x10;
int m_red;
int m_green;
int m_blue;
int m_unk0x10;
} ROIColorAlias;
// GLOBAL: LEGO1 0x100dbe28
@@ -32,7 +32,7 @@ ROIColorAlias g_roiColorAliases[22] = {
};
// GLOBAL: LEGO1 0x10101368
MxS32 g_roiConfig = 100;
int g_roiConfig = 100;
// GLOBAL: LEGO1 0x101013ac
ROIHandler g_someHandlerFunction = NULL;
@@ -54,24 +54,24 @@ void LegoROI::FUN_100a58f0(Matrix4& p_transform)
}
// FUNCTION: LEGO1 0x100a81c0
void LegoROI::configureLegoROI(MxS32 p_roiConfig)
void LegoROI::configureLegoROI(int p_roiConfig)
{
g_roiConfig = p_roiConfig;
}
// STUB: LEGO1 0x100a9a50
LegoROI::LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, MxTime p_time) : ViewROI(p_renderer, p_lodList)
LegoROI::LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, int p_time) : ViewROI(p_renderer, p_lodList)
{
m_time = p_time;
}
// FUNCTION: LEGO1 0x100a9bf0
MxBool LegoROI::CallTheHandlerFunction(
unsigned char LegoROI::CallTheHandlerFunction(
char* p_param,
MxFloat& p_red,
MxFloat& p_green,
MxFloat& p_blue,
MxFloat& p_other
float& p_red,
float& p_green,
float& p_blue,
float& p_other
)
{
// TODO
@@ -88,11 +88,11 @@ MxBool LegoROI::CallTheHandlerFunction(
}
// FUNCTION: LEGO1 0x100a9c50
MxBool LegoROI::ColorAliasLookup(char* p_param, MxFloat& p_red, MxFloat& p_green, MxFloat& p_blue, MxFloat& p_other)
unsigned char LegoROI::ColorAliasLookup(char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other)
{
// TODO: this seems awfully hacky for these devs. is there a dynamic way
// to represent `the end of this array` that would improve this?
MxU32 i = 0;
unsigned int i = 0;
do {
if (strcmpi(g_roiColorAliases[i].m_name, p_param) == 0) {
p_red = g_roiColorAliases[i].m_red * g_normalizeByteToFloat;
@@ -102,7 +102,7 @@ MxBool LegoROI::ColorAliasLookup(char* p_param, MxFloat& p_red, MxFloat& p_green
return TRUE;
}
i++;
} while ((MxS32*) &g_roiColorAliases[i] < &g_roiConfig);
} while ((int*) &g_roiColorAliases[i] < &g_roiConfig);
return FALSE;
}
@@ -114,7 +114,7 @@ void LegoROI::SetSomeHandlerFunction(ROIHandler p_func)
}
// FUNCTION: LEGO1 0x100a9e10
void LegoROI::SetDisplayBB(MxS32 p_displayBB)
void LegoROI::SetDisplayBB(int p_displayBB)
{
// Intentionally empty function
}

View File

@@ -1,10 +1,9 @@
#ifndef LEGOROI_H
#define LEGOROI_H
#include "mxtypes.h"
#include "viewmanager/viewroi.h"
typedef MxBool (*ROIHandler)(char*, char*, MxU32);
typedef unsigned char (*ROIHandler)(char*, char*, unsigned int);
class LegoEntity;
@@ -18,24 +17,24 @@ class AutoROI : public ViewROI {};
// SIZE 0x10c
class LegoROI : public ViewROI {
public:
LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, MxTime p_time);
LegoROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, int p_time);
virtual float IntrinsicImportance() const override; // vtable+0x4
// Note: Actually part of parent class (doesn't exist yet)
virtual void UpdateWorldBoundingVolumes() override; // vtable+0x18
__declspec(dllexport) void SetDisplayBB(MxS32 p_displayBB);
__declspec(dllexport) static void configureLegoROI(MxS32 p_roi);
void SetDisplayBB(int p_displayBB);
static void configureLegoROI(int p_roi);
static void SetSomeHandlerFunction(ROIHandler p_func);
static MxBool CallTheHandlerFunction(
static unsigned char CallTheHandlerFunction(
char* p_param,
MxFloat& p_red,
MxFloat& p_green,
MxFloat& p_blue,
MxFloat& p_other
float& p_red,
float& p_green,
float& p_blue,
float& p_other
);
static MxBool ColorAliasLookup(char* p_param, MxFloat& p_red, MxFloat& p_green, MxFloat& p_blue, MxFloat& p_other);
static unsigned char ColorAliasLookup(char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other);
void WrappedSetLocalTransform(Matrix4& p_transform);
void FUN_100a46b0(Matrix4& p_transform);
@@ -50,7 +49,7 @@ public:
private:
undefined m_pad[0x24]; // 0xe0
LegoEntity* m_unk0x104; // 0x104
MxTime m_time; // 0x108
int m_time; // 0x108
};
#endif // LEGOROI_H