Implement Start() (#176)

* Implement Start()

* Undo isleapp changes

* Implement LegoOmni::Start

* fix vtable0x20

* Address review

* fix build
This commit is contained in:
Misha 2023-10-07 09:05:44 -04:00 committed by GitHub
parent 85fe4ad07a
commit 50b9a6dea5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 70 additions and 15 deletions

View file

@ -99,11 +99,10 @@ void SetOmniUserMessage(void (*p_userMsg)(const char *,int))
g_omniUserMessage = p_userMsg; g_omniUserMessage = p_userMsg;
} }
// OFFSET: LEGO1 0x100acf50 STUB // OFFSET: LEGO1 0x100acf50
MxLong Start(MxDSAction *) MxResult Start(MxDSAction* p_dsAction)
{ {
// TODO return MxOmni::GetInstance()->Start(p_dsAction);
return 0;
} }
// OFFSET: LEGO1 0x1005ad10 // OFFSET: LEGO1 0x1005ad10
@ -257,6 +256,10 @@ void LegoOmni::Init()
MxResult LegoOmni::Create(COMPAT_CONST MxOmniCreateParam &p) MxResult LegoOmni::Create(COMPAT_CONST MxOmniCreateParam &p)
{ {
// FIXME: Stub // FIXME: Stub
MxOmni::Create(p);
m_gameState = new LegoGameState();
m_bkgAudioManager = new MxBackgroundAudioManager();
return SUCCESS; return SUCCESS;
} }
@ -265,9 +268,14 @@ void LegoOmni::Destroy()
// FIXME: Stub // FIXME: Stub
} }
void LegoOmni::vtable0x20() // OFFSET: LEGO1 0x1005b580
MxResult LegoOmni::Start(MxDSAction* action)
{ {
// FIXME: Stub MxResult result = MxOmni::Start(action);
this->m_action.SetAtomId(action->GetAtomId());
this->m_action.SetObjectId(action->GetObjectId());
this->m_action.SetUnknown24(action->GetUnknown24());
return result;
} }
void LegoOmni::DeleteObject(MxDSAction &ds) void LegoOmni::DeleteObject(MxDSAction &ds)

View file

@ -55,7 +55,7 @@ class LegoOmni : public MxOmni
virtual void Init() override; // vtable+14 virtual void Init() override; // vtable+14
virtual MxResult Create(COMPAT_CONST MxOmniCreateParam &p) override; // vtable+18 virtual MxResult Create(COMPAT_CONST MxOmniCreateParam &p) override; // vtable+18
virtual void Destroy() override; // vtable+1c virtual void Destroy() override; // vtable+1c
virtual void vtable0x20() override; virtual MxResult Start(MxDSAction* action) override;
virtual void DeleteObject(MxDSAction &ds) override; virtual void DeleteObject(MxDSAction &ds) override;
virtual MxBool DoesEntityExist(MxDSAction &ds) override; virtual MxBool DoesEntityExist(MxDSAction &ds) override;
virtual void vtable0x2c() override; virtual void vtable0x2c() override;
@ -110,10 +110,9 @@ __declspec(dllexport) LegoEntity * PickEntity(MxLong,MxLong);
__declspec(dllexport) LegoROI * PickROI(MxLong,MxLong); __declspec(dllexport) LegoROI * PickROI(MxLong,MxLong);
__declspec(dllexport) void SetOmniUserMessage(void (*)(const char *,int)); __declspec(dllexport) void SetOmniUserMessage(void (*)(const char *,int));
__declspec(dllexport) LegoSoundManager * SoundManager(); __declspec(dllexport) LegoSoundManager * SoundManager();
__declspec(dllexport) MxLong Start(MxDSAction *); __declspec(dllexport) MxResult Start(MxDSAction*);
__declspec(dllexport) MxTransitionManager * TransitionManager(); __declspec(dllexport) MxTransitionManager * TransitionManager();
__declspec(dllexport) LegoVideoManager * VideoManager(); __declspec(dllexport) LegoVideoManager * VideoManager();
__declspec(dllexport) MxLong Start(MxDSAction *a);
LegoBuildingManager* BuildingManager(); LegoBuildingManager* BuildingManager();
Isle* GetIsle(); Isle* GetIsle();

View file

@ -36,6 +36,7 @@ class MxDSObject : public MxCore
inline const MxAtomId& GetAtomId() { return this->m_atomId; } inline const MxAtomId& GetAtomId() { return this->m_atomId; }
inline MxU32 GetObjectId() { return this->m_objectId; } inline MxU32 GetObjectId() { return this->m_objectId; }
inline MxS16 GetUnknown24() { return this->m_unk24; }
inline void SetObjectId(MxU32 p_objectId) { this->m_objectId = p_objectId; } inline void SetObjectId(MxU32 p_objectId) { this->m_objectId = p_objectId; }
inline void SetUnknown24(MxS16 p_unk24) { this->m_unk24 = p_unk24; } inline void SetUnknown24(MxS16 p_unk24) { this->m_unk24 = p_unk24; }

