Implement/match LegoWorld::FUN_10021790 (#486)

* Implement/match LegoWorld::FUN_10021790

* Improve match

* Match

* Specify python package versions

* Use wildcard version

* Use const atom

* Use const atom
This commit is contained in:
Christian Semmler 2024-01-26 12:03:29 -05:00 committed by GitHub
parent 5f413165cc
commit a3868e3808
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 20 deletions

View file

@ -29,7 +29,7 @@ jobs:
- name: Install python libraries - name: Install python libraries
shell: bash shell: bash
run: | run: |
pip install black pylint pytest -r tools/requirements.txt pip install black==23.* pylint==3.* pytest==7.* -r tools/requirements.txt
- name: Run pylint and black - name: Run pylint and black
shell: bash shell: bash

View file

@ -86,7 +86,10 @@ class LegoEntityListCursor : public MxPtrListCursor<LegoEntity> {
// FUNCTION: LEGO1 0x1001f2b0 // FUNCTION: LEGO1 0x1001f2b0
// MxListCursor<LegoEntity *>::~MxListCursor<LegoEntity *> // MxListCursor<LegoEntity *>::~MxListCursor<LegoEntity *>
// FUNCTION: LEGO1 0x1001edc6 // FUNCTION: LEGO1 0x1001f300
// LegoEntityListCursor::~LegoEntityListCursor // LegoEntityListCursor::~LegoEntityListCursor
// TEMPLATE: LEGO1 0x100207d0
// MxListCursor<LegoEntity *>::MxListCursor<LegoEntity *>
#endif // LEGOENTITYLIST_H #endif // LEGOENTITYLIST_H

View file

@ -66,7 +66,7 @@ class LegoWorld : public LegoEntity {
void FUN_10073430(); void FUN_10073430();
MxS32 GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value); MxS32 GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value);
MxPresenter* FindPresenter(const char* p_presenter, const char* p_name); MxPresenter* FindPresenter(const char* p_presenter, const char* p_name);
MxPresenter* FUN_10021790(MxAtomId& p_atom, MxS32 p_entityId); MxCore* FUN_10021790(const MxAtomId& p_atom, MxS32 p_entityId);
// SYNTHETIC: LEGO1 0x1001dee0 // SYNTHETIC: LEGO1 0x1001dee0
// LegoWorld::`scalar deleting destructor' // LegoWorld::`scalar deleting destructor'

View file

@ -168,9 +168,48 @@ MxPresenter* LegoWorld::FindPresenter(const char* p_presenter, const char* p_nam
return NULL; return NULL;
} }
// STUB: LEGO1 0x10021790 // FUNCTION: LEGO1 0x10021790
MxPresenter* LegoWorld::FUN_10021790(MxAtomId& p_atom, MxS32 p_entityId) MxCore* LegoWorld::FUN_10021790(const MxAtomId& p_atom, MxS32 p_entityId)
{ {
LegoEntityListCursor entityCursor(m_entityList);
LegoEntity* entity;
while (entityCursor.Next(entity)) {
if (entity->GetAtom() == p_atom && entity->GetEntityId() == p_entityId)
return entity;
}
MxPresenterListCursor presenterCursor0xb8(&m_list0xb8);
MxPresenter* presenter;
while (presenterCursor0xb8.Next(presenter)) {
MxDSAction* action = presenter->GetAction();
if (action->GetAtomId() == p_atom && action->GetObjectId() == p_entityId)
return presenter;
}
MxPresenterListCursor presenterCursor0x80(&m_list0x80);
while (presenterCursor0x80.Next(presenter)) {
MxDSAction* action = presenter->GetAction();
if (action && action->GetAtomId() == p_atom && action->GetObjectId() == p_entityId)
return presenter;
}
for (MxPresenterSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) {
MxCore* core = *it;
if (core->IsA("MxPresenter")) {
MxPresenter* presenter = (MxPresenter*) *it;
MxDSAction* action = presenter->GetAction();
if (action->GetAtomId() == p_atom && action->GetObjectId() == p_entityId)
return *it;
}
}
return NULL; return NULL;
} }

View file

@ -365,22 +365,22 @@ void Infocenter::InitializeBitmaps()
{ {
m_radio.Initialize(TRUE); m_radio.Initialize(TRUE);
FUN_10021790(m_atom, c_leftArrowCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_leftArrowCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_rightArrowCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_rightArrowCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_infoCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_infoCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_boatCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_boatCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_raceCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_raceCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_pizzaCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_pizzaCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_gasCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_gasCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_medCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_medCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_copCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_copCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_mamaCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_mamaCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_papaCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_papaCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_pepperCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_pepperCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_nickCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_nickCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_lauraCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_lauraCtl))->Enable(TRUE);
FUN_10021790(m_atom, c_radioCtl)->Enable(TRUE); ((MxPresenter*) FUN_10021790(m_atom, c_radioCtl))->Enable(TRUE);
m_mapAreas[0].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Info_A_Bitmap"); m_mapAreas[0].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Info_A_Bitmap");
m_mapAreas[0].m_unk0x08 = 391; m_mapAreas[0].m_unk0x08 = 391;