From f0df3cd0ef1f339293f9d13fd1d2e0854b0e011d Mon Sep 17 00:00:00 2001 From: Korbo Date: Mon, 30 Jun 2025 14:20:53 -0500 Subject: [PATCH 1/3] Clear a few unknowns in act 3 (#1597) * Clear a few unknowns in act 3 * fix build error * fix other build error * requested changes --- LEGO1/lego/legoomni/include/act3.h | 14 ++-- LEGO1/lego/legoomni/src/actors/act3actors.cpp | 4 +- LEGO1/lego/legoomni/src/actors/act3ammo.cpp | 4 +- LEGO1/lego/legoomni/src/worlds/act3.cpp | 67 +++++++++---------- 4 files changed, 44 insertions(+), 45 deletions(-) diff --git a/LEGO1/lego/legoomni/include/act3.h b/LEGO1/lego/legoomni/include/act3.h index dc81160c..38e2876e 100644 --- a/LEGO1/lego/legoomni/include/act3.h +++ b/LEGO1/lego/legoomni/include/act3.h @@ -129,7 +129,7 @@ class Act3 : public LegoWorld { void RemoveDonut(Act3Ammo& p_p); MxResult ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up); MxResult ShootDonut(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up); - void FUN_10072ad0(undefined4 p_param1); + void TriggerHitSound(undefined4 p_param1); MxResult FUN_10073360(Act3Ammo& p_ammo, const Vector3& p_param2); MxResult FUN_10073390(Act3Ammo& p_ammo, const Vector3& p_param2); void SetBrickster(Act3Brickster* p_brickster); @@ -168,12 +168,12 @@ class Act3 : public LegoWorld { Helicopter* m_copter; // 0x420c Act3Shark* m_shark; // 0x4210 MxFloat m_time; // 0x4214 - MxU8 m_unk0x4218; // 0x4218 - MxU8 m_unk0x4219; // 0x4219 - MxU8 m_unk0x421a; // 0x421a - MxU8 m_unk0x421b; // 0x421b - MxU8 m_unk0x421c; // 0x421c - MxU8 m_unk0x421d; // 0x421d + MxU8 m_pizzaHitSound; // 0x4218 + MxU8 m_pizzaMissSound; // 0x4219 + MxU8 m_copDonutSound; // 0x421a + MxU8 m_donutMissSound; // 0x421b + MxU8 m_islanderSound; // 0x421c + MxU8 m_bricksterDonutSound; // 0x421d undefined m_unk0x421e; // 0x421e Act3List m_unk0x4220; // 0x4220 MxPresenter* m_helicopterDots[15]; // 0x4230 diff --git a/LEGO1/lego/legoomni/src/actors/act3actors.cpp b/LEGO1/lego/legoomni/src/actors/act3actors.cpp index 1bd13278..c9750667 100644 --- a/LEGO1/lego/legoomni/src/actors/act3actors.cpp +++ b/LEGO1/lego/legoomni/src/actors/act3actors.cpp @@ -579,7 +579,7 @@ void Act3Brickster::Animate(float p_time) } if (m_unk0x54 < p_time) { - ((Act3*) m_world)->FUN_10072ad0(5); + ((Act3*) m_world)->TriggerHitSound(5); m_unk0x54 = p_time + 15000.0f; } @@ -595,7 +595,7 @@ void Act3Brickster::Animate(float p_time) assert(SoundManager()->GetCacheSoundManager()); if (m_unk0x58 >= 8) { - ((Act3*) m_world)->FUN_10072ad0(6); + ((Act3*) m_world)->TriggerHitSound(6); } else { SoundManager()->GetCacheSoundManager()->Play("eatpz", NULL, FALSE); diff --git a/LEGO1/lego/legoomni/src/actors/act3ammo.cpp b/LEGO1/lego/legoomni/src/actors/act3ammo.cpp index 04e0e93c..d88a7bee 100644 --- a/LEGO1/lego/legoomni/src/actors/act3ammo.cpp +++ b/LEGO1/lego/legoomni/src/actors/act3ammo.cpp @@ -378,11 +378,11 @@ void Act3Ammo::Animate(float p_time) if (IsBit4()) { if (IsPizza()) { m_world->RemovePizza(*this); - m_world->FUN_10072ad0(2); + m_world->TriggerHitSound(2); } else { m_world->RemoveDonut(*this); - m_world->FUN_10072ad0(4); + m_world->TriggerHitSound(4); } } else { diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index 64ed8d6c..10bf69cf 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -31,7 +31,7 @@ DECOMP_SIZE_ASSERT(Act3ListElement, 0x0c) DECOMP_SIZE_ASSERT(Act3List, 0x10) // GLOBAL: LEGO1 0x100d94f8 -Act3Script::Script g_unk0x100d94f8[] = { +Act3Script::Script g_pizzaHitSounds[] = { Act3Script::c_sns02xni_PlayWav, Act3Script::c_sns03xni_PlayWav, Act3Script::c_sns04xni_PlayWav, @@ -51,7 +51,7 @@ Act3Script::Script g_unk0x100d94f8[] = { }; // GLOBAL: LEGO1 0x100d9538 -Act3Script::Script g_unk0x100d9538[] = { +Act3Script::Script g_pizzaMissSounds[] = { Act3Script::c_sns19xni_PlayWav, Act3Script::c_sns20xni_PlayWav, Act3Script::c_sns22xni_PlayWav, @@ -61,7 +61,7 @@ Act3Script::Script g_unk0x100d9538[] = { }; // GLOBAL: LEGO1 0x100d9550 -Act3Script::Script g_unk0x100d9550[] = { +Act3Script::Script g_copDonutSounds[] = { Act3Script::c_sns25xni_PlayWav, Act3Script::c_sns26xni_PlayWav, Act3Script::c_sns27xni_PlayWav, @@ -73,7 +73,7 @@ Act3Script::Script g_unk0x100d9550[] = { }; // GLOBAL: LEGO1 0x100d9570 -Act3Script::Script g_unk0x100d9570[] = { +Act3Script::Script g_donutMissSounds[] = { Act3Script::c_sns30xni_PlayWav, Act3Script::c_sns31xni_PlayWav, Act3Script::c_sns32xni_PlayWav, @@ -83,7 +83,7 @@ Act3Script::Script g_unk0x100d9570[] = { }; // GLOBAL: LEGO1 0x100d9588 -Act3Script::Script g_unk0x100d9588[] = { +Act3Script::Script g_islanderSounds[] = { Act3Script::c_sns43xma_PlayWav, Act3Script::c_sns46xin_PlayWav, Act3Script::c_sns60xna_PlayWav, Act3Script::c_sns52xro_PlayWav, Act3Script::c_sns58xna_PlayWav, Act3Script::c_sns68xbu_PlayWav, Act3Script::c_sns59xna_PlayWav, Act3Script::c_sns51xin_PlayWav, Act3Script::c_sns61xva_PlayWav, @@ -94,7 +94,7 @@ Act3Script::Script g_unk0x100d9588[] = { }; // GLOBAL: LEGO1 0x100d95d8 -Act3Script::Script g_unk0x100d95d8[] = { +Act3Script::Script g_bricksterDonutSounds[] = { Act3Script::c_tns080br_PlayWav, Act3Script::c_tnsx07br_PlayWav, Act3Script::c_snsxx2br_PlayWav, @@ -403,58 +403,58 @@ MxResult Act3::ShootDonut(LegoPathController* p_controller, Vector3& p_location, // FUNCTION: LEGO1 0x10072ad0 // FUNCTION: BETA10 0x10015eec -void Act3::FUN_10072ad0(undefined4 p_param1) +void Act3::TriggerHitSound(undefined4 p_param1) { float time = Timer()->GetTime(); Act3Script::Script objectId; switch (p_param1) { case 1: { - if (m_unk0x4218 >= sizeOfArray(g_unk0x100d94f8)) { - m_unk0x4218 = 0; + if (m_pizzaHitSound >= sizeOfArray(g_pizzaHitSounds)) { + m_pizzaHitSound = 0; } - objectId = g_unk0x100d94f8[m_unk0x4218++]; + objectId = g_pizzaHitSounds[m_pizzaHitSound++]; break; } case 2: { - if (m_unk0x4219 >= sizeOfArray(g_unk0x100d9538) - 1) { - m_unk0x4219 = 0; + if (m_pizzaMissSound >= sizeOfArray(g_pizzaMissSounds) - 1) { + m_pizzaMissSound = 0; } - objectId = g_unk0x100d9538[m_unk0x4219++]; + objectId = g_pizzaMissSounds[m_pizzaMissSound++]; break; } case 3: { - if (m_unk0x421a >= sizeOfArray(g_unk0x100d9550)) { - m_unk0x421a = 0; + if (m_copDonutSound >= sizeOfArray(g_copDonutSounds)) { + m_copDonutSound = 0; } - objectId = g_unk0x100d9550[m_unk0x421a++]; + objectId = g_copDonutSounds[m_copDonutSound++]; break; } case 4: { - if (m_unk0x421b >= sizeOfArray(g_unk0x100d9570)) { - m_unk0x421b = 0; + if (m_donutMissSound >= sizeOfArray(g_donutMissSounds)) { + m_donutMissSound = 0; } - objectId = g_unk0x100d9570[m_unk0x421b++]; + objectId = g_donutMissSounds[m_donutMissSound++]; break; } case 5: { - if (m_unk0x421c >= sizeOfArray(g_unk0x100d9588)) { - m_unk0x421c = 0; + if (m_islanderSound >= sizeOfArray(g_islanderSounds)) { + m_islanderSound = 0; } - objectId = g_unk0x100d9588[m_unk0x421c++]; + objectId = g_islanderSounds[m_islanderSound++]; break; } case 6: { - if (m_unk0x421d >= sizeOfArray(g_unk0x100d95d8)) { - m_unk0x421d = 0; + if (m_bricksterDonutSound >= sizeOfArray(g_bricksterDonutSounds)) { + m_bricksterDonutSound = 0; } - m_unk0x4220.Insert(g_unk0x100d95d8[m_unk0x421d++], 1); + m_unk0x4220.Insert(g_bricksterDonutSounds[m_bricksterDonutSound++], 1); return; } default: @@ -575,13 +575,12 @@ MxLong Act3::Notify(MxParam& p_param) m_cop2->VTable0xa8(); m_brickster->VTable0xa8(); - - m_unk0x4218 = 0; - m_unk0x4219 = 0; - m_unk0x421a = 0; - m_unk0x421b = 0; - m_unk0x421c = 0; - m_unk0x421d = 0; + m_pizzaHitSound = 0; + m_pizzaMissSound = 0; + m_copDonutSound = 0; + m_donutMissSound = 0; + m_islanderSound = 0; + m_bricksterDonutSound = 0; MxS32 length; LegoBuildingInfo* info = BuildingManager()->GetInfoArray(length); @@ -701,7 +700,7 @@ MxResult Act3::FUN_10073360(Act3Ammo& p_ammo, const Vector3& p_param2) { assert(m_brickster); m_brickster->FUN_100417a0(p_ammo, p_param2); - FUN_10072ad0(1); + TriggerHitSound(1); return SUCCESS; } @@ -718,7 +717,7 @@ MxResult Act3::FUN_10073390(Act3Ammo& p_ammo, const Vector3& p_param2) m_cop2->FUN_10040350(p_ammo, p_param2); } - FUN_10072ad0(3); + TriggerHitSound(3); g_unk0x100f7814++; return SUCCESS; } From f825b053ffa70e80d6cac7f8e8f2683c242a270f Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Tue, 1 Jul 2025 00:29:23 +0200 Subject: [PATCH 2/3] Clear unknown in `mxutilities.h` (#1598) Also change the parameter name to mask as it better represents the usage. --- LEGO1/lego/legoomni/src/common/legoutils.cpp | 4 ++-- LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp | 2 +- LEGO1/lego/legoomni/src/entity/legoworld.cpp | 8 ++++---- LEGO1/lego/legoomni/src/worlds/infocenter.cpp | 4 ++-- LEGO1/omni/include/mxutilities.h | 2 +- LEGO1/omni/src/common/mxutilities.cpp | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/LEGO1/lego/legoomni/src/common/legoutils.cpp b/LEGO1/lego/legoomni/src/common/legoutils.cpp index a4f8d022..a9ea98a7 100644 --- a/LEGO1/lego/legoomni/src/common/legoutils.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutils.cpp @@ -507,7 +507,7 @@ MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id) } else { if (((MxPresenter*) object)->GetAction()) { - FUN_100b7220(((MxPresenter*) object)->GetAction(), MxDSAction::c_world, FALSE); + ApplyMask(((MxPresenter*) object)->GetAction(), MxDSAction::c_world, FALSE); } ((MxPresenter*) object)->EndAction(); @@ -536,7 +536,7 @@ MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_wor } else { if (((MxPresenter*) object)->GetAction()) { - FUN_100b7220(((MxPresenter*) object)->GetAction(), MxDSAction::c_world, FALSE); + ApplyMask(((MxPresenter*) object)->GetAction(), MxDSAction::c_world, FALSE); } ((MxPresenter*) object)->EndAction(); diff --git a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp index 0b397836..13ce2cee 100644 --- a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp @@ -44,7 +44,7 @@ MxResult MxControlPresenter::StartAction(MxStreamController* p_controller, MxDSA { MxResult result = MxCompositePresenter::StartAction(p_controller, p_action); - FUN_100b7220(m_action, MxDSAction::c_world | MxDSAction::c_looping, TRUE); + ApplyMask(m_action, MxDSAction::c_world | MxDSAction::c_looping, TRUE); ParseExtra(); MxS16 i = 0; diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index c0819883..c12d32e4 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -120,12 +120,12 @@ void LegoWorld::Destroy(MxBool p_fromDestructor) animPresenter->DecrementUnknown0xd4(); if (animPresenter->GetUnknown0xd4() == 0) { - FUN_100b7220(action, MxDSAction::c_world, FALSE); + ApplyMask(action, MxDSAction::c_world, FALSE); presenter->EndAction(); } } else { - FUN_100b7220(action, MxDSAction::c_world, FALSE); + ApplyMask(action, MxDSAction::c_world, FALSE); presenter->EndAction(); } } @@ -141,7 +141,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor) MxDSAction* action = presenter->GetAction(); if (action) { - FUN_100b7220(action, MxDSAction::c_world, FALSE); + ApplyMask(action, MxDSAction::c_world, FALSE); presenter->EndAction(); } } @@ -157,7 +157,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor) MxDSAction* action = presenter->GetAction(); if (action) { - FUN_100b7220(action, MxDSAction::c_world, FALSE); + ApplyMask(action, MxDSAction::c_world, FALSE); presenter->EndAction(); } } diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index 90078e6d..55171729 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -1450,7 +1450,7 @@ void Infocenter::StartCredits() MxDSAction* action = presenter->GetAction(); if (action) { - FUN_100b7220(action, MxDSAction::c_world, FALSE); + ApplyMask(action, MxDSAction::c_world, FALSE); presenter->EndAction(); } } @@ -1466,7 +1466,7 @@ void Infocenter::StartCredits() MxDSAction* action = presenter->GetAction(); if (action) { - FUN_100b7220(action, MxDSAction::c_world, FALSE); + ApplyMask(action, MxDSAction::c_world, FALSE); presenter->EndAction(); } } diff --git a/LEGO1/omni/include/mxutilities.h b/LEGO1/omni/include/mxutilities.h index 51b897b7..8a897e39 100644 --- a/LEGO1/omni/include/mxutilities.h +++ b/LEGO1/omni/include/mxutilities.h @@ -75,7 +75,7 @@ void MakeSourceName(char*, const char*); void OmniError(const char* p_message, MxS32 p_status); void SetOmniUserMessage(void (*p_omniUserMessage)(const char*, MxS32)); MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter); -void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags); +void ApplyMask(MxDSAction* p_action, MxU32 p_mask, MxBool p_setFlags); MxBool KeyValueStringParse(char*, const char*, const char*); // TEMPLATE: BETA10 0x1012dfd0 diff --git a/LEGO1/omni/src/common/mxutilities.cpp b/LEGO1/omni/src/common/mxutilities.cpp index 365d6b18..54714c4d 100644 --- a/LEGO1/omni/src/common/mxutilities.cpp +++ b/LEGO1/omni/src/common/mxutilities.cpp @@ -150,16 +150,16 @@ void SetOmniUserMessage(void (*p_omniUserMessage)(const char*, MxS32)) // FUNCTION: LEGO1 0x100b7220 // FUNCTION: BETA10 0x10136f37 -void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags) +void ApplyMask(MxDSAction* p_action, MxU32 p_mask, MxBool p_setFlags) { MxU32 oldFlags = p_action->GetFlags(); MxU32 newFlags; if (p_setFlags) { - newFlags = oldFlags | p_newFlags; + newFlags = oldFlags | p_mask; } else { - newFlags = oldFlags & ~p_newFlags; + newFlags = oldFlags & ~p_mask; } p_action->SetFlags(newFlags); @@ -169,7 +169,7 @@ void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags) MxDSAction* action; while (cursor.Next(action)) { - FUN_100b7220(action, p_newFlags, p_setFlags); + ApplyMask(action, p_mask, p_setFlags); } } } From 805c57b6aaf2e035388d55edbd22118cb9cea9e3 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Wed, 2 Jul 2025 02:02:03 +0200 Subject: [PATCH 3/3] Clear unknowns in `ViewLOD` (#1599) --- .../legoomni/src/video/legopartpresenter.cpp | 2 +- LEGO1/lego/sources/roi/legolod.cpp | 10 +++++----- LEGO1/lego/sources/roi/legoroi.cpp | 4 ++-- LEGO1/viewmanager/viewlod.h | 16 ++++++++-------- LEGO1/viewmanager/viewmanager.cpp | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp b/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp index f1d55a6d..88e31dd6 100644 --- a/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legopartpresenter.cpp @@ -187,7 +187,7 @@ MxResult LegoPartPresenter::Read(MxDSChunk& p_chunk) } if (j == 0) { - if (surplusLODs != 0 && lod->GetUnknown0x08Test8()) { + if (surplusLODs != 0 && lod->IsExtraLOD()) { numLODs++; surplusLODs--; } diff --git a/LEGO1/lego/sources/roi/legolod.cpp b/LEGO1/lego/sources/roi/legolod.cpp index bf157b56..453a4dac 100644 --- a/LEGO1/lego/sources/roi/legolod.cpp +++ b/LEGO1/lego/sources/roi/legolod.cpp @@ -69,11 +69,11 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text LegoU32 i, indexBackwards, indexForwards, tempNumVertsAndNormals; unsigned char paletteEntries[256]; - if (p_storage->Read(&m_unk0x08, sizeof(undefined4)) != SUCCESS) { + if (p_storage->Read(&m_flags, sizeof(LegoU32)) != SUCCESS) { goto done; } - if (GetUnknown0x08Test4()) { + if (SkipReadingData()) { return SUCCESS; } @@ -84,11 +84,11 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text } if (m_numMeshes == 0) { - ClearFlag(c_bit4); + ClearFlag(c_hasMesh); return SUCCESS; } - SetFlag(c_bit4); + SetFlag(c_hasMesh); m_melems = new Mesh[m_numMeshes]; memset(m_melems, 0, sizeof(*m_melems) * m_numMeshes); @@ -315,7 +315,7 @@ LegoLOD* LegoLOD::Clone(Tgl::Renderer* p_renderer) dupLod->m_melems[i].m_textured = m_melems[i].m_textured; } - dupLod->m_unk0x08 = m_unk0x08; + dupLod->m_flags = m_flags; dupLod->m_numMeshes = m_numMeshes; dupLod->m_numVertices = m_numVertices; dupLod->m_numPolys = m_numPolys; diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index 97baaadf..afd5f711 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -259,7 +259,7 @@ LegoResult LegoROI::Read( } if (j == 0) { - if (surplusLODs != 0 && lod->GetUnknown0x08Test8()) { + if (surplusLODs != 0 && lod->IsExtraLOD()) { numLODs++; } } @@ -276,7 +276,7 @@ LegoResult LegoROI::Read( } if (i == 0) { - if (surplusLODs != 0 && lod->GetUnknown0x08Test8()) { + if (surplusLODs != 0 && lod->IsExtraLOD()) { numLODs++; } } diff --git a/LEGO1/viewmanager/viewlod.h b/LEGO1/viewmanager/viewlod.h index 7bf68b52..b7104526 100644 --- a/LEGO1/viewmanager/viewlod.h +++ b/LEGO1/viewmanager/viewlod.h @@ -14,10 +14,10 @@ class ViewLOD : public LODObject { public: enum { - c_bit4 = 0x10 + c_hasMesh = 0x10 }; - ViewLOD(Tgl::Renderer* pRenderer) : m_meshBuilder(NULL), m_unk0x08(3) {} + ViewLOD(Tgl::Renderer* pRenderer) : m_meshBuilder(NULL), m_flags(3) {} ~ViewLOD() override; // FUNCTION: LEGO1 0x100a6f30 @@ -28,19 +28,19 @@ class ViewLOD : public LODObject { Tgl::MeshBuilder* GetMeshBuilder() { return m_meshBuilder; } const Tgl::MeshBuilder* GetMeshBuilder() const { return m_meshBuilder; } - undefined4 GetUnknown0x08() { return m_unk0x08; } - unsigned char GetUnknown0x08Test4() { return m_unk0x08 & 0xffffff04; } - unsigned char GetUnknown0x08Test8() { return m_unk0x08 & 0xffffff08; } + unsigned int GetFlags() { return m_flags; } + unsigned char SkipReadingData() { return m_flags & 0xffffff04; } + unsigned char IsExtraLOD() { return m_flags & 0xffffff08; } - void SetFlag(unsigned char p_flag) { m_unk0x08 |= p_flag; } - void ClearFlag(unsigned char p_flag) { m_unk0x08 &= ~p_flag; } + void SetFlag(unsigned char p_flag) { m_flags |= p_flag; } + void ClearFlag(unsigned char p_flag) { m_flags &= ~p_flag; } // SYNTHETIC: LEGO1 0x100a6f60 // ViewLOD::`scalar deleting destructor' protected: Tgl::MeshBuilder* m_meshBuilder; // 0x04 - undefined4 m_unk0x08; // 0x08 + unsigned int m_flags; // 0x08 }; #endif // VIEWLOD_H diff --git a/LEGO1/viewmanager/viewmanager.cpp b/LEGO1/viewmanager/viewmanager.cpp index 44635ffd..27919424 100644 --- a/LEGO1/viewmanager/viewmanager.cpp +++ b/LEGO1/viewmanager/viewmanager.cpp @@ -165,7 +165,7 @@ void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_lodLevel) if (lodLevel < 0) { lod = (ViewLOD*) p_roi->GetLOD(p_lodLevel); - if (lod->GetUnknown0x08() & ViewLOD::c_bit4) { + if (lod->GetFlags() & ViewLOD::c_hasMesh) { scene->Add((Tgl::MeshBuilder*) group); SetAppData(p_roi, reinterpret_cast(p_roi)); } @@ -184,7 +184,7 @@ void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_lodLevel) lod = (ViewLOD*) p_roi->GetLOD(p_lodLevel); } - if (lod->GetUnknown0x08() & ViewLOD::c_bit4) { + if (lod->GetFlags() & ViewLOD::c_hasMesh) { meshBuilder = lod->GetMeshBuilder(); if (meshBuilder != NULL) { @@ -389,7 +389,7 @@ inline int ViewManager::GetFirstLODIndex(ViewROI* p_roi) const LODListBase* lods = p_roi->GetLODs(); if (lods != NULL && lods->Size() > 0) { - if (((ViewLOD*) p_roi->GetLOD(0))->GetUnknown0x08Test8()) { + if (((ViewLOD*) p_roi->GetLOD(0))->IsExtraLOD()) { return 1; } else { @@ -404,7 +404,7 @@ inline int ViewManager::GetFirstLODIndex(ViewROI* p_roi) const LODListBase* lods = ((ViewROI*) *it)->GetLODs(); if (lods != NULL && lods->Size() > 0) { - if (((ViewLOD*) ((ViewROI*) *it)->GetLOD(0))->GetUnknown0x08Test8()) { + if (((ViewLOD*) ((ViewROI*) *it)->GetLOD(0))->IsExtraLOD()) { return 1; } else {