diff --git a/LEGO1/lego/legoomni/include/hospital.h b/LEGO1/lego/legoomni/include/hospital.h index 623a4399..4a136568 100644 --- a/LEGO1/lego/legoomni/include/hospital.h +++ b/LEGO1/lego/legoomni/include/hospital.h @@ -16,6 +16,24 @@ class MxStillPresenter; // SIZE 0x18 class HospitalState : public LegoState { public: + enum { + e_exitToClose = 0, + e_newState = 1, + e_unknown3 = 3, + e_unknown4 = 4, + e_introduction = 5, + e_explainQuestShort = 6, + e_explainQuest = 7, + e_waitAcceptingQuest = 8, + e_beforeEnteringAmbulance = 9, + e_unknown10 = 10, // Can never be reached + e_unknown11 = 11, // Can only be reached via e_unknown10 + e_afterAcceptingQuest = 12, + e_exitImmediately = 13, + e_exitToInfocenter = 14, + e_exitToFront = 15, + }; + HospitalState(); ~HospitalState() override {} @@ -40,13 +58,13 @@ class HospitalState : public LegoState { // TODO: Most likely getters/setters are not used according to BETA. - undefined4 m_unk0x08; // 0x08 - MxS16 m_unk0x0c; // 0x0c - MxS16 m_unk0x0e; // 0x0e - MxS16 m_unk0x10; // 0x10 - MxS16 m_unk0x12; // 0x12 - MxS16 m_unk0x14; // 0x14 - MxS16 m_unk0x16; // 0x16 + MxS32 m_state; // 0x08 + MxS16 m_stateActor; // 0x0c + MxS16 m_statePepper; // 0x0e + MxS16 m_stateMama; // 0x10 + MxS16 m_statePapa; // 0x12 + MxS16 m_stateNick; // 0x14 + MxS16 m_stateLaura; // 0x16 }; // VTABLE: LEGO1 0x100d9730 @@ -95,13 +113,13 @@ class Hospital : public LegoWorld { MxS16 m_currentActorId; // 0xf8 LegoGameState::Area m_destLocation; // 0xfc - undefined2 m_unk0x100; // 0x100 + MxU16 m_interactionMode; // 0x100 HospitalState* m_hospitalState; // 0x104 - undefined2 m_unk0x108; // 0x108 + MxU16 m_setWithCurrentAction; // 0x108 HospitalScript::Script m_currentAction; // 0x10c MxStillPresenter* m_copLedBitmap; // 0x110 MxStillPresenter* m_pizzaLedBitmap; // 0x114 - undefined m_unk0x118; // 0x118 + MxBool m_flashingLeds; // 0x118 MxLong m_copLedAnimTimer; // 0x11c MxLong m_pizzaLedAnimTimer; // 0x120 MxLong m_time; // 0x124 diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 03f7d6d1..60f63d4a 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -284,7 +284,7 @@ class LegoAnimationManager : public MxCore { MxLong m_unk0x410; // 0x410 MxU32 m_unk0x414; // 0x414 MxU32 m_numAllowedExtras; // 0x418 - undefined4 m_unk0x41c; // 0x41c + MxU32 m_maxAllowedExtras; // 0x41c AnimState* m_animState; // 0x420 LegoROIList* m_unk0x424; // 0x424 MxBool m_suspendedEnableCamAnims; // 0x428 diff --git a/LEGO1/lego/legoomni/include/legopathboundary.h b/LEGO1/lego/legoomni/include/legopathboundary.h index 522122a4..05d0487c 100644 --- a/LEGO1/lego/legoomni/include/legopathboundary.h +++ b/LEGO1/lego/legoomni/include/legopathboundary.h @@ -39,7 +39,7 @@ class LegoPathBoundary : public LegoWEGEdge { MxResult AddActor(LegoPathActor* p_actor); MxResult RemoveActor(LegoPathActor* p_actor); - void FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor); + void CheckAndCallPathTriggers(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor); void SwitchBoundary( LegoPathActor* p_actor, LegoPathBoundary*& p_boundary, @@ -47,8 +47,8 @@ class LegoPathBoundary : public LegoWEGEdge { float& p_unk0xe4 ); MxU32 Intersect(float p_scale, Vector3& p_point1, Vector3& p_point2, Vector3& p_point3, LegoOrientedEdge*& p_edge); - MxU32 FUN_10057fe0(LegoAnimPresenter* p_presenter); - MxU32 FUN_100586e0(LegoAnimPresenter* p_presenter); + MxU32 AddPresenterIfInRange(LegoAnimPresenter* p_presenter); + MxU32 RemovePresenter(LegoAnimPresenter* p_presenter); // FUNCTION: BETA10 0x1001ffb0 LegoPathActorSet& GetActors() { return m_actors; } diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index 5000ae9d..4632c6b1 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -105,7 +105,7 @@ class LegoPathController : public MxCore { MxResult PlaceActor(LegoPathActor* p_actor); MxResult RemoveActor(LegoPathActor* p_actor); void FUN_100468f0(LegoAnimPresenter* p_presenter); - void FUN_10046930(LegoAnimPresenter* p_presenter); + void RemovePresenterFromBoundaries(LegoAnimPresenter* p_presenter); MxResult FUN_10046b30(LegoPathBoundary*& p_boundaries, MxS32& p_numL); LegoPathBoundary* GetPathBoundary(const char* p_name); void Enable(MxBool p_enable); @@ -189,12 +189,12 @@ class LegoPathController : public MxCore { LegoPathBoundary* m_boundaries; // 0x08 LegoPathCtrlEdge* m_edges; // 0x0c - Mx3DPointFloat* m_unk0x10; // 0x10 + Mx3DPointFloat* m_nodes; // 0x10 LegoPathStruct* m_structs; // 0x14 - MxU16 m_numL; // 0x18 - MxU16 m_numE; // 0x1a - MxU16 m_numN; // 0x1c - MxU16 m_numT; // 0x1e + MxU16 m_numL; // 0x18 Number of boundaries + MxU16 m_numE; // 0x1a Number of edges + MxU16 m_numN; // 0x1c Number of nodes + MxU16 m_numT; // 0x1e Number of structs LegoPathCtrlEdgeSet m_pfsE; // 0x20 LegoPathActorSet m_actors; // 0x30 diff --git a/LEGO1/lego/legoomni/include/legotextureinfo.h b/LEGO1/lego/legoomni/include/legotextureinfo.h index c070bfec..f62295a6 100644 --- a/LEGO1/lego/legoomni/include/legotextureinfo.h +++ b/LEGO1/lego/legoomni/include/legotextureinfo.h @@ -19,7 +19,7 @@ class LegoTextureInfo { static BOOL SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo); static BOOL GetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo*& p_textureInfo); - LegoResult FUN_10066010(const LegoU8* p_bits); + LegoResult LoadBits(const LegoU8* p_bits); // private: char* m_name; // 0x00 diff --git a/LEGO1/lego/legoomni/src/actors/act3actors.cpp b/LEGO1/lego/legoomni/src/actors/act3actors.cpp index 9d2f22a2..6ffffb7b 100644 --- a/LEGO1/lego/legoomni/src/actors/act3actors.cpp +++ b/LEGO1/lego/legoomni/src/actors/act3actors.cpp @@ -244,7 +244,7 @@ void Act3Cop::ParseAction(char* p_extra) } } - Mx4DPointFloat* boundary0x14 = boundary->GetUnknown0x14(); + Mx4DPointFloat* boundary0x14 = boundary->GetUp(); if (point.Dot(point, *boundary0x14) + boundary0x14->index_operator(3) <= 0.001 && point.Dot(point, *boundary0x14) + boundary0x14->index_operator(3) >= -0.001) { diff --git a/LEGO1/lego/legoomni/src/actors/act3ammo.cpp b/LEGO1/lego/legoomni/src/actors/act3ammo.cpp index 663627ae..06330fb2 100644 --- a/LEGO1/lego/legoomni/src/actors/act3ammo.cpp +++ b/LEGO1/lego/legoomni/src/actors/act3ammo.cpp @@ -337,7 +337,7 @@ void Act3Ammo::Animate(float p_time) Vector3 local174(local104[2]); if (IsPizza()) { - local184 = *m_boundary->GetUnknown0x14(); + local184 = *m_boundary->GetUp(); local17c[0] = 1.0f; local17c[1] = local17c[2] = 0.0f; local174.EqualsCross(local17c, local184); @@ -345,7 +345,7 @@ void Act3Ammo::Animate(float p_time) local17c.EqualsCross(local184, local174); } else { - local17c = *m_boundary->GetUnknown0x14(); + local17c = *m_boundary->GetUp(); local184[0] = 1.0f; local184[1] = local184[2] = 0.0f; local174.EqualsCross(local17c, local184); diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index c4dc4623..616be97a 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -502,7 +502,7 @@ void LegoAnimationManager::Init() m_unk0x1a = FALSE; m_tranInfoList = NULL; m_tranInfoList2 = NULL; - m_unk0x41c = g_legoAnimationManagerConfig <= 1 ? 10 : 20; + m_maxAllowedExtras = g_legoAnimationManagerConfig <= 1 ? 10 : 20; MxS32 i; for (i = 0; i < (MxS32) sizeOfArray(m_unk0x28); i++) { @@ -1570,7 +1570,7 @@ MxResult LegoAnimationManager::Tickle() if (elapsedSeconds > 0.2 && m_numAllowedExtras > 2) { m_numAllowedExtras--; } - else if (g_unk0x100f7500 < 0.16 && m_numAllowedExtras < m_unk0x41c) { + else if (g_unk0x100f7500 < 0.16 && m_numAllowedExtras < m_maxAllowedExtras) { m_numAllowedExtras++; } } diff --git a/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp b/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp index dd76ba5e..c13c22ae 100644 --- a/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp @@ -827,7 +827,7 @@ MxResult LegoBuildingManager::FUN_10030630() } if (g_buildingInfo[i].m_boundary != NULL) { - Mx4DPointFloat& unk0x14 = *g_buildingInfo[i].m_boundary->GetUnknown0x14(); + Mx4DPointFloat& unk0x14 = *g_buildingInfo[i].m_boundary->GetUp(); if (position.Dot(position, unk0x14) + unk0x14.index_operator(3) > 0.001 || position.Dot(position, unk0x14) + unk0x14.index_operator(3) < -0.001) { diff --git a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp index beb96c0c..ff5241bb 100644 --- a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp @@ -500,7 +500,7 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key) boundingBox.Max()[0] = g_actorLODs[c_topLOD].m_boundingBox[3]; boundingBox.Max()[1] = g_actorLODs[c_topLOD].m_boundingBox[4]; boundingBox.Max()[2] = g_actorLODs[c_topLOD].m_boundingBox[5]; - roi->SetUnknown0x80(boundingBox); + roi->SetBoundingBox(boundingBox); comp = new CompoundObject(); roi->SetComp(comp); @@ -551,7 +551,7 @@ LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key) childBoundingBox.Max()[0] = g_actorLODs[i + 1].m_boundingBox[3]; childBoundingBox.Max()[1] = g_actorLODs[i + 1].m_boundingBox[4]; childBoundingBox.Max()[2] = g_actorLODs[i + 1].m_boundingBox[5]; - childROI->SetUnknown0x80(childBoundingBox); + childROI->SetBoundingBox(childBoundingBox); CalcLocalTransform( Mx3DPointFloat(g_actorLODs[i + 1].m_position), @@ -1073,7 +1073,7 @@ MxResult LegoCharacterManager::UpdateBoundingSphereAndBox(LegoROI* p_roi) SET3(boundingBox.Min(), min); SET3(boundingBox.Max(), max); - p_roi->SetUnknown0x80(boundingBox); + p_roi->SetBoundingBox(boundingBox); p_roi->WrappedUpdateWorldData(); diff --git a/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp b/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp index 220ae3d6..56e6916e 100644 --- a/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp @@ -160,7 +160,7 @@ MxResult LegoPlantManager::FUN_10026410() } if (g_plantInfo[i].m_boundary != NULL) { - Mx4DPointFloat& unk0x14 = *g_plantInfo[i].m_boundary->GetUnknown0x14(); + Mx4DPointFloat& unk0x14 = *g_plantInfo[i].m_boundary->GetUp(); if (position.Dot(position, unk0x14) + unk0x14.index_operator(3) > 0.001 || position.Dot(position, unk0x14) + unk0x14.index_operator(3) < -0.001) { diff --git a/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp b/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp index 69970b42..943fbbe6 100644 --- a/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp +++ b/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp @@ -186,7 +186,7 @@ BOOL LegoTextureInfo::GetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo*& p_text } // FUNCTION: LEGO1 0x10066010 -LegoResult LegoTextureInfo::FUN_10066010(const LegoU8* p_bits) +LegoResult LegoTextureInfo::LoadBits(const LegoU8* p_bits) { if (m_surface != NULL && m_texture != NULL) { DDSURFACEDESC desc; diff --git a/LEGO1/lego/legoomni/src/common/legoutils.cpp b/LEGO1/lego/legoomni/src/common/legoutils.cpp index 44afeec2..a4f8d022 100644 --- a/LEGO1/lego/legoomni/src/common/legoutils.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutils.cpp @@ -770,6 +770,6 @@ void FUN_1003f930(LegoNamedTexture* p_namedTexture) LegoTextureInfo* textureInfo = TextureContainer()->Get(p_namedTexture->GetName()->GetData()); if (textureInfo != NULL) { - textureInfo->FUN_10066010(p_namedTexture->GetTexture()->GetImage()->GetBits()); + textureInfo->LoadBits(p_namedTexture->GetTexture()->GetImage()->GetBits()); } } diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index c6ae2d92..c0819883 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -369,7 +369,7 @@ void LegoWorld::FUN_1001fe90(LegoAnimPresenter* p_presenter) LegoPathController* controller; while (cursor.Next(controller)) { - controller->FUN_10046930(p_presenter); + controller->RemovePresenterFromBoundaries(p_presenter); } } diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index 7027fa48..7aa4220e 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -35,7 +35,7 @@ DECOMP_SIZE_ASSERT(LegoWorldPresenter, 0x54) MxS32 g_legoWorldPresenterQuality = 1; // GLOBAL: LEGO1 0x100f75d8 -MxLong g_wdbOffset = 0; +MxLong g_wdbSkipGlobalPartsOffset = 0; // FUNCTION: LEGO1 0x100665b0 void LegoWorldPresenter::configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality) @@ -208,7 +208,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world) return FAILURE; } - if (g_wdbOffset == 0) { + if (g_wdbSkipGlobalPartsOffset == 0) { if (fread(&size, sizeof(MxU32), 1, wdbFile) != 1) { return FAILURE; } @@ -248,10 +248,10 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world) delete[] buff; - g_wdbOffset = ftell(wdbFile); + g_wdbSkipGlobalPartsOffset = ftell(wdbFile); } else { - if (fseek(wdbFile, g_wdbOffset, SEEK_SET) != 0) { + if (fseek(wdbFile, g_wdbSkipGlobalPartsOffset, SEEK_SET) != 0) { return FAILURE; } } diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index d366bfbc..292d8214 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -140,7 +140,7 @@ MxResult LegoPathActor::VTable0x88( matrix.SetIdentity(); pos = p1; dir = p4; - up = *m_boundary->GetUnknown0x14(); + up = *m_boundary->GetUp(); if (!m_cameraFlag || !m_userNavFlag) { dir *= -1.0f; @@ -150,7 +150,7 @@ MxResult LegoPathActor::VTable0x88( m_roi->UpdateTransformationRelativeToParent(matrix); if (!m_cameraFlag || !m_userNavFlag) { - p5.EqualsCross(*p_boundary->GetUnknown0x14(), p3); + p5.EqualsCross(*p_boundary->GetUp(), p3); p5.Unitize(); if (VTable0x80(p1, p4, p2, p5) == SUCCESS) { @@ -211,7 +211,7 @@ MxResult LegoPathActor::VTable0x84( matrix.SetIdentity(); pos = p_p1; dir = p_p4; - up = *m_boundary->GetUnknown0x14(); + up = *m_boundary->GetUp(); if (!m_cameraFlag || !m_userNavFlag) { dir *= -1.0f; @@ -220,22 +220,21 @@ MxResult LegoPathActor::VTable0x84( right.EqualsCross(up, dir); m_roi->UpdateTransformationRelativeToParent(matrix); - if (!m_cameraFlag || !m_userNavFlag) { - p5.EqualsCross(*p_boundary->GetUnknown0x14(), p3); - p5.Unitize(); - - if (VTable0x80(p_p1, p_p4, p2, p5) == SUCCESS) { - MxTrace("Warning: m_BADuration = %g, roi = %s\n", m_BADuration, m_roi->GetName()); - m_boundary->AddActor(this); - } - else { - return FAILURE; - } - } - else { + if (m_cameraFlag && m_userNavFlag) { m_boundary->AddActor(this); FUN_10010c30(); } + else { + p5.EqualsCross(*p_boundary->GetUp(), p3); + p5.Unitize(); + + if (VTable0x80(p_p1, p_p4, p2, p5) != SUCCESS) { + MxTrace("Warning: m_BADuration = %g, roi = %s\n", m_BADuration, m_roi->GetName()); + return FAILURE; + } + + m_boundary->AddActor(this); + } m_unk0xec = m_roi->GetLocal2World(); return SUCCESS; @@ -257,7 +256,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform) m_worldSpeed = nav->GetLinearVel(); - if (nav->CalculateNewPosDir(p4, p5, p2, p1, m_boundary->GetUnknown0x14())) { + if (nav->CalculateNewPosDir(p4, p5, p2, p1, m_boundary->GetUp())) { Mx3DPointFloat p6; p6 = p2; MxS32 result = 0; @@ -281,7 +280,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform) result = 0; } else { - m_boundary->FUN_100575b0(p4, p2, this); + m_boundary->CheckAndCallPathTriggers(p4, p2, this); } LegoPathBoundary* oldBoundary = m_boundary; @@ -322,7 +321,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform) Vector3 pos(p_transform[3]); dir = p1; - up = *m_boundary->GetUnknown0x14(); + up = *m_boundary->GetUp(); right.EqualsCross(up, dir); MxS32 res = right.Unitize(); @@ -355,10 +354,10 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform) LegoResult r; if (m_userNavFlag) { - r = m_unk0x8c.FUN_1009a1e0(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUnknown0x14(), 0); + r = m_unk0x8c.FUN_1009a1e0(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUp(), 0); } else { - r = m_unk0x8c.FUN_1009a1e0(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUnknown0x14(), 1); + r = m_unk0x8c.FUN_1009a1e0(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUp(), 1); } assert(r == 0); // SUCCESS @@ -372,7 +371,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform) return 1; } else { - m_boundary->FUN_100575b0(pos2, pos1, this); + m_boundary->CheckAndCallPathTriggers(pos2, pos1, this); pos2 = pos1; } @@ -663,7 +662,7 @@ MxResult LegoPathActor::VTable0x9c() LERP3(local34, v1, v2, m_unk0xe4); m_destEdge->GetFaceNormal(*m_boundary, local78); - local48.EqualsCross(*m_boundary->GetUnknown0x14(), local78); + local48.EqualsCross(*m_boundary->GetUp(), local78); local48.Unitize(); } @@ -671,7 +670,7 @@ MxResult LegoPathActor::VTable0x9c() Vector3 upRef(m_unk0xec[1]); Vector3 dirRef(m_unk0xec[2]); - upRef = *m_boundary->GetUnknown0x14(); + upRef = *m_boundary->GetUp(); rightRef.EqualsCross(upRef, dirRef); rightRef.Unitize(); diff --git a/LEGO1/lego/legoomni/src/paths/legopathboundary.cpp b/LEGO1/lego/legoomni/src/paths/legopathboundary.cpp index cfacbf03..458a79b9 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathboundary.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathboundary.cpp @@ -44,27 +44,27 @@ MxResult LegoPathBoundary::RemoveActor(LegoPathActor* p_actor) // FUNCTION: LEGO1 0x100575b0 // FUNCTION: BETA10 0x100b1598 -void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor) +void LegoPathBoundary::CheckAndCallPathTriggers(Vector3& p_from, Vector3& p_to, LegoPathActor* p_actor) { Vector3* ccwV = NULL; - if (m_numTriggers > 0 && m_unk0x50 != NULL) { + if (m_numTriggers > 0 && m_direction != NULL) { ccwV = m_edges[0]->CCWVertex(*this); Mx3DPointFloat v; - v = p_point1; + v = p_from; v -= *ccwV; - float dot1 = v.Dot(v, *m_unk0x50); + float dot1 = v.Dot(v, *m_direction); - v = p_point2; + v = p_to; v -= *ccwV; - float dot2 = v.Dot(v, *m_unk0x50); + float dot2 = v.Dot(v, *m_direction); if (dot2 > dot1) { for (MxS32 i = 0; i < m_numTriggers; i++) { LegoPathStruct* s = m_pathTrigger[i].m_pathStruct; - if (m_pathTrigger[i].m_unk0x08 >= dot1 && m_pathTrigger[i].m_unk0x08 < dot2) { + if (m_pathTrigger[i].m_triggerLength >= dot1 && m_pathTrigger[i].m_triggerLength < dot2) { s->HandleTrigger(p_actor, TRUE, m_pathTrigger[i].m_data); } } @@ -73,7 +73,7 @@ void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPa for (MxS32 i = 0; i < m_numTriggers; i++) { LegoPathStruct* s = m_pathTrigger[i].m_pathStruct; - if (m_pathTrigger[i].m_unk0x08 >= dot2 && m_pathTrigger[i].m_unk0x08 < dot1) { + if (m_pathTrigger[i].m_triggerLength >= dot2 && m_pathTrigger[i].m_triggerLength < dot1) { s->HandleTrigger(p_actor, FALSE, m_pathTrigger[i].m_data); } } @@ -339,15 +339,15 @@ MxU32 LegoPathBoundary::Intersect( // FUNCTION: LEGO1 0x10057fe0 // FUNCTION: BETA10 0x100b2220 -MxU32 LegoPathBoundary::FUN_10057fe0(LegoAnimPresenter* p_presenter) +MxU32 LegoPathBoundary::AddPresenterIfInRange(LegoAnimPresenter* p_presenter) { Mx3DPointFloat unk0x30; - unk0x30 = m_unk0x30; + unk0x30 = m_centerPoint; unk0x30 -= p_presenter->m_unk0xa8; float len = unk0x30.LenSquared(); - float local20 = p_presenter->m_unk0xa4 + m_unk0x44; + float local20 = p_presenter->m_unk0xa4 + m_boundingRadius; if (len > 0.001 && len > local20 * local20) { return 0; @@ -362,7 +362,7 @@ MxU32 LegoPathBoundary::FUN_10057fe0(LegoAnimPresenter* p_presenter) // FUNCTION: LEGO1 0x100586e0 // FUNCTION: BETA10 0x100b22d1 -MxU32 LegoPathBoundary::FUN_100586e0(LegoAnimPresenter* p_presenter) +MxU32 LegoPathBoundary::RemovePresenter(LegoAnimPresenter* p_presenter) { if (p_presenter != NULL) { // TODO: This only seems to match if the type is not the same as the type of the diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index 4f84883a..93cf0216 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -71,7 +71,7 @@ LegoPathController::LegoPathController() { m_boundaries = NULL; m_edges = NULL; - m_unk0x10 = NULL; + m_nodes = NULL; m_structs = NULL; m_numL = 0; m_numE = 0; @@ -94,7 +94,7 @@ MxResult LegoPathController::Create(MxU8* p_data, const Vector3& p_location, con } for (i = 0; i < m_numN; i++) { - m_unk0x10[i] += p_location; + m_nodes[i] += p_location; } for (i = 0; i < m_numL; i++) { @@ -144,10 +144,10 @@ void LegoPathController::Destroy() m_boundaries = NULL; m_numL = 0; - if (m_unk0x10 != NULL) { - delete[] m_unk0x10; + if (m_nodes != NULL) { + delete[] m_nodes; } - m_unk0x10 = NULL; + m_nodes = NULL; m_numN = 0; if (m_structs != NULL) { @@ -347,17 +347,17 @@ void LegoPathController::FUN_100468f0(LegoAnimPresenter* p_presenter) { for (MxS32 i = 0; i < m_numL; i++) { if (!(m_boundaries[i].m_flags & LegoWEGEdge::c_bit3)) { - m_boundaries[i].FUN_10057fe0(p_presenter); + m_boundaries[i].AddPresenterIfInRange(p_presenter); } } } // FUNCTION: LEGO1 0x10046930 // FUNCTION: BETA10 0x100b737b -void LegoPathController::FUN_10046930(LegoAnimPresenter* p_presenter) +void LegoPathController::RemovePresenterFromBoundaries(LegoAnimPresenter* p_presenter) { for (MxS32 i = 0; i < m_numL; i++) { - m_boundaries[i].FUN_100586e0(p_presenter); + m_boundaries[i].RemovePresenter(p_presenter); } } @@ -471,7 +471,7 @@ MxResult LegoPathController::Read(LegoStorage* p_storage) return FAILURE; } if (m_numN > 0) { - m_unk0x10 = new Mx3DPointFloat[m_numN]; + m_nodes = new Mx3DPointFloat[m_numN]; } if (p_storage->Read(&m_numE, sizeof(MxU16)) != SUCCESS) { @@ -494,7 +494,7 @@ MxResult LegoPathController::Read(LegoStorage* p_storage) if (m_numN > 0) { for (MxS32 i = 0; i < m_numN; i++) { - if (ReadVector(p_storage, m_unk0x10[i]) != SUCCESS) { + if (ReadVector(p_storage, m_nodes[i]) != SUCCESS) { return FAILURE; } } @@ -559,12 +559,12 @@ MxResult LegoPathController::ReadEdges(LegoStorage* p_storage) if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) { return FAILURE; } - edge.m_pointA = &m_unk0x10[s]; + edge.m_pointA = &m_nodes[s]; if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) { return FAILURE; } - edge.m_pointB = &m_unk0x10[s]; + edge.m_pointB = &m_nodes[s]; if (edge.m_flags & LegoOrientedEdge::c_hasFaceA) { if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) { @@ -662,7 +662,7 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage) boundary.m_name[length] = '\0'; } - if (ReadVector(p_storage, boundary.m_unk0x14) != SUCCESS) { + if (ReadVector(p_storage, boundary.m_up) != SUCCESS) { return FAILURE; } @@ -672,11 +672,11 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage) } } - if (ReadVector(p_storage, boundary.m_unk0x30) != SUCCESS) { + if (ReadVector(p_storage, boundary.m_centerPoint) != SUCCESS) { return FAILURE; } - if (p_storage->Read(&boundary.m_unk0x44, sizeof(boundary.m_unk0x44)) != SUCCESS) { + if (p_storage->Read(&boundary.m_boundingRadius, sizeof(boundary.m_boundingRadius)) != SUCCESS) { return FAILURE; } @@ -685,7 +685,7 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage) } if (boundary.m_numTriggers > 0) { - boundary.m_unk0x50 = new Mx3DPointFloat; + boundary.m_direction = new Mx3DPointFloat; boundary.m_pathTrigger = new PathWithTrigger[boundary.m_numTriggers]; for (j = 0; j < boundary.m_numTriggers; j++) { @@ -701,14 +701,14 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage) } if (p_storage->Read( - &boundary.m_pathTrigger[j].m_unk0x08, - sizeof(boundary.m_pathTrigger[j].m_unk0x08) + &boundary.m_pathTrigger[j].m_triggerLength, + sizeof(boundary.m_pathTrigger[j].m_triggerLength) ) != SUCCESS) { return FAILURE; } } - if (ReadVector(p_storage, *boundary.m_unk0x50) != SUCCESS) { + if (ReadVector(p_storage, *boundary.m_direction) != SUCCESS) { return FAILURE; } } @@ -956,7 +956,7 @@ MxS32 LegoPathController::FUN_1004a240( p_v1 *= p_f1; p_v1 += *p_edge->CWVertex(*p_boundary); p_edge->GetFaceNormal(*p_boundary, vec); - p_v2.EqualsCross(*p_boundary->GetUnknown0x14(), vec); + p_v2.EqualsCross(*p_boundary->GetUp(), vec); return 0; } @@ -980,7 +980,7 @@ MxResult LegoPathController::FUN_1004a380( } LegoPathBoundary* b = &m_boundaries[i]; - Mx4DPointFloat* unk0x14 = b->GetUnknown0x14(); + Mx4DPointFloat* unk0x14 = b->GetUp(); float local28 = p_param3[0].Dot(p_param3[0], *unk0x14); if (local28 < 0.001 && local28 > -0.001) { diff --git a/LEGO1/lego/legoomni/src/race/legoracespecial.cpp b/LEGO1/lego/legoomni/src/race/legoracespecial.cpp index a0164d24..d5eb906a 100644 --- a/LEGO1/lego/legoomni/src/race/legoracespecial.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracespecial.cpp @@ -171,7 +171,7 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg m_destEdge->GetFaceNormal(*m_boundary, destEdgeUnknownVector); - crossProduct.EqualsCross(*m_boundary->GetUnknown0x14(), destEdgeUnknownVector); + crossProduct.EqualsCross(*m_boundary->GetUp(), destEdgeUnknownVector); crossProduct.Unitize(); Mx3DPointFloat worldDirection(Vector3(m_roi->GetWorldDirection())); @@ -265,8 +265,8 @@ MxResult LegoCarRaceActor::VTable0x9c() d->GetFaceNormal(*b, point2); m_destEdge->GetFaceNormal(*m_boundary, point3); - point4.EqualsCross(point2, *m_boundary->GetUnknown0x14()); - point5.EqualsCross(*m_boundary->GetUnknown0x14(), point3); + point4.EqualsCross(point2, *m_boundary->GetUp()); + point5.EqualsCross(*m_boundary->GetUp(), point3); point4.Unitize(); point5.Unitize(); @@ -365,7 +365,7 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_ LERP3(a, *v1, *v2, m_unk0xe4); m_destEdge->GetFaceNormal(*m_boundary, bbb); - c.EqualsCross(bbb, *m_boundary->GetUnknown0x14()); + c.EqualsCross(bbb, *m_boundary->GetUp()); c.Unitize(); Mx3DPointFloat worldDirection(m_roi->GetWorldDirection()); diff --git a/LEGO1/lego/legoomni/src/video/legoflctexturepresenter.cpp b/LEGO1/lego/legoomni/src/video/legoflctexturepresenter.cpp index 5d37e829..9aeabf74 100644 --- a/LEGO1/lego/legoomni/src/video/legoflctexturepresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoflctexturepresenter.cpp @@ -64,7 +64,7 @@ void LegoFlcTexturePresenter::LoadFrame(MxStreamChunk* p_chunk) void LegoFlcTexturePresenter::PutFrame() { if (m_texture != NULL && m_rectCount != 0) { - m_texture->FUN_10066010(m_frameBitmap->GetImage()); + m_texture->LoadBits(m_frameBitmap->GetImage()); m_rectCount = 0; } } diff --git a/LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp b/LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp index 397d4318..1a015344 100644 --- a/LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp @@ -114,7 +114,7 @@ void LegoPhonemePresenter::LoadFrame(MxStreamChunk* p_chunk) void LegoPhonemePresenter::PutFrame() { if (m_textureInfo != NULL && m_rectCount != 0) { - m_textureInfo->FUN_10066010(m_frameBitmap->GetImage()); + m_textureInfo->LoadBits(m_frameBitmap->GetImage()); m_rectCount = 0; } } diff --git a/LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp b/LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp index 29e76223..8b6950ac 100644 --- a/LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp @@ -104,7 +104,7 @@ MxResult LegoTexturePresenter::Store() } } else { - textureInfo->FUN_10066010(texture->GetImage()->GetBits()); + textureInfo->LoadBits(texture->GetImage()->GetBits()); } } diff --git a/LEGO1/lego/legoomni/src/worlds/hospital.cpp b/LEGO1/lego/legoomni/src/worlds/hospital.cpp index 25c04ced..86fcd516 100644 --- a/LEGO1/lego/legoomni/src/worlds/hospital.cpp +++ b/LEGO1/lego/legoomni/src/worlds/hospital.cpp @@ -24,7 +24,7 @@ DECOMP_SIZE_ASSERT(Hospital, 0x12c) DECOMP_SIZE_ASSERT(HospitalState, 0x18) // GLOBAL: LEGO1 0x100f7918 -undefined4 g_unk0x100f7918 = 3; +undefined4 g_animationSkipCounter = 3; // GLOBAL: LEGO1 0x100f791c MxBool g_copLedEnabled = FALSE; @@ -36,14 +36,14 @@ MxBool g_pizzaLedEnabled = FALSE; Hospital::Hospital() { m_currentActorId = LegoActor::c_none; - m_unk0x100 = 0; + m_interactionMode = 0; m_hospitalState = NULL; - m_unk0x108 = 0; + m_setWithCurrentAction = 0; m_destLocation = LegoGameState::e_undefined; m_currentAction = HospitalScript::c__StartUp; m_copLedBitmap = NULL; m_pizzaLedBitmap = NULL; - m_unk0x118 = 0; + m_flashingLeds = 0; m_copLedAnimTimer = 0; m_pizzaLedAnimTimer = 0; m_unk0x128 = 0; @@ -61,10 +61,10 @@ Hospital::~Hospital() ControlManager()->Unregister(this); TickleManager()->UnregisterClient(this); - m_hospitalState->m_unk0x08 = 3; + m_hospitalState->m_state = HospitalState::e_unknown3; NotificationManager()->Unregister(this); - g_unk0x100f7918 = 3; + g_animationSkipCounter = 3; } // FUNCTION: LEGO1 0x100748c0 @@ -81,13 +81,13 @@ MxResult Hospital::Create(MxDSAction& p_dsAction) m_hospitalState = (HospitalState*) GameState()->GetState("HospitalState"); if (!m_hospitalState) { m_hospitalState = (HospitalState*) GameState()->CreateState("HospitalState"); - m_hospitalState->m_unk0x08 = 1; + m_hospitalState->m_state = HospitalState::e_newState; } - else if (m_hospitalState->m_unk0x08 == 4) { - m_hospitalState->m_unk0x08 = 4; + else if (m_hospitalState->m_state == HospitalState::e_unknown4) { + m_hospitalState->m_state = HospitalState::e_unknown4; } else { - m_hospitalState->m_unk0x08 = 3; + m_hospitalState->m_state = HospitalState::e_unknown3; } GameState()->m_currentArea = LegoGameState::e_hospital; @@ -149,69 +149,69 @@ void Hospital::ReadyWorld() switch (m_currentActorId) { case LegoActor::c_pepper: - m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x0e; + m_hospitalState->m_stateActor = m_hospitalState->m_statePepper; - if (m_hospitalState->m_unk0x0e < 5) { - m_hospitalState->m_unk0x0e += 1; + if (m_hospitalState->m_statePepper < 5) { + m_hospitalState->m_statePepper += 1; } break; case LegoActor::c_mama: - m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x10; + m_hospitalState->m_stateActor = m_hospitalState->m_stateMama; - if (m_hospitalState->m_unk0x10 < 5) { - m_hospitalState->m_unk0x10 += 1; + if (m_hospitalState->m_stateMama < 5) { + m_hospitalState->m_stateMama += 1; } break; case LegoActor::c_papa: - m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x12; + m_hospitalState->m_stateActor = m_hospitalState->m_statePapa; - if (m_hospitalState->m_unk0x12 < 5) { - m_hospitalState->m_unk0x12 += 1; + if (m_hospitalState->m_statePapa < 5) { + m_hospitalState->m_statePapa += 1; } break; case LegoActor::c_nick: - m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x14; + m_hospitalState->m_stateActor = m_hospitalState->m_stateNick; - if (m_hospitalState->m_unk0x14 < 5) { - m_hospitalState->m_unk0x14 += 1; + if (m_hospitalState->m_stateNick < 5) { + m_hospitalState->m_stateNick += 1; } break; case LegoActor::c_laura: - m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x16; + m_hospitalState->m_stateActor = m_hospitalState->m_stateLaura; - if (m_hospitalState->m_unk0x16 < 5) { - m_hospitalState->m_unk0x16 += 1; + if (m_hospitalState->m_stateLaura < 5) { + m_hospitalState->m_stateLaura += 1; } break; } - if (m_hospitalState->m_unk0x0c < 3) { + if (m_hospitalState->m_stateActor < 3) { HospitalScript::Script hospitalScript[] = { HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho004jk_RunAnim, HospitalScript::c_hho007p1_RunAnim }; - m_hospitalState->m_unk0x08 = 5; + m_hospitalState->m_state = HospitalState::e_introduction; - PlayAction(hospitalScript[m_hospitalState->m_unk0x0c]); - m_currentAction = hospitalScript[m_hospitalState->m_unk0x0c]; - m_unk0x108 = 1; + PlayAction(hospitalScript[m_hospitalState->m_stateActor]); + m_currentAction = hospitalScript[m_hospitalState->m_stateActor]; + m_setWithCurrentAction = 1; } else { - m_unk0x100 = 1; + m_interactionMode = 1; m_time = Timer()->GetTime(); - m_hospitalState->m_unk0x08 = 6; + m_hospitalState->m_state = HospitalState::e_explainQuestShort; PlayAction(HospitalScript::c_hho003cl_RunAnim); m_currentAction = HospitalScript::c_hho003cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; } FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); @@ -222,7 +222,7 @@ MxLong Hospital::HandleKeyPress(MxS8 p_key) { MxLong result = 0; - if (p_key == VK_SPACE && g_unk0x100f7918 == 0) { + if (p_key == VK_SPACE && g_animationSkipCounter == 0) { DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); result = 1; } @@ -241,132 +241,132 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param) return result; } - m_unk0x108 = 0; + m_setWithCurrentAction = 0; - switch (m_hospitalState->m_unk0x08) { - case 5: - m_hospitalState->m_unk0x08 = 7; + switch (m_hospitalState->m_state) { + case HospitalState::e_introduction: + m_hospitalState->m_state = HospitalState::e_explainQuest; PlayAction(HospitalScript::c_hho006cl_RunAnim); m_currentAction = HospitalScript::c_hho006cl_RunAnim; - m_unk0x108 = 1; - m_unk0x118 = 1; - g_unk0x100f7918 = 0; + m_setWithCurrentAction = 1; + m_flashingLeds = 1; + g_animationSkipCounter = 0; break; - case 6: + case HospitalState::e_explainQuestShort: m_time = Timer()->GetTime(); - m_unk0x100 = 1; + m_interactionMode = 1; break; - case 7: - case 10: - m_hospitalState->m_unk0x08 = 8; - m_unk0x100 = 1; + case HospitalState::e_explainQuest: + case HospitalState::e_unknown10: + m_hospitalState->m_state = HospitalState::e_waitAcceptingQuest; + m_interactionMode = 1; m_time = Timer()->GetTime(); break; - case 11: + case HospitalState::e_unknown11: switch (m_currentActorId) { case LegoActor::c_pepper: - switch (m_hospitalState->m_unk0x0e) { + switch (m_hospitalState->m_statePepper) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho017cl_RunAnim); m_currentAction = HospitalScript::c_hho017cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho018cl_RunAnim); m_currentAction = HospitalScript::c_hho018cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; case LegoActor::c_mama: - switch (m_hospitalState->m_unk0x10) { + switch (m_hospitalState->m_stateMama) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho019cl_RunAnim); m_currentAction = HospitalScript::c_hho019cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho020cl_RunAnim); m_currentAction = HospitalScript::c_hho020cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; case LegoActor::c_papa: - switch (m_hospitalState->m_unk0x12) { + switch (m_hospitalState->m_statePapa) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho023cl_RunAnim); m_currentAction = HospitalScript::c_hho023cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho024cl_RunAnim); m_currentAction = HospitalScript::c_hho024cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; case LegoActor::c_nick: - switch (m_hospitalState->m_unk0x14) { + switch (m_hospitalState->m_stateNick) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho021cl_RunAnim); m_currentAction = HospitalScript::c_hho021cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hhoa22cl_RunAnim); m_currentAction = HospitalScript::c_hhoa22cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; case LegoActor::c_laura: - switch (m_hospitalState->m_unk0x16) { + switch (m_hospitalState->m_stateLaura) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho025cl_RunAnim); m_currentAction = HospitalScript::c_hho025cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho026cl_RunAnim); m_currentAction = HospitalScript::c_hho026cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; } break; - case 12: - m_hospitalState->m_unk0x08 = 9; + case HospitalState::e_afterAcceptingQuest: + m_hospitalState->m_state = HospitalState::e_beforeEnteringAmbulance; act1State = (Act1State*) GameState()->GetState("Act1State"); act1State->SetUnknown18(9); - case 14: + case HospitalState::e_exitToFront: if (m_unk0x128 == 0) { m_unk0x128 = 1; m_destLocation = LegoGameState::e_unk31; @@ -375,7 +375,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param) TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } break; - case 15: + case HospitalState::e_exitToInfocenter: if (m_unk0x128 == 0) { m_unk0x128 = 1; m_destLocation = LegoGameState::e_infomain; @@ -395,7 +395,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param) // FUNCTION: BETA10 0x1002d2b1 MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param) { - if (m_unk0x100 == 1) { + if (m_interactionMode == 1) { LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY()); if (roi != NULL) { const LegoChar* roiName = roi->GetName(); @@ -407,15 +407,15 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param) if (!strcmpi("actor_ha", roiName)) { InputManager()->DisableInputProcessing(); - m_unk0x100 = 3; + m_interactionMode = 3; - if (m_hospitalState->m_unk0x08 == 6) { + if (m_hospitalState->m_state == HospitalState::e_explainQuestShort) { if (m_unk0x128 == 0) { m_unk0x128 = 1; TickleManager()->UnregisterClient(this); - m_hospitalState->m_unk0x08 = 9; + m_hospitalState->m_state = HospitalState::e_beforeEnteringAmbulance; Act1State* act1State = (Act1State*) GameState()->GetState("Act1State"); assert(act1State); @@ -430,9 +430,9 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param) TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } } - else if (m_hospitalState->m_unk0x08 == 10 || m_hospitalState->m_unk0x08 == 8) { - if (m_hospitalState->m_unk0x08 == 10) { - m_hospitalState->m_unk0x08 = 11; + else if (m_hospitalState->m_state == HospitalState::e_unknown10 || m_hospitalState->m_state == HospitalState::e_waitAcceptingQuest) { + if (m_hospitalState->m_state == HospitalState::e_unknown10) { + m_hospitalState->m_state = HospitalState::e_unknown11; BackgroundAudioManager()->RaiseVolume(); DeleteObjects( @@ -444,97 +444,97 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param) else { switch (m_currentActorId) { case LegoActor::c_pepper: - switch (m_hospitalState->m_unk0x0e) { + switch (m_hospitalState->m_statePepper) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho017cl_RunAnim); m_currentAction = HospitalScript::c_hho017cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho018cl_RunAnim); m_currentAction = HospitalScript::c_hho018cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; case LegoActor::c_mama: - switch (m_hospitalState->m_unk0x10) { + switch (m_hospitalState->m_stateMama) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho019cl_RunAnim); m_currentAction = HospitalScript::c_hho019cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho020cl_RunAnim); m_currentAction = HospitalScript::c_hho020cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; case LegoActor::c_nick: - switch (m_hospitalState->m_unk0x14) { + switch (m_hospitalState->m_stateNick) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho021cl_RunAnim); m_currentAction = HospitalScript::c_hho021cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hhoa22cl_RunAnim); m_currentAction = HospitalScript::c_hhoa22cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; case LegoActor::c_papa: - switch (m_hospitalState->m_unk0x12) { + switch (m_hospitalState->m_statePapa) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho023cl_RunAnim); m_currentAction = HospitalScript::c_hho023cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho024cl_RunAnim); m_currentAction = HospitalScript::c_hho024cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; case LegoActor::c_laura: - switch (m_hospitalState->m_unk0x16) { + switch (m_hospitalState->m_stateLaura) { case 0: case 1: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho025cl_RunAnim); m_currentAction = HospitalScript::c_hho025cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; default: - m_hospitalState->m_unk0x08 = 12; + m_hospitalState->m_state = HospitalState::e_afterAcceptingQuest; PlayAction(HospitalScript::c_hho026cl_RunAnim); m_currentAction = HospitalScript::c_hho026cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; break; } break; @@ -559,16 +559,16 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param) BackgroundAudioManager()->RaiseVolume(); DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); - if (m_unk0x100 == 1) { - m_hospitalState->m_unk0x08 = 14; + if (m_interactionMode == 1) { + m_hospitalState->m_state = HospitalState::e_exitToInfocenter; PlayAction(HospitalScript::c_hho016cl_RunAnim); m_currentAction = HospitalScript::c_hho016cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; } else if (m_unk0x128 == 0) { m_unk0x128 = 1; - m_hospitalState->m_unk0x08 = 13; + m_hospitalState->m_state = HospitalState::e_exitImmediately; m_destLocation = LegoGameState::e_infomain; DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); @@ -580,16 +580,16 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param) case HospitalScript::c_Door_Ctl: DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); - if (m_unk0x100 == 1) { - m_hospitalState->m_unk0x08 = 15; + if (m_interactionMode == 1) { + m_hospitalState->m_state = HospitalState::e_exitToFront; PlayAction(HospitalScript::c_hho016cl_RunAnim); m_currentAction = HospitalScript::c_hho016cl_RunAnim; - m_unk0x108 = 1; + m_setWithCurrentAction = 1; } else if (m_unk0x128 == 0) { m_unk0x128 = 1; - m_hospitalState->m_unk0x08 = 13; + m_hospitalState->m_state = HospitalState::e_exitImmediately; m_destLocation = LegoGameState::e_unk31; DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); @@ -637,13 +637,13 @@ MxResult Hospital::Tickle() return SUCCESS; } - if (g_unk0x100f7918 != 0) { - g_unk0x100f7918 -= 1; + if (g_animationSkipCounter != 0) { + g_animationSkipCounter -= 1; } MxLong time = Timer()->GetTime(); - if (m_unk0x118 != 0) { + if (m_flashingLeds != 0) { if (time - m_copLedAnimTimer > 300) { m_copLedAnimTimer = time; g_copLedEnabled = !g_copLedEnabled; @@ -664,7 +664,7 @@ MxResult Hospital::Tickle() MxBool Hospital::Escape() { DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, 999); - m_hospitalState->m_unk0x08 = 0; + m_hospitalState->m_state = HospitalState::e_exitToClose; m_destLocation = LegoGameState::e_infomain; @@ -674,12 +674,12 @@ MxBool Hospital::Escape() // FUNCTION: LEGO1 0x10076370 HospitalState::HospitalState() { - m_unk0x0c = 0; - m_unk0x0e = 0; - m_unk0x10 = 0; - m_unk0x12 = 0; - m_unk0x14 = 0; - m_unk0x16 = 0; + m_stateActor = 0; + m_statePepper = 0; + m_stateMama = 0; + m_statePapa = 0; + m_stateNick = 0; + m_stateLaura = 0; } // FUNCTION: LEGO1 0x10076530 @@ -689,20 +689,20 @@ MxResult HospitalState::Serialize(LegoStorage* p_storage) LegoState::Serialize(p_storage); if (p_storage->IsWriteMode()) { - p_storage->WriteS16(m_unk0x0c); - p_storage->WriteS16(m_unk0x0e); - p_storage->WriteS16(m_unk0x10); - p_storage->WriteS16(m_unk0x12); - p_storage->WriteS16(m_unk0x14); - p_storage->WriteS16(m_unk0x16); + p_storage->WriteS16(m_stateActor); + p_storage->WriteS16(m_statePepper); + p_storage->WriteS16(m_stateMama); + p_storage->WriteS16(m_statePapa); + p_storage->WriteS16(m_stateNick); + p_storage->WriteS16(m_stateLaura); } else if (p_storage->IsReadMode()) { - p_storage->ReadS16(m_unk0x0c); - p_storage->ReadS16(m_unk0x0e); - p_storage->ReadS16(m_unk0x10); - p_storage->ReadS16(m_unk0x12); - p_storage->ReadS16(m_unk0x14); - p_storage->ReadS16(m_unk0x16); + p_storage->ReadS16(m_stateActor); + p_storage->ReadS16(m_statePepper); + p_storage->ReadS16(m_stateMama); + p_storage->ReadS16(m_statePapa); + p_storage->ReadS16(m_stateNick); + p_storage->ReadS16(m_stateLaura); } return SUCCESS; diff --git a/LEGO1/lego/sources/geom/legoweedge.cpp b/LEGO1/lego/sources/geom/legoweedge.cpp index c9437456..be522c4c 100644 --- a/LEGO1/lego/sources/geom/legoweedge.cpp +++ b/LEGO1/lego/sources/geom/legoweedge.cpp @@ -20,7 +20,7 @@ LegoWEEdge::~LegoWEEdge() } // FUNCTION: LEGO1 0x1009a5b0 -LegoS32 LegoWEEdge::VTable0x04() +LegoS32 LegoWEEdge::LinkEdgesAndFaces() { for (LegoS32 i = 0; i < m_numEdges; i++) { LegoOrientedEdge* e1 = m_edges[i]; diff --git a/LEGO1/lego/sources/geom/legoweedge.h b/LEGO1/lego/sources/geom/legoweedge.h index 381e4753..4516f938 100644 --- a/LEGO1/lego/sources/geom/legoweedge.h +++ b/LEGO1/lego/sources/geom/legoweedge.h @@ -14,7 +14,7 @@ class LegoWEEdge { LegoWEEdge(); virtual ~LegoWEEdge(); // vtable+0x00 - virtual LegoS32 VTable0x04(); // vtable+0x04 + virtual LegoS32 LinkEdgesAndFaces(); // vtable+0x04 // FUNCTION: BETA10 0x1001c980 LegoU8 GetNumEdges() { return m_numEdges; } diff --git a/LEGO1/lego/sources/geom/legowegedge.cpp b/LEGO1/lego/sources/geom/legowegedge.cpp index b0e27c08..df37ab12 100644 --- a/LEGO1/lego/sources/geom/legowegedge.cpp +++ b/LEGO1/lego/sources/geom/legowegedge.cpp @@ -13,12 +13,12 @@ LegoWEGEdge::LegoWEGEdge() { m_unk0x0d = 0; m_name = NULL; - m_unk0x14.Clear(); + m_up.Clear(); m_edgeNormals = NULL; m_flags = 0; m_numTriggers = 0; m_pathTrigger = NULL; - m_unk0x50 = NULL; + m_direction = NULL; } // FUNCTION: LEGO1 0x1009a800 @@ -37,18 +37,18 @@ LegoWEGEdge::~LegoWEGEdge() if (m_pathTrigger) { delete[] m_pathTrigger; } - if (m_unk0x50) { - delete m_unk0x50; + if (m_direction) { + delete m_direction; } } // FUNCTION: LEGO1 0x1009a8c0 // FUNCTION: BETA10 0x101832f7 -LegoS32 LegoWEGEdge::VTable0x04() +LegoS32 LegoWEGEdge::LinkEdgesAndFaces() { LegoS32 result = 0; - m_unk0x30.Clear(); - LegoWEEdge::VTable0x04(); + m_centerPoint.Clear(); + LegoWEEdge::LinkEdgesAndFaces(); assert(m_numEdges > 1); @@ -72,7 +72,7 @@ LegoS32 LegoWEGEdge::VTable0x04() local14 = m_edges[1]->m_pointB; } - result = FUN_1009aea0(); + result = ValidateFacePlanarity(); if (result != 0) { result = -2; } @@ -86,35 +86,35 @@ LegoS32 LegoWEGEdge::VTable0x04() for (i = 0; i < m_numEdges; i++) { edge = m_edges[i]; - m_unk0x30 += *edge->m_pointA; - m_unk0x30 += *edge->m_pointB; + m_centerPoint += *edge->m_pointA; + m_centerPoint += *edge->m_pointB; } - m_unk0x30 /= m_numEdges * 2; - m_unk0x44 = 0.0f; + m_centerPoint /= m_numEdges * 2; + m_boundingRadius = 0.0f; for (i = 0; i < m_numEdges; i++) { Mx3DPointFloat local44; edge = m_edges[i]; local44 = *edge->m_pointA; - local44 -= m_unk0x30; + local44 -= m_centerPoint; float length = local44.LenSquared(); - if (m_unk0x44 < length) { - m_unk0x44 = length; + if (m_boundingRadius < length) { + m_boundingRadius = length; } local44 = *edge->m_pointB; - local44 -= m_unk0x30; + local44 -= m_centerPoint; length = local44.LenSquared(); - if (m_unk0x44 < length) { - m_unk0x44 = length; + if (m_boundingRadius < length) { + m_boundingRadius = length; } } - m_unk0x44 = sqrt((double) m_unk0x44); + m_boundingRadius = sqrt((double) m_boundingRadius); for (i = 0; i < m_numEdges; i++) { edge = m_edges[i]; @@ -139,10 +139,10 @@ LegoS32 LegoWEGEdge::VTable0x04() Mx3DPointFloat local58; Vector3 local64(&m_edgeNormals[i][0]); edge->GetFaceNormal(*this, local58); - local64.EqualsCross(local58, m_unk0x14); + local64.EqualsCross(local58, m_up); m_edgeNormals[i][3] = -local64.Dot(*m_edges[i]->m_pointA, local64); - if (m_edgeNormals[i][3] + m_unk0x30.Dot(m_unk0x30, local64) < 0.0f) { + if (m_edgeNormals[i][3] + m_centerPoint.Dot(m_centerPoint, local64) < 0.0f) { m_edgeNormals[i] *= -1.0f; } @@ -156,14 +156,14 @@ LegoS32 LegoWEGEdge::VTable0x04() Vector3* vTrig2 = m_edges[1]->CCWVertex(*this); assert(vTrig1 && vTrig2); - m_unk0x50 = new Mx3DPointFloat(); - *m_unk0x50 = *vTrig2; - *m_unk0x50 -= *vTrig1; + m_direction = new Mx3DPointFloat(); + *m_direction = *vTrig2; + *m_direction -= *vTrig1; - if (m_unk0x50->Unitize() < 0) { + if (m_direction->Unitize() < 0) { assert(0); - delete m_unk0x50; - m_unk0x50 = NULL; + delete m_direction; + m_direction = NULL; } if (GetNumEdges() == 4) { @@ -178,12 +178,12 @@ LegoS32 LegoWEGEdge::VTable0x04() localb8 -= *vTrig1; local80 -= *vTrig1; - float locala4 = localb8.Dot(*m_unk0x50, localb8); + float locala4 = localb8.Dot(*m_direction, localb8); if (local98 < locala4) { local98 = locala4; } - locala4 = local80.Dot(*m_unk0x50, local80); + locala4 = local80.Dot(*m_direction, local80); if (locala4 < local9c) { local9c = locala4; } @@ -199,12 +199,12 @@ LegoS32 LegoWEGEdge::VTable0x04() local9c -= 0.001; for (LegoS32 j = 0; j < m_numTriggers; j++) { - if (m_pathTrigger[j].m_unk0x08 < local98) { - m_pathTrigger[j].m_unk0x08 = local98; + if (m_pathTrigger[j].m_triggerLength < local98) { + m_pathTrigger[j].m_triggerLength = local98; } - if (m_pathTrigger[j].m_unk0x08 > local9c) { - m_pathTrigger[j].m_unk0x08 = local9c; + if (m_pathTrigger[j].m_triggerLength > local9c) { + m_pathTrigger[j].m_triggerLength = local9c; } } } @@ -218,7 +218,7 @@ LegoS32 LegoWEGEdge::VTable0x04() // FUNCTION: LEGO1 0x1009aea0 // FUNCTION: BETA10 0x10183e2a -LegoS32 LegoWEGEdge::FUN_1009aea0() +LegoS32 LegoWEGEdge::ValidateFacePlanarity() { LegoU32 localc = FALSE; Mx3DPointFloat local24; @@ -255,17 +255,17 @@ LegoS32 LegoWEGEdge::FUN_1009aea0() local24 /= local58; if (localc) { - float local54 = local24.Dot(m_unk0x14, local24); + float local54 = local24.Dot(m_up, local24); if (local54 < 0.98) { delete[] local8; return -2; } } else { - m_unk0x14[0] = local24[0]; - m_unk0x14[1] = local24[1]; - m_unk0x14[2] = local24[2]; - m_unk0x14[3] = -local8[i]->Dot(*local8[i], local24); + m_up[0] = local24[0]; + m_up[1] = local24[1]; + m_up[2] = local24[2]; + m_up[3] = -local8[i]->Dot(*local8[i], local24); localc = TRUE; } } diff --git a/LEGO1/lego/sources/geom/legowegedge.h b/LEGO1/lego/sources/geom/legowegedge.h index 7ff23c10..c2929079 100644 --- a/LEGO1/lego/sources/geom/legowegedge.h +++ b/LEGO1/lego/sources/geom/legowegedge.h @@ -16,12 +16,12 @@ struct PathWithTrigger { { m_pathStruct = NULL; m_data = 0; - m_unk0x08 = 0.0f; + m_triggerLength = 0.0f; } LegoPathStruct* m_pathStruct; // 0x00 unsigned int m_data; // 0x04 - float m_unk0x08; // 0x08 + float m_triggerLength; // 0x08 }; #include "mxgeometry/mxgeometry3d.h" @@ -42,7 +42,7 @@ class LegoWEGEdge : public LegoWEEdge { LegoWEGEdge(); ~LegoWEGEdge() override; - LegoS32 VTable0x04() override; // vtable+0x04 + LegoS32 LinkEdgesAndFaces() override; // vtable+0x04 // FUNCTION: BETA10 0x100270c0 LegoU32 GetFlag0x10() @@ -57,7 +57,7 @@ class LegoWEGEdge : public LegoWEEdge { // TODO: Other BETA10 reference at 0x1001c9e0, not sure what is going on // FUNCTION: BETA10 0x1001ff80 - Mx4DPointFloat* GetUnknown0x14() { return &m_unk0x14; } + Mx4DPointFloat* GetUp() { return &m_up; } // FUNCTION: BETA10 0x1001ca10 Mx4DPointFloat* GetEdgeNormal(int index) { return &m_edgeNormals[index]; } @@ -85,18 +85,18 @@ class LegoWEGEdge : public LegoWEEdge { friend class LegoPathController; protected: - LegoS32 FUN_1009aea0(); + LegoS32 ValidateFacePlanarity(); LegoU8 m_flags; // 0x0c LegoU8 m_unk0x0d; // 0x0d LegoChar* m_name; // 0x10 - Mx4DPointFloat m_unk0x14; // 0x14 + Mx4DPointFloat m_up; // 0x14 Mx4DPointFloat* m_edgeNormals; // 0x2c - Mx3DPointFloat m_unk0x30; // 0x30 - float m_unk0x44; // 0x44 + Mx3DPointFloat m_centerPoint; // 0x30 + float m_boundingRadius; // 0x44 LegoU8 m_numTriggers; // 0x48 PathWithTrigger* m_pathTrigger; // 0x4c - Mx3DPointFloat* m_unk0x50; // 0x50 + Mx3DPointFloat* m_direction; // 0x50 }; #endif // __LEGOWEGEDGE_H diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index 2dda8762..fd5d3e88 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -150,8 +150,8 @@ LegoResult LegoROI::Read( goto done; } - SET3(m_unk0x80.Min(), box.GetMin()); - SET3(m_unk0x80.Max(), box.GetMax()); + SET3(m_bounding_box.Min(), box.GetMin()); + SET3(m_bounding_box.Max(), box.GetMax()); if (p_storage->Read(&length, sizeof(LegoU32)) != SUCCESS) { goto done; @@ -617,8 +617,8 @@ LegoU32 LegoROI::FUN_100a9410( Mx3DPointFloat local4c(p_v1); - local58 = m_unk0x80.Min(); - locala8 = m_unk0x80.Max(); + local58 = m_bounding_box.Min(); + locala8 = m_bounding_box.Max(); localc0[3] = local9c[3] = local168[3] = 1.0f; diff --git a/LEGO1/lego/sources/roi/legoroi.h b/LEGO1/lego/sources/roi/legoroi.h index 3ba5a472..f3a76899 100644 --- a/LEGO1/lego/sources/roi/legoroi.h +++ b/LEGO1/lego/sources/roi/legoroi.h @@ -78,7 +78,7 @@ class LegoROI : public ViewROI { void SetComp(CompoundObject* p_comp) { comp = p_comp; } void SetBoundingSphere(const BoundingSphere& p_sphere) { m_sphere = m_world_bounding_sphere = p_sphere; } - void SetUnknown0x80(const BoundingBox& p_unk0x80) { m_unk0x80 = p_unk0x80; } + void SetBoundingBox(const BoundingBox& p_box) { m_bounding_box = p_box; } // SYNTHETIC: LEGO1 0x100a82b0 // LegoROI::`scalar deleting destructor' diff --git a/LEGO1/realtime/orientableroi.h b/LEGO1/realtime/orientableroi.h index f3bcc7a9..031c5af7 100644 --- a/LEGO1/realtime/orientableroi.h +++ b/LEGO1/realtime/orientableroi.h @@ -70,7 +70,7 @@ class OrientableROI : public ROI { protected: MxMatrix m_local2world; // 0x10 BoundingBox m_world_bounding_box; // 0x58 - BoundingBox m_unk0x80; // 0x80 + BoundingBox m_bounding_box; // 0x80 BoundingSphere m_world_bounding_sphere; // 0xa8 Mx3DPointFloat m_world_velocity; // 0xc0 OrientableROI* m_parentROI; // 0xd4