mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Implement/match LegoOmni::FindROI and related (#570)
* Implement/match LegoOmni::FindROI and related * Add missing file
This commit is contained in:

committed by
GitHub

parent
5b06054375
commit
c67f613b8d
@@ -24,7 +24,7 @@ public:
|
||||
}
|
||||
|
||||
MxBool SetFlag() override; // vtable+0x18
|
||||
MxResult VTable0x1c(LegoFile* p_legoFile) override; // vtable+0x1C
|
||||
MxResult VTable0x1c(LegoFile* p_legoFile) override; // vtable+0x1c
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10065130
|
||||
// AnimState::`scalar deleting destructor'
|
||||
|
@@ -193,6 +193,7 @@ public:
|
||||
void StopTimer() override; // vtable+3c
|
||||
|
||||
LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid);
|
||||
LegoROI* FindROI(const char* p_name);
|
||||
void AddWorld(LegoWorld* p_world);
|
||||
void DeleteWorld(LegoWorld* p_world);
|
||||
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags);
|
||||
@@ -273,8 +274,9 @@ LegoWorld* CurrentWorld();
|
||||
LegoUnkSaveDataWriter* UnkSaveDataWriter();
|
||||
GifManager* GetGifManager();
|
||||
void FUN_10015820(MxBool p_disable, MxU16 p_flags);
|
||||
void FUN_10015860(const char*, MxU8);
|
||||
void SetROIUnknown0x0c(const char* p_name, undefined p_unk0x0c);
|
||||
LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid);
|
||||
LegoROI* FindROI(const char* p_name);
|
||||
MxDSAction& GetCurrentAction();
|
||||
|
||||
void PlayMusic(MxU32 p_index);
|
||||
|
@@ -22,7 +22,7 @@ public:
|
||||
return !strcmp(p_name, TowTrackMissionState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult VTable0x1c(LegoFile* p_legoFile) override; // vtable+0x1C
|
||||
MxResult VTable0x1c(LegoFile* p_legoFile) override; // vtable+0x1c
|
||||
|
||||
inline MxU16 GetColor(MxU8 p_id)
|
||||
{
|
||||
|
@@ -448,7 +448,7 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
|
||||
}
|
||||
|
||||
LegoROI* roi = entity->GetROI();
|
||||
if (roi && !strcmpi(roi->GetUnknown0xe4(), p_name)) {
|
||||
if (roi && !strcmpi(roi->GetName(), p_name)) {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
@@ -289,8 +289,8 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
m_currentCutscene = e_noIntro;
|
||||
return 1;
|
||||
case 2:
|
||||
FUN_10015860(g_object2x4red, 0);
|
||||
FUN_10015860(g_object2x4grn, 0);
|
||||
SetROIUnknown0x0c(g_object2x4red, 0);
|
||||
SetROIUnknown0x0c(g_object2x4grn, 0);
|
||||
BackgroundAudioManager()->RaiseVolume();
|
||||
return 1;
|
||||
case 4:
|
||||
@@ -319,7 +319,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
}
|
||||
|
||||
m_infocenterState->SetUnknown0x74(2);
|
||||
FUN_10015860("infoman", 1);
|
||||
SetROIUnknown0x0c("infoman", 1);
|
||||
return 1;
|
||||
case 12:
|
||||
if (action->GetObjectId() == m_currentInfomainScript) {
|
||||
@@ -1054,15 +1054,15 @@ MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
|
||||
}
|
||||
|
||||
PlayAction(objectId);
|
||||
FUN_10015860(g_object2x4red, 0);
|
||||
FUN_10015860(g_object2x4grn, 0);
|
||||
SetROIUnknown0x0c(g_object2x4red, 0);
|
||||
SetROIUnknown0x0c(g_object2x4grn, 0);
|
||||
return 1;
|
||||
}
|
||||
case 6:
|
||||
if (m_infocenterState->GetUnknown0x74() == 8) {
|
||||
StopCurrentAction();
|
||||
FUN_10015860(g_object2x4red, 0);
|
||||
FUN_10015860(g_object2x4grn, 0);
|
||||
SetROIUnknown0x0c(g_object2x4red, 0);
|
||||
SetROIUnknown0x0c(g_object2x4grn, 0);
|
||||
m_infocenterState->SetUnknown0x74(2);
|
||||
PlayAction(c_infomanSneeze);
|
||||
return 1;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "scorestate.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(ScoreState, 0x0C);
|
||||
DECOMP_SIZE_ASSERT(ScoreState, 0x0c);
|
||||
|
||||
// FUNCTION: LEGO1 0x1000de20
|
||||
MxBool ScoreState::VTable0x14()
|
||||
|
@@ -387,7 +387,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
|
||||
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
|
||||
p_param.SetROI(roi);
|
||||
|
||||
if (roi && roi->GetUnk0x0c() == 1) {
|
||||
if (roi && roi->GetUnknown0x0c() == 1) {
|
||||
for (OrientableROI* oroi = roi->GetUnknown0xd4(); oroi; oroi = oroi->GetUnknown0xd4()) {
|
||||
roi = (LegoROI*) oroi;
|
||||
}
|
||||
|
@@ -226,10 +226,20 @@ void FUN_10015820(MxBool p_disable, MxU16 p_flags)
|
||||
LegoOmni::GetInstance()->FUN_1005b4f0(p_disable, p_flags);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10015860
|
||||
void FUN_10015860(const char*, MxU8)
|
||||
// FUNCTION: LEGO1 0x10015840
|
||||
LegoROI* FindROI(const char* p_name)
|
||||
{
|
||||
// TODO
|
||||
return LegoOmni::GetInstance()->FindROI(p_name);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10015860
|
||||
void SetROIUnknown0x0c(const char* p_name, undefined p_unk0x0c)
|
||||
{
|
||||
LegoROI* roi = FindROI(p_name);
|
||||
|
||||
if (roi) {
|
||||
roi->SetUnknown0x0c(p_unk0x0c);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100158c0
|
||||
@@ -803,6 +813,28 @@ void LegoOmni::DeleteObject(MxDSAction& p_dsAction)
|
||||
MxOmni::DeleteObject(p_dsAction);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b270
|
||||
LegoROI* LegoOmni::FindROI(const char* p_name)
|
||||
{
|
||||
ViewManager* viewManager = GetVideoManager()->Get3DManager()->GetLego3DView()->GetViewManager();
|
||||
CompoundObject& unk0x08 = viewManager->GetUnknown0x08();
|
||||
|
||||
if (p_name != NULL && *p_name != '\0' && unk0x08.size() > 0) {
|
||||
for (CompoundObject::iterator it = unk0x08.begin(); it != unk0x08.end(); it++) {
|
||||
LegoROI* roi = (LegoROI*) *it;
|
||||
const char* name = roi->GetName();
|
||||
|
||||
if (name != NULL) {
|
||||
if (!strcmpi(name, p_name)) {
|
||||
return roi;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b2f0
|
||||
MxEntity* LegoOmni::AddToWorld(const char* p_id, MxS32 p_entityId, MxPresenter* p_presenter)
|
||||
{
|
||||
|
@@ -135,7 +135,7 @@ void LegoModelPresenter::ParseExtra()
|
||||
list<AutoROI*>& roiList = currentWorld->GetUnknownList0xe0();
|
||||
|
||||
for (list<AutoROI*>::iterator it = roiList.begin(); it != roiList.end(); it++) {
|
||||
if (!strcmpi(((LegoROI*) (*it))->GetUnknown0xe4(), output)) {
|
||||
if (!strcmpi(((LegoROI*) (*it))->GetName(), output)) {
|
||||
m_roi = *it;
|
||||
roiList.erase(it);
|
||||
|
||||
|
Reference in New Issue
Block a user