mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 00:44:21 +00:00
Implement/match LegoModelPresenter::FUN_1007ff70 (#622)
This commit is contained in:
committed by
GitHub
parent
c2a46b058b
commit
d3b575169e
@@ -36,7 +36,7 @@ public:
|
|||||||
void ParseExtra() override; // vtable+0x30
|
void ParseExtra() override; // vtable+0x30
|
||||||
void Destroy() override; // vtable+0x38
|
void Destroy() override; // vtable+0x38
|
||||||
|
|
||||||
void FUN_1007ff70(MxDSChunk& p_chunk, LegoEntity* p_entity, undefined p_modelUnknown0x34, LegoWorld* p_world);
|
MxResult FUN_1007ff70(MxDSChunk& p_chunk, LegoEntity* p_entity, undefined p_modelUnknown0x34, LegoWorld* p_world);
|
||||||
|
|
||||||
inline void Reset()
|
inline void Reset()
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ private:
|
|||||||
LegoROI* m_roi; // 0x64
|
LegoROI* m_roi; // 0x64
|
||||||
MxBool m_addedToView; // 0x68
|
MxBool m_addedToView; // 0x68
|
||||||
|
|
||||||
MxResult CreateROI(MxStreamChunk* p_chunk);
|
MxResult CreateROI(MxDSChunk* p_chunk);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LEGOMODELPRESENTER_H
|
#endif // LEGOMODELPRESENTER_H
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
inline LegoCameraController* GetCamera() { return m_cameraController; }
|
inline LegoCameraController* GetCamera() { return m_cameraController; }
|
||||||
inline MxS32 GetScriptIndex() { return m_scriptIndex; }
|
inline MxS32 GetScriptIndex() { return m_scriptIndex; }
|
||||||
inline MxCoreSet& GetUnknown0xd0() { return m_set0xd0; }
|
inline MxCoreSet& GetUnknown0xd0() { return m_set0xd0; }
|
||||||
inline list<LegoROI*>& GetUnknownList0xe0() { return m_list0xe0; }
|
inline list<LegoROI*>& GetROIList() { return m_roiList; }
|
||||||
|
|
||||||
inline void SetScriptIndex(MxS32 p_scriptIndex) { m_scriptIndex = p_scriptIndex; }
|
inline void SetScriptIndex(MxS32 p_scriptIndex) { m_scriptIndex = p_scriptIndex; }
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ protected:
|
|||||||
MxCoreSet m_set0xa8; // 0xa8
|
MxCoreSet m_set0xa8; // 0xa8
|
||||||
MxPresenterList m_controlPresenters; // 0xb8
|
MxPresenterList m_controlPresenters; // 0xb8
|
||||||
MxCoreSet m_set0xd0; // 0xd0
|
MxCoreSet m_set0xd0; // 0xd0
|
||||||
list<LegoROI*> m_list0xe0; // 0xe0
|
list<LegoROI*> m_roiList; // 0xe0
|
||||||
MxS32 m_scriptIndex; // 0xec
|
MxS32 m_scriptIndex; // 0xec
|
||||||
LegoHideAnimPresenter* m_hideAnimPresenter; // 0xf0
|
LegoHideAnimPresenter* m_hideAnimPresenter; // 0xf0
|
||||||
MxS16 m_startupTicks; // 0xf4
|
MxS16 m_startupTicks; // 0xf4
|
||||||
|
|||||||
@@ -203,9 +203,9 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
|
|||||||
m_cacheSoundList = NULL;
|
m_cacheSoundList = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!m_list0xe0.empty()) {
|
while (!m_roiList.empty()) {
|
||||||
LegoROI* roi = m_list0xe0.front();
|
LegoROI* roi = m_roiList.front();
|
||||||
m_list0xe0.pop_front();
|
m_roiList.pop_front();
|
||||||
delete roi;
|
delete roi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void LegoModelPresenter::Destroy(MxBool p_fromDestructor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1007f6b0
|
// FUNCTION: LEGO1 0x1007f6b0
|
||||||
MxResult LegoModelPresenter::CreateROI(MxStreamChunk* p_chunk)
|
MxResult LegoModelPresenter::CreateROI(MxDSChunk* p_chunk)
|
||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
LegoU32 numROIs;
|
LegoU32 numROIs;
|
||||||
@@ -202,14 +202,36 @@ done:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x1007ff70
|
// FUNCTION: LEGO1 0x1007ff70
|
||||||
void LegoModelPresenter::FUN_1007ff70(
|
MxResult LegoModelPresenter::FUN_1007ff70(
|
||||||
MxDSChunk& p_chunk,
|
MxDSChunk& p_chunk,
|
||||||
LegoEntity* p_entity,
|
LegoEntity* p_entity,
|
||||||
undefined p_modelUnknown0x34,
|
undefined p_modelUnknown0x34,
|
||||||
LegoWorld* p_world
|
LegoWorld* p_world
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
MxResult result = SUCCESS;
|
||||||
|
|
||||||
|
ParseExtra();
|
||||||
|
|
||||||
|
if (m_roi == NULL && (result = CreateROI(&p_chunk)) == SUCCESS && p_entity != NULL) {
|
||||||
|
VideoManager()->Get3DManager()->GetLego3DView()->Add(*m_roi);
|
||||||
|
VideoManager()->Get3DManager()->GetLego3DView()->Moved(*m_roi);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_roi != NULL) {
|
||||||
|
m_roi->SetUnknown0x0c(p_modelUnknown0x34);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p_entity != NULL) {
|
||||||
|
p_entity->SetROI(m_roi, TRUE, TRUE);
|
||||||
|
p_entity->ClearFlag(LegoEntity::c_bit2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
p_world->GetROIList().push_back(m_roi);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10080050
|
// FUNCTION: LEGO1 0x10080050
|
||||||
@@ -291,7 +313,7 @@ void LegoModelPresenter::ParseExtra()
|
|||||||
}
|
}
|
||||||
else if (KeyValueStringParse(output, g_dbCreate, extraCopy) != 0 && m_roi == NULL) {
|
else if (KeyValueStringParse(output, g_dbCreate, extraCopy) != 0 && m_roi == NULL) {
|
||||||
LegoWorld* currentWorld = CurrentWorld();
|
LegoWorld* currentWorld = CurrentWorld();
|
||||||
list<LegoROI*>& roiList = currentWorld->GetUnknownList0xe0();
|
list<LegoROI*>& roiList = currentWorld->GetROIList();
|
||||||
|
|
||||||
for (list<LegoROI*>::iterator it = roiList.begin(); it != roiList.end(); it++) {
|
for (list<LegoROI*>::iterator it = roiList.begin(); it != roiList.end(); it++) {
|
||||||
if (!strcmpi((*it)->GetName(), output)) {
|
if (!strcmpi((*it)->GetName(), output)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user