diff --git a/LEGO1/lego/legoomni/include/legoomni.h b/LEGO1/lego/legoomni/include/legoomni.h index fc9ba1c2..21c84801 100644 --- a/LEGO1/lego/legoomni/include/legoomni.h +++ b/LEGO1/lego/legoomni/include/legoomni.h @@ -148,7 +148,6 @@ __declspec(dllexport) LegoOmni* Lego(); __declspec(dllexport) LegoEntity* PickEntity(MxLong, MxLong); __declspec(dllexport) LegoROI* PickROI(MxLong, MxLong); __declspec(dllexport) LegoSoundManager* SoundManager(); -__declspec(dllexport) MxResult Start(MxDSAction*); __declspec(dllexport) MxTransitionManager* TransitionManager(); __declspec(dllexport) LegoVideoManager* VideoManager(); @@ -165,6 +164,7 @@ MxDSAction& GetCurrentAction(); void PlayMusic(MxU32 p_index); void SetIsWorldActive(MxBool p_isWorldActive); +void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last); void RegisterScripts(); void UnregisterScripts(); diff --git a/LEGO1/lego/legoomni/src/main/legoomni.cpp b/LEGO1/lego/legoomni/src/main/legoomni.cpp index 9f27a980..cd0bc4a0 100644 --- a/LEGO1/lego/legoomni/src/main/legoomni.cpp +++ b/LEGO1/lego/legoomni/src/main/legoomni.cpp @@ -241,6 +241,20 @@ void SetIsWorldActive(MxBool p_isWorldActive) g_isWorldActive = p_isWorldActive; } +// FUNCTION: LEGO1 0x100159e0 +void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last) +{ + MxDSAction action; + + action.SetAtomId(*p_id); + action.SetUnknown24(-2); + + for (MxS32 first = p_first, last = p_last; first <= last; first++) { + action.SetObjectId(first); + DeleteObject(action); + } +} + // STUB: LEGO1 0x1001a700 void FUN_1001a700() { @@ -685,9 +699,3 @@ void LegoOmni::StopTimer() MxOmni::StopTimer(); SetAppCursor(0); } - -// FUNCTION: LEGO1 0x100acf50 -MxResult Start(MxDSAction* p_dsAction) -{ - return MxOmni::GetInstance()->Start(p_dsAction); -} diff --git a/LEGO1/omni/include/mxactionnotificationparam.h b/LEGO1/omni/include/mxactionnotificationparam.h index 24d9e5e1..750abd6d 100644 --- a/LEGO1/omni/include/mxactionnotificationparam.h +++ b/LEGO1/omni/include/mxactionnotificationparam.h @@ -43,7 +43,11 @@ class MxActionNotificationParam : public MxNotificationParam { delete this->m_action; } - virtual MxNotificationParam* Clone() override; // vtable+0x4 + // FUNCTION: LEGO1 0x100510c0 + virtual MxNotificationParam* Clone() override + { + return new MxActionNotificationParam(this->m_type, this->m_sender, this->m_action, this->m_realloc); + }; // vtable+0x4 inline MxDSAction* GetAction() { return m_action; } @@ -83,7 +87,16 @@ class MxEndActionNotificationParam : public MxActionNotificationParam { { } - virtual MxNotificationParam* Clone() override; // vtable+0x4 + // FUNCTION: LEGO1 0x10051270 + virtual MxNotificationParam* Clone() override + { + return new MxEndActionNotificationParam( + c_notificationEndAction, + this->m_sender, + this->m_action, + this->m_realloc + ); + }; // vtable+0x4 }; // VTABLE: LEGO1 0x100dc208 diff --git a/LEGO1/omni/include/mxaudiomanager.h b/LEGO1/omni/include/mxaudiomanager.h index c910a493..a7b58fd0 100644 --- a/LEGO1/omni/include/mxaudiomanager.h +++ b/LEGO1/omni/include/mxaudiomanager.h @@ -5,6 +5,7 @@ #include "mxmediamanager.h" // VTABLE: LEGO1 0x100dc6e0 +// SIZE 0x30 class MxAudioManager : public MxMediaManager { public: MxAudioManager(); @@ -12,8 +13,11 @@ class MxAudioManager : public MxMediaManager { virtual MxResult InitPresenters() override; // vtable+14 virtual void Destroy() override; // vtable+18 - virtual MxS32 GetVolume(); // vtable+28 - virtual void SetVolume(MxS32 p_volume); // vtable+2c + + // FUNCTION: LEGO1 0x10029910 + virtual MxS32 GetVolume() { return this->m_volume; }; // vtable+28 + + virtual void SetVolume(MxS32 p_volume); // vtable+2c private: void Destroy(MxBool p_fromDestructor); diff --git a/LEGO1/omni/include/mxbitmap.h b/LEGO1/omni/include/mxbitmap.h index d9fda78d..d756b865 100644 --- a/LEGO1/omni/include/mxbitmap.h +++ b/LEGO1/omni/include/mxbitmap.h @@ -42,7 +42,10 @@ class MxBitmap : public MxCore { 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 int VTable0x28(int); + + // FUNCTION: LEGO1 0x1004e0d0 + virtual int VTable0x28(int) { return -1; }; + virtual void VTable0x2c(int, int, int, int, int, int, int); virtual void VTable0x30(int, int, int, int, int, int, int); __declspec(dllexport) virtual MxPalette* CreatePalette(); // vtable+34 diff --git a/LEGO1/omni/include/mxnotificationparam.h b/LEGO1/omni/include/mxnotificationparam.h index 66f9dd95..256dd882 100644 --- a/LEGO1/omni/include/mxnotificationparam.h +++ b/LEGO1/omni/include/mxnotificationparam.h @@ -40,8 +40,10 @@ class MxNotificationParam : public MxParam { { } - virtual ~MxNotificationParam() override {} // vtable+0x0 (scalar deleting destructor) - virtual MxNotificationParam* Clone(); // vtable+0x4 + virtual ~MxNotificationParam() override {} + + // FUNCTION: LEGO1 0x10010390 + virtual MxNotificationParam* Clone() { return new MxNotificationParam(m_type, m_sender); }; // vtable+0x4 inline NotificationId GetNotification() const { return m_type; } inline MxCore* GetSender() const { return m_sender; } diff --git a/LEGO1/omni/include/mxomni.h b/LEGO1/omni/include/mxomni.h index 7bac0723..9f448c26 100644 --- a/LEGO1/omni/include/mxomni.h +++ b/LEGO1/omni/include/mxomni.h @@ -52,7 +52,9 @@ class MxOmni : public MxCore { virtual void NotifyCurrentEntity(MxNotificationParam* p_param); // vtable+34 virtual void StartTimer(); // vtable+38 virtual void StopTimer(); // vtable+3c - virtual MxBool IsTimerRunning(); // vtable+40 + + // FUNCTION: LEGO1 0x10058a90 + virtual MxBool IsTimerRunning() { return m_timerRunning; }; // vtable+40 static void SetInstance(MxOmni* p_instance); static MxBool FUN_100b06b0(MxDSAction* p_action, const char* p_name); @@ -98,12 +100,12 @@ __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(); MxVideoManager* MVideoManager(); MxAtomIdCounterSet* AtomIdCounterSet(); MxObjectFactory* ObjectFactory(); void DeleteObject(MxDSAction& p_dsAction); -void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last); #endif // MXOMNI_H diff --git a/LEGO1/omni/include/mxstillpresenter.h b/LEGO1/omni/include/mxstillpresenter.h index 828f58b7..0fa48bf3 100644 --- a/LEGO1/omni/include/mxstillpresenter.h +++ b/LEGO1/omni/include/mxstillpresenter.h @@ -25,11 +25,14 @@ class MxStillPresenter : public MxVideoPresenter { return !strcmp(p_name, MxStillPresenter::ClassName()) || MxVideoPresenter::IsA(p_name); } - virtual void StartingTickle() override; // vtable+0x1c - virtual void StreamingTickle() override; // vtable+0x20 - virtual void RepeatingTickle() override; // vtable+0x24 - virtual void ParseExtra() override; // vtable+0x30 - virtual void Destroy() override; // vtable+0x38 + virtual void StartingTickle() override; // vtable+0x1c + virtual void StreamingTickle() override; // vtable+0x20 + virtual void RepeatingTickle() override; // vtable+0x24 + virtual void ParseExtra() override; // vtable+0x30 + + // FUNCTION: LEGO1 0x100435b0 + virtual void Destroy() override { Destroy(FALSE); }; // vtable+0x38 + virtual void Enable(MxBool p_enable) override; // vtable+0x54 virtual void LoadHeader(MxStreamChunk* p_chunk) override; // vtable+0x5c virtual void CreateBitmap() override; // vtable+0x60 diff --git a/LEGO1/omni/include/mxvariable.h b/LEGO1/omni/include/mxvariable.h index d1434467..52fc48bc 100644 --- a/LEGO1/omni/include/mxvariable.h +++ b/LEGO1/omni/include/mxvariable.h @@ -20,9 +20,15 @@ class MxVariable { m_key.ToUpperCase(); m_value = p_value; } - virtual MxString* GetValue(); - virtual void SetValue(const char* p_value); - virtual void Destroy(); + + // FUNCTION: LEGO1 0x1003bea0 + virtual MxString* GetValue() { return &m_value; }; + + // FUNCTION: LEGO1 0x1003beb0 + virtual void SetValue(const char* p_value) { m_value = p_value; }; + + // FUNCTION: LEGO1 0x1003bec0 + virtual void Destroy() { delete this; }; inline const MxString* GetKey() const { return &m_key; } diff --git a/LEGO1/omni/src/audio/mxaudiomanager.cpp b/LEGO1/omni/src/audio/mxaudiomanager.cpp index 318a8446..a2d6072a 100644 --- a/LEGO1/omni/src/audio/mxaudiomanager.cpp +++ b/LEGO1/omni/src/audio/mxaudiomanager.cpp @@ -5,12 +5,6 @@ DECOMP_SIZE_ASSERT(MxAudioManager, 0x30); // GLOBAL: LEGO1 0x10102108 MxS32 MxAudioManager::g_count = 0; -// FUNCTION: LEGO1 0x10029910 -MxS32 MxAudioManager::GetVolume() -{ - return this->m_volume; -} - // FUNCTION: LEGO1 0x100b8d00 MxAudioManager::MxAudioManager() { diff --git a/LEGO1/omni/src/common/mxvariable.cpp b/LEGO1/omni/src/common/mxvariable.cpp index a60051fd..7b0a46c1 100644 --- a/LEGO1/omni/src/common/mxvariable.cpp +++ b/LEGO1/omni/src/common/mxvariable.cpp @@ -4,21 +4,3 @@ #include "mxstring.h" DECOMP_SIZE_ASSERT(MxVariable, 0x24) - -// FUNCTION: LEGO1 0x1003bea0 -MxString* MxVariable::GetValue() -{ - return &m_value; -} - -// FUNCTION: LEGO1 0x1003beb0 -void MxVariable::SetValue(const char* p_value) -{ - m_value = p_value; -} - -// FUNCTION: LEGO1 0x1003bec0 -void MxVariable::Destroy() -{ - delete this; -} diff --git a/LEGO1/omni/src/main/mxomni.cpp b/LEGO1/omni/src/main/mxomni.cpp index 377ba481..6df6d009 100644 --- a/LEGO1/omni/src/main/mxomni.cpp +++ b/LEGO1/omni/src/main/mxomni.cpp @@ -27,26 +27,6 @@ MxBool g_use3dSound; // GLOBAL: LEGO1 0x101015b0 MxOmni* MxOmni::g_instance = NULL; -// FUNCTION: LEGO1 0x100159e0 -void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last) -{ - MxDSAction action; - - action.SetAtomId(*p_id); - action.SetUnknown24(-2); - - for (MxS32 first = p_first, last = p_last; first <= last; first++) { - action.SetObjectId(first); - DeleteObject(action); - } -} - -// FUNCTION: LEGO1 0x10058a90 -MxBool MxOmni::IsTimerRunning() -{ - return m_timerRunning; -} - // FUNCTION: LEGO1 0x100acea0 MxObjectFactory* ObjectFactory() { @@ -113,6 +93,12 @@ MxEventManager* EventManager() return MxOmni::GetInstance()->GetEventManager(); } +// FUNCTION: LEGO1 0x100acf50 +MxResult Start(MxDSAction* p_dsAction) +{ + return MxOmni::GetInstance()->Start(p_dsAction); +} + // FUNCTION: LEGO1 0x100acf70 void DeleteObject(MxDSAction& p_dsAction) { diff --git a/LEGO1/omni/src/notify/mxactionnotificationparam.cpp b/LEGO1/omni/src/notify/mxactionnotificationparam.cpp index 5573677f..c5f816e7 100644 --- a/LEGO1/omni/src/notify/mxactionnotificationparam.cpp +++ b/LEGO1/omni/src/notify/mxactionnotificationparam.cpp @@ -3,18 +3,6 @@ DECOMP_SIZE_ASSERT(MxActionNotificationParam, 0x14) DECOMP_SIZE_ASSERT(MxEndActionNotificationParam, 0x14) -// FUNCTION: LEGO1 0x100510c0 -MxNotificationParam* MxActionNotificationParam::Clone() -{ - return new MxActionNotificationParam(this->m_type, this->m_sender, this->m_action, this->m_realloc); -} - -// FUNCTION: LEGO1 0x10051270 -MxNotificationParam* MxEndActionNotificationParam::Clone() -{ - return new MxEndActionNotificationParam(c_notificationEndAction, this->m_sender, this->m_action, this->m_realloc); -} - // FUNCTION: LEGO1 0x100b0300 MxNotificationParam* MxStartActionNotificationParam::Clone() { diff --git a/LEGO1/omni/src/notify/mxnotificationparam.cpp b/LEGO1/omni/src/notify/mxnotificationparam.cpp index 0797c9f1..cb15a2df 100644 --- a/LEGO1/omni/src/notify/mxnotificationparam.cpp +++ b/LEGO1/omni/src/notify/mxnotificationparam.cpp @@ -3,9 +3,3 @@ #include "decomp.h" DECOMP_SIZE_ASSERT(MxNotificationParam, 0xc); - -// FUNCTION: LEGO1 0x10010390 -MxNotificationParam* MxNotificationParam::Clone() -{ - return new MxNotificationParam(m_type, m_sender); -} diff --git a/LEGO1/omni/src/video/mxbitmap.cpp b/LEGO1/omni/src/video/mxbitmap.cpp index 4f2393cf..ea93279b 100644 --- a/LEGO1/omni/src/video/mxbitmap.cpp +++ b/LEGO1/omni/src/video/mxbitmap.cpp @@ -10,12 +10,6 @@ DECOMP_SIZE_ASSERT(MxBITMAPINFO, 0x428); // (1998) GLOBAL: LEGO1 0x10102184 MxU16 g_bitmapSignature = TWOCC('B', 'M'); -// FUNCTION: LEGO1 0x1004e0d0 -int MxBitmap::VTable0x28(int) -{ - return -1; -} - // FUNCTION: LEGO1 0x100bc980 MxBitmap::MxBitmap() { diff --git a/LEGO1/omni/src/video/mxstillpresenter.cpp b/LEGO1/omni/src/video/mxstillpresenter.cpp index 20e6b3a2..831a5e7b 100644 --- a/LEGO1/omni/src/video/mxstillpresenter.cpp +++ b/LEGO1/omni/src/video/mxstillpresenter.cpp @@ -13,12 +13,6 @@ DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c); // GLOBAL: LEGO1 0x10101eb0 const char* g_strBmpIsmap = "BMP_ISMAP"; -// FUNCTION: LEGO1 0x100435b0 -void MxStillPresenter::Destroy() -{ - Destroy(FALSE); -} - // FUNCTION: LEGO1 0x100b9c70 void MxStillPresenter::Destroy(MxBool p_fromDestructor) {