mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Match, implement Find
This commit is contained in:
parent
aa835e16d7
commit
b3d871cb4b
@ -51,7 +51,7 @@ class LegoCharacterManager {
|
|||||||
void FUN_100832a0();
|
void FUN_100832a0();
|
||||||
void FUN_10083db0(LegoROI* p_roi);
|
void FUN_10083db0(LegoROI* p_roi);
|
||||||
void FUN_10083f10(LegoROI* p_roi);
|
void FUN_10083f10(LegoROI* p_roi);
|
||||||
LegoCharacterData* FUN_10084c60(const char* p_key);
|
LegoCharacterData* Find(const char* p_key);
|
||||||
MxBool FUN_10084ec0(LegoROI* p_roi);
|
MxBool FUN_10084ec0(LegoROI* p_roi);
|
||||||
MxU32 FUN_10085140(LegoROI*, MxBool);
|
MxU32 FUN_10085140(LegoROI*, MxBool);
|
||||||
LegoROI* FUN_10085210(const LegoChar*, LegoChar*, undefined);
|
LegoROI* FUN_10085210(const LegoChar*, LegoChar*, undefined);
|
||||||
|
|||||||
@ -49,7 +49,7 @@ MxResult LegoCharacterManager::Write(LegoStorage* p_storage)
|
|||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
|
|
||||||
for (MxS32 i = 0; i < _countof(g_characterData); i++) {
|
for (MxS32 i = 0; i < _countof(g_characterData) - 1; i++) {
|
||||||
LegoCharacterData* data = &g_characterData[i];
|
LegoCharacterData* data = &g_characterData[i];
|
||||||
|
|
||||||
if (p_storage->Write(&data->m_unk0x0c, sizeof(data->m_unk0x0c)) != SUCCESS) {
|
if (p_storage->Write(&data->m_unk0x0c, sizeof(data->m_unk0x0c)) != SUCCESS) {
|
||||||
@ -95,7 +95,7 @@ MxResult LegoCharacterManager::Read(LegoStorage* p_storage)
|
|||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
|
|
||||||
for (MxS32 i = 0; i < _countof(g_characterData); i++) {
|
for (MxS32 i = 0; i < _countof(g_characterData) - 1; i++) {
|
||||||
LegoCharacterData* data = &g_characterData[i];
|
LegoCharacterData* data = &g_characterData[i];
|
||||||
|
|
||||||
if (p_storage->Read(&data->m_unk0x0c, sizeof(data->m_unk0x0c)) != SUCCESS) {
|
if (p_storage->Read(&data->m_unk0x0c, sizeof(data->m_unk0x0c)) != SUCCESS) {
|
||||||
@ -175,7 +175,7 @@ LegoROI* LegoCharacterManager::GetROI(const char* p_key, MxBool p_createEntity)
|
|||||||
actor->SetROI(character->m_roi, FALSE, FALSE);
|
actor->SetROI(character->m_roi, FALSE, FALSE);
|
||||||
actor->FUN_100114e0(0);
|
actor->FUN_100114e0(0);
|
||||||
actor->SetFlag(LegoActor::c_bit2);
|
actor->SetFlag(LegoActor::c_bit2);
|
||||||
FUN_10084c60(p_key)->m_actor = actor;
|
Find(p_key)->m_actor = actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
return character->m_roi;
|
return character->m_roi;
|
||||||
@ -210,14 +210,14 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
Tgl::Renderer* renderer = VideoManager()->GetRenderer();
|
Tgl::Renderer* renderer = VideoManager()->GetRenderer();
|
||||||
ViewLODListManager* lodManager = GetViewLODListManager();
|
ViewLODListManager* lodManager = GetViewLODListManager();
|
||||||
LegoTextureContainer* textureContainer = TextureContainer();
|
LegoTextureContainer* textureContainer = TextureContainer();
|
||||||
LegoCharacterData* characterData = FUN_10084c60(p_key);
|
LegoCharacterData* characterData = Find(p_key);
|
||||||
|
|
||||||
if (characterData == NULL) {
|
if (characterData == NULL) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmpi(p_key, "pep")) {
|
if (!strcmpi(p_key, "pep")) {
|
||||||
LegoCharacterData* pepper = FUN_10084c60("pepper");
|
LegoCharacterData* pepper = Find("pepper");
|
||||||
|
|
||||||
characterData->m_unk0x0c = pepper->m_unk0x0c;
|
characterData->m_unk0x0c = pepper->m_unk0x0c;
|
||||||
characterData->m_unk0x10 = pepper->m_unk0x10;
|
characterData->m_unk0x10 = pepper->m_unk0x10;
|
||||||
@ -352,9 +352,19 @@ MxBool LegoCharacterManager::FUN_10084c00(const LegoChar*)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10084c60
|
// FUNCTION: LEGO1 0x10084c60
|
||||||
LegoCharacterData* LegoCharacterManager::FUN_10084c60(const char* p_key)
|
LegoCharacterData* LegoCharacterManager::Find(const char* p_key)
|
||||||
{
|
{
|
||||||
|
for (MxU32 i = 0; i < _countof(g_characterData) - 1; i++) {
|
||||||
|
if (!strcmpi(g_characterData[i].m_name, p_key)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i < _countof(g_characterData)) {
|
||||||
|
return &g_characterData[i];
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user