View file

@ -42,10 +42,16 @@ void MxOmni::Init()
m_unk64 = NULL; m_unk64 = NULL;
} }
// OFFSET: LEGO1 0x100b0090 STUB // OFFSET: LEGO1 0x100b0090
void MxOmni::vtable0x20() MxResult MxOmni::Start(MxDSAction* p_dsAction)
{ {
// TODO MxResult result = FAILURE;
if(p_dsAction->GetAtomId().GetInternal() != NULL && p_dsAction->GetObjectId() != -1 && m_streamer != NULL)
{
result = m_streamer->Unknown100b99b0(p_dsAction);
}
return result;
} }
// OFFSET: LEGO1 0x100b00c0 STUB // OFFSET: LEGO1 0x100b00c0 STUB

View file

@ -38,7 +38,7 @@ class MxOmni : public MxCore
virtual void Init(); // vtable+14 virtual void Init(); // vtable+14
virtual MxResult Create(COMPAT_CONST MxOmniCreateParam &p); // vtable+18 virtual MxResult Create(COMPAT_CONST MxOmniCreateParam &p); // vtable+18
virtual void Destroy(); // vtable+1c virtual void Destroy(); // vtable+1c
virtual void vtable0x20(); // vtable+20 virtual MxResult Start(MxDSAction* p_dsAction); // vtable+20
virtual void DeleteObject(MxDSAction &ds); // vtable+24 virtual void DeleteObject(MxDSAction &ds); // vtable+24
virtual MxBool DoesEntityExist(MxDSAction &ds); // vtable+28 virtual MxBool DoesEntityExist(MxDSAction &ds); // vtable+28
virtual void vtable0x2c(); // vtable+2c virtual void vtable0x2c(); // vtable+2c

View file

@ -30,3 +30,22 @@ MxResult MxStreamController::Open(const char *p_filename)
return SUCCESS; return SUCCESS;
} }
// OFFSET: LEGO1 0x100b9400
MxResult MxStreamController::vtable0x18(undefined4 p_unknown, undefined4 p_unknown2)
{
return FAILURE;
}
// OFFSET: LEGO1 0x100b9410
MxResult MxStreamController::vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2)
{
return FAILURE;
}
// OFFSET: LEGO1 0x100c1690 STUB
MxResult MxStreamController::vtable0x20(MxDSAction* action)
{
// TODO STUB
return FAILURE;
}

View file

@ -6,6 +6,7 @@
#include "mxcriticalsection.h" #include "mxcriticalsection.h"
#include "mxcore.h" #include "mxcore.h"
#include "mxdsobject.h" #include "mxdsobject.h"
#include "mxdsaction.h"
// VTABLE 0x100dc968 // VTABLE 0x100dc968
// SIZE 0x64 // SIZE 0x64
@ -30,6 +31,9 @@ class MxStreamController : public MxCore
} }
virtual MxResult Open(const char *p_filename); // vtable+0x14 virtual MxResult Open(const char *p_filename); // vtable+0x14
virtual MxResult vtable0x18(undefined4 p_unknown, undefined4 p_unknown2); //vtable+0x18
virtual MxResult vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2); //vtable+0x1c
virtual MxResult vtable0x20(MxDSAction* action); //vtable+0x20
MxBool FUN_100c20d0(MxDSObject &p_obj); MxBool FUN_100c20d0(MxDSObject &p_obj);

View file

@ -133,6 +133,22 @@ MxResult MxStreamer::AddStreamControllerToOpenList(MxStreamController *stream)
return FAILURE; return FAILURE;
} }
// OFFSET: LEGO1 0x100b99b0
MxResult MxStreamer::Unknown100b99b0(MxDSAction* p_action)
{
MxStreamController* controller;
if (p_action != NULL && p_action->GetAtomId().GetInternal() != NULL && p_action->GetObjectId() != -1)
{
controller = GetOpenStream(p_action->GetAtomId().GetInternal());
if (controller == NULL)
{
return FAILURE;
}
return controller->vtable0x20(p_action);
}
return FAILURE;
}
// OFFSET: LEGO1 0x100b9b60 // OFFSET: LEGO1 0x100b9b60
MxLong MxStreamer::Notify(MxParam &p) MxLong MxStreamer::Notify(MxParam &p)
{ {

View file

@ -96,6 +96,8 @@ class MxStreamer : public MxCore
MxResult AddStreamControllerToOpenList(MxStreamController *p_stream); MxResult AddStreamControllerToOpenList(MxStreamController *p_stream);
MxResult MxStreamer::Unknown100b99b0(MxDSAction* p_action);
private: private:
list<MxStreamController *> m_openStreams; // 0x8 list<MxStreamController *> m_openStreams; // 0x8
MxStreamerSubClass2 m_subclass1; // 0x14 MxStreamerSubClass2 m_subclass1; // 0x14