diff --git a/LEGO1/lego/legoomni/include/act2actor.h b/LEGO1/lego/legoomni/include/act2actor.h index 324cf4b3..58455e90 100644 --- a/LEGO1/lego/legoomni/include/act2actor.h +++ b/LEGO1/lego/legoomni/include/act2actor.h @@ -14,7 +14,13 @@ class Act2Actor : public LegoAnimActor { MxFloat m_position[3]; // 0x00 MxFloat m_direction[3]; // 0x0c const char* m_boundary; // 0x18 - MxBool m_unk0x1c; // 0x1c + MxBool m_cleared; // 0x1c + }; + + enum VoiceOver { + e_head = 0, + e_behind = 1, + e_interrupt = 2, }; Act2Actor(); @@ -25,7 +31,7 @@ class Act2Actor : public LegoAnimActor { // FUNCTION: LEGO1 0x1001a180 MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override { - if (m_unk0x1f) { + if (m_animatingHit) { return 0; } @@ -35,16 +41,16 @@ class Act2Actor : public LegoAnimActor { void Animate(float p_time) override; // vtable+0x70 MxResult HitActor(LegoPathActor*, MxBool) override; // vtable+0x94 MxResult VTable0x9c() override; // vtable+0x9c - MxS32 VTable0xa0() override; // vtable+0xa0 + MxS32 NextTargetLocation() override; // vtable+0xa0 - void FUN_10018980(); - void FUN_10019250(MxFloat p_speed, MxFloat p_param2); - void FUN_10019520(); - void FUN_10019560(); - MxU32 FUN_10019700(MxFloat p_param); - void FUN_100199f0(MxS8 p_param); - void FUN_100192a0(undefined4 p_location); - LegoEntity* FUN_10019b90(MxBool* p_param); + void InitializeNextShot(); + void SetWorldSpeed(MxFloat p_speed, MxFloat p_resetWorldSpeedAt); + void GoingToHide(); + void Hide(); + MxU32 UpdateShot(MxFloat p_time); + void PlayNextVoiceOver(MxS8 p_voiceOverType); + void FindPath(MxU32 p_location); + LegoEntity* GetNextEntity(MxBool* p_isBuilding); // SYNTHETIC: LEGO1 0x1001a0a0 // Act2Actor::`scalar deleting destructor' @@ -54,22 +60,31 @@ class Act2Actor : public LegoAnimActor { // `vbtable' private: - undefined m_unk0x1c; // 0x1c - MxS8 m_unk0x1d; // 0x1d - undefined m_unk0x1e; // 0x1e - MxBool m_unk0x1f; // 0x1f - MxFloat m_unk0x20; // 0x20 - MxFloat m_unk0x24; // 0x24 - MxS8 m_unk0x28; // 0x28 - MxFloat m_unk0x2c; // 0x2c - MxFloat m_unk0x30; // 0x30 - LegoAnimActorStruct* m_shootAnim; // 0x34 - LegoCacheSound* m_unk0x38; // 0x38 - undefined4 m_unk0x3c; // 0x3c - undefined m_unk0x40; // 0x40 - MxFloat m_unk0x44; // 0x44 - MxS8 m_unk0x48; // 0x48 - LegoEntity* m_unk0x4c; // 0x4c + enum { + e_readyToShoot = 0, + e_endShot = 1, + e_roaming = 2, + e_createdBrick = 3, + e_goingToHide = 4, + e_hiding = 5, + }; + + MxBool m_skipAnimation; // 0x1c + MxS8 m_targetLocation; // 0x1d + MxU8 m_state; // 0x1e + MxBool m_animatingHit; // 0x1f + MxFloat m_animationDuration; // 0x20 + MxFloat m_createBrickTime; // 0x24 + MxS8 m_baseWorldSpeed; // 0x28 + MxFloat m_shootAnimEnd; // 0x2c + MxFloat m_entityAnimationTime; // 0x30 + LegoAnimActorStruct* m_shootAnim; // 0x34 + LegoCacheSound* m_cachedShootSound; // 0x38 + undefined4 m_unk0x3c; // 0x3c + MxBool m_initializing; // 0x40 + MxFloat m_resetWorldSpeedAt; // 0x44 + MxS8 m_visitedLocations; // 0x48 + LegoEntity* m_nextEntity; // 0x4c }; // TEMPLATE: LEGO1 0x100194f0 diff --git a/LEGO1/lego/legoomni/include/act3.h b/LEGO1/lego/legoomni/include/act3.h index 9172a6cc..ffba305b 100644 --- a/LEGO1/lego/legoomni/include/act3.h +++ b/LEGO1/lego/legoomni/include/act3.h @@ -106,7 +106,7 @@ class Act3 : public LegoWorld { MxResult Tickle() override; // vtable+0x08 // FUNCTION: LEGO1 0x10072500 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x10072510 // FUNCTION: BETA10 0x10017550 diff --git a/LEGO1/lego/legoomni/include/elevatorbottom.h b/LEGO1/lego/legoomni/include/elevatorbottom.h index ad1fe29f..2db42ec5 100644 --- a/LEGO1/lego/legoomni/include/elevatorbottom.h +++ b/LEGO1/lego/legoomni/include/elevatorbottom.h @@ -18,7 +18,7 @@ class ElevatorBottom : public LegoWorld { MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x10017f10 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x10017f20 // FUNCTION: BETA10 0x10028130 diff --git a/LEGO1/lego/legoomni/include/gasstation.h b/LEGO1/lego/legoomni/include/gasstation.h index 10a825ac..f87aeb6e 100644 --- a/LEGO1/lego/legoomni/include/gasstation.h +++ b/LEGO1/lego/legoomni/include/gasstation.h @@ -77,7 +77,7 @@ class GasStation : public LegoWorld { MxResult Tickle() override; // vtable+0x08 // FUNCTION: LEGO1 0x10004770 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x10004780 // FUNCTION: BETA10 0x10029d40 diff --git a/LEGO1/lego/legoomni/include/hospital.h b/LEGO1/lego/legoomni/include/hospital.h index be198776..d6401be9 100644 --- a/LEGO1/lego/legoomni/include/hospital.h +++ b/LEGO1/lego/legoomni/include/hospital.h @@ -79,7 +79,7 @@ class Hospital : public LegoWorld { MxResult Tickle() override; // vtable+0x08 // FUNCTION: LEGO1 0x100746a0 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x100746b0 // FUNCTION: BETA10 0x1002e1a0 diff --git a/LEGO1/lego/legoomni/include/infocenter.h b/LEGO1/lego/legoomni/include/infocenter.h index 8c4f8aa9..ca1525c5 100644 --- a/LEGO1/lego/legoomni/include/infocenter.h +++ b/LEGO1/lego/legoomni/include/infocenter.h @@ -141,7 +141,7 @@ class Infocenter : public LegoWorld { MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18 void ReadyWorld() override; // vtable+0x50 - MxBool VTable0x5c() override; // vtable+0x5c + MxBool WaitForTransition() override; // vtable+0x5c MxBool Escape() override; // vtable+0x64 void Enable(MxBool p_enable) override; // vtable+0x68 diff --git a/LEGO1/lego/legoomni/include/infocenterdoor.h b/LEGO1/lego/legoomni/include/infocenterdoor.h index c9bb841b..4612cb1b 100644 --- a/LEGO1/lego/legoomni/include/infocenterdoor.h +++ b/LEGO1/lego/legoomni/include/infocenterdoor.h @@ -17,7 +17,7 @@ class InfocenterDoor : public LegoWorld { MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x100377a0 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x100377b0 // FUNCTION: BETA10 0x10032790 diff --git a/LEGO1/lego/legoomni/include/isle.h b/LEGO1/lego/legoomni/include/isle.h index 8d76e78d..eafec8fe 100644 --- a/LEGO1/lego/legoomni/include/isle.h +++ b/LEGO1/lego/legoomni/include/isle.h @@ -134,7 +134,7 @@ class Isle : public LegoWorld { MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x10030900 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x10030910 // FUNCTION: BETA10 0x10035d70 diff --git a/LEGO1/lego/legoomni/include/jukebox.h b/LEGO1/lego/legoomni/include/jukebox.h index e7a36668..1709e869 100644 --- a/LEGO1/lego/legoomni/include/jukebox.h +++ b/LEGO1/lego/legoomni/include/jukebox.h @@ -60,7 +60,7 @@ class JukeBox : public LegoWorld { MxResult Tickle() override; // vtable+0x08 // FUNCTION: LEGO1 0x1005d6e0 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x1005d6f0 // FUNCTION: BETA10 0x100388d0 diff --git a/LEGO1/lego/legoomni/include/legoact2.h b/LEGO1/lego/legoomni/include/legoact2.h index 23d05fae..d27f92d8 100644 --- a/LEGO1/lego/legoomni/include/legoact2.h +++ b/LEGO1/lego/legoomni/include/legoact2.h @@ -71,7 +71,7 @@ class LegoAct2 : public LegoWorld { void ReadyWorld() override; // vtable+0x50 // FUNCTION: LEGO1 0x1004fe10 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c void VTable0x60() override; // vtable+0x60 MxBool Escape() override; // vtable+0x64 @@ -80,10 +80,10 @@ class LegoAct2 : public LegoWorld { void SetUnknown0x1138(Act2Actor* p_unk0x1138) { m_unk0x1138 = p_unk0x1138; } void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; } - MxResult FUN_100516b0(); + MxResult CreateBrick(); void FUN_100517b0(); MxResult BadEnding(); - MxResult FUN_10052560( + MxResult StartAction( Act2mainScript::Script p_objectId, MxBool p_param2, MxBool p_param3, @@ -96,48 +96,65 @@ class LegoAct2 : public LegoWorld { // LegoAct2::`scalar deleting destructor' private: + enum { + e_initial = 0, + e_startSpeech = 1, + e_holdingSpeech = 2, + e_startDescription = 3, + e_explaining = 4, + e_goingToResidentialArea = 5, + e_atResidentialArea = 6, + e_chase = 7, + e_droppingBrick = 9, + e_goingToHide = 10, + e_hidden = 11, + e_distributeRemainingBricks = 12, + e_brickHunt = 13, + e_allPiecesCollected = 14, + }; + MxLong HandleEndAction(MxEndActionNotificationParam& p_param); MxLong HandleTransitionEnd(); MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param); void PlayMusic(JukeboxScript::Script p_objectId); void FUN_10051900(); - void FUN_10051960(); + void HideMaPaInfo(); void InitBricks(); void UninitBricks(); void SpawnBricks(); - void FUN_10051fa0(MxS32 p_param1); - void FUN_100521f0(MxS32 p_param1); - MxResult FUN_10052800(); + void CheckBricksterDestroying(MxS32 p_pathData); + void CheckBricksterIsLoose(MxS32 p_pathData); + MxResult InitializeShooting(); Act2Brick m_bricks[10]; // 0x00f8 MxU8 m_nextBrick; // 0x10c0 - undefined m_unk0x10c1; // 0x10c1 + MxU8 m_removedBricks; // 0x10c1 MxBool m_ready; // 0x10c2 - undefined4 m_unk0x10c4; // 0x10c4 + undefined4 m_state; // 0x10c4 JukeboxScript::Script m_music; // 0x10c8 LegoAct2State* m_gameState; // 0x10cc - MxS32 m_unk0x10d0; // 0x10d0 + MxS32 m_timeSinceLastStage; // 0x10d0 // variable name verified by BETA10 0x10014633 const char* m_siFile; // 0x10d4 - LegoROI* m_pepper; // 0x10d8 - MxMatrix m_unk0x10dc; // 0x10dc - LegoPathBoundary* m_unk0x1124; // 0x1124 - LegoROI* m_ambulance; // 0x1128 - undefined4 m_unk0x112c; // 0x112c - undefined4 m_unk0x1130; // 0x1130 - undefined4 m_unk0x1134; // 0x1134 - Act2Actor* m_unk0x1138; // 0x1138 - undefined m_unk0x113c; // 0x113c - Act2mainScript::Script m_unk0x1140; // 0x1140 - Act2mainScript::Script m_unk0x1144; // 0x1144 - undefined4 m_unk0x1148; // 0x1148 - undefined m_firstBrick; // 0x114c - undefined m_secondBrick; // 0x114d - undefined m_thirdBrick; // 0x114e - undefined m_fourthBrick; // 0x114e - LegoGameState::Area m_destLocation; // 0x1150 + LegoROI* m_pepper; // 0x10d8 + MxMatrix m_transformOnDisable; // 0x10dc + LegoPathBoundary* m_boundaryOnDisable; // 0x1124 + LegoROI* m_ambulance; // 0x1128 + undefined4 m_unk0x112c; // 0x112c + undefined4 m_unk0x1130; // 0x1130 + undefined4 m_unk0x1134; // 0x1134 + Act2Actor* m_unk0x1138; // 0x1138 + undefined m_unk0x113c; // 0x113c + Act2mainScript::Script m_currentAction; // 0x1140 + Act2mainScript::Script m_infomanDirecting; // 0x1144 + undefined4 m_unk0x1148; // 0x1148 + undefined m_firstBrick; // 0x114c + undefined m_secondBrick; // 0x114d + undefined m_thirdBrick; // 0x114e + undefined m_fourthBrick; // 0x114e + LegoGameState::Area m_destLocation; // 0x1150 }; #endif // LEGOACT2_H diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 4b764d0b..2d82a45b 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -232,7 +232,7 @@ class LegoAnimationManager : public MxCore { MxBool FUN_100623a0(AnimInfo& p_info); MxBool ModelExists(AnimInfo& p_info, const char* p_name); void FUN_10062580(AnimInfo& p_info); - MxBool FUN_10062650(Vector3& p_position, float p_und, LegoROI* p_roi); + MxBool FUN_10062650(Mx3DPointFloat& p_position, float p_und, LegoROI* p_roi); MxBool FUN_10062710(AnimInfo& p_info); MxBool FUN_10062e20(LegoROI* p_roi, LegoAnimPresenter* p_presenter); void FUN_10063950(LegoROI* p_roi); diff --git a/LEGO1/lego/legoomni/include/legocarbuild.h b/LEGO1/lego/legoomni/include/legocarbuild.h index e15f8598..cb7270c7 100644 --- a/LEGO1/lego/legoomni/include/legocarbuild.h +++ b/LEGO1/lego/legoomni/include/legocarbuild.h @@ -22,11 +22,11 @@ class MxActionNotificationParam; class LegoVehicleBuildState : public LegoState { public: enum AnimationState { - e_unknown0 = 0, + e_none = 0, e_entering = 1, - e_unknown2 = 2, + e_settingUpMovie = 2, e_cutscene = 3, - e_unknown4 = 4, + e_finishedBuild = 4, e_exiting = 6 }; @@ -59,9 +59,9 @@ class LegoVehicleBuildState : public LegoState { MxString m_className; // 0x38 AnimationState m_animationState; // 0x48 - MxU8 m_unk0x4c; // 0x4c - MxBool m_unk0x4d; // 0x4d - MxBool m_unk0x4e; // 0x4e + MxU8 m_introductionCounter; // 0x4c + MxBool m_finishedBuild; // 0x4d + MxBool m_playedExitScript; // 0x4e MxU8 m_placedPartCount; // 0x4f }; @@ -96,7 +96,7 @@ class LegoCarBuild : public LegoWorld { // FUNCTION: LEGO1 0x10022930 // FUNCTION: BETA10 0x10070070 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x10022940 // FUNCTION: BETA10 0x10070090 diff --git a/LEGO1/lego/legoomni/include/legocarbuildpresenter.h b/LEGO1/lego/legoomni/include/legocarbuildpresenter.h index 31423e32..f20738b6 100644 --- a/LEGO1/lego/legoomni/include/legocarbuildpresenter.h +++ b/LEGO1/lego/legoomni/include/legocarbuildpresenter.h @@ -21,10 +21,10 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter { }; // SIZE 0x0c - struct UnknownListEntry { + struct CarBuildPart { // FUNCTION: LEGO1 0x100795c0 // FUNCTION: BETA10 0x10073850 - UnknownListEntry() + CarBuildPart() { m_name = NULL; m_wiredName = NULL; @@ -74,7 +74,7 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter { virtual MxResult Serialize(LegoStorage* p_storage); - void FUN_10079050(MxS16 p_index); + void MakePartPlaced(MxS16 p_index); void SwapNodesByName(LegoChar* p_param1, LegoChar* p_param2); void InitBuildPlatform(); void HideBuildPartByName(LegoChar* p_param); @@ -83,7 +83,7 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter { LegoTreeNode* FindNodeByName(LegoTreeNode* p_treeNode, const LegoChar* p_name); void AddPartToBuildByName(const LegoChar* p_name); void RotateAroundYAxis(MxFloat p_angle); - MxBool FUN_10079c30(const LegoChar* p_name); + MxBool IsNextPartToPlace(const LegoChar* p_name); MxBool PartIsPlaced(const LegoChar* p_name); void MoveShelfForward(); MxBool StringEqualsPlatform(const LegoChar* p_string); @@ -102,7 +102,7 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter { MxBool StringEndsOnW(LegoChar* p_param); MxBool StringEndsOnYOrN(const LegoChar* p_string); - const BoundingSphere& FUN_10079e20(); + const BoundingSphere& GetTargetBoundingSphere(); // FUNCTION: BETA10 0x100703e0 const LegoChar* GetWiredNameOfLastPlacedPart() { return m_parts[m_placedPartCount].m_wiredName; } @@ -121,7 +121,7 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter { // LegoCarBuildAnimPresenter::`scalar deleting destructor' private: - void Beta10Inline0x100733d0(); + void UpdateFlashingPartVisibility(); MxU16 m_shelfState; // 0xbc @@ -136,16 +136,16 @@ class LegoCarBuildAnimPresenter : public LegoAnimPresenter { MxMatrix m_buildViewMatrix; // 0xe0 // variable name verified by BETA10 0x100719f0 - UnknownListEntry* m_parts; // 0x128 + CarBuildPart* m_parts; // 0x128 - MxFloat m_shelfFrameBuffer; // 0x12c - MxFloat m_shelfFrame; // 0x130 - MxFloat m_shelfFrameMax; // 0x134 - MxFloat m_shelfFrameInterval; // 0x138 - MxULong m_unk0x13c; // 0x13c - LegoEntity* m_carBuildEntity; // 0x140 - MxS32 m_unk0x144; // 0x144 - MxS32 m_unk0x148; // 0x148 + MxFloat m_shelfFrameBuffer; // 0x12c + MxFloat m_shelfFrame; // 0x130 + MxFloat m_shelfFrameMax; // 0x134 + MxFloat m_shelfFrameInterval; // 0x138 + MxULong m_flashingPartTimeState; // 0x13c + LegoEntity* m_carBuildEntity; // 0x140 + MxS32 m_unk0x144; // 0x144 + MxS32 m_unk0x148; // 0x148 // name verified by BETA10 0x10070d63 LegoChar* m_mainSourceId; // 0x14c diff --git a/LEGO1/lego/legoomni/include/legoinputmanager.h b/LEGO1/lego/legoomni/include/legoinputmanager.h index 04ac7294..f8a4bb0a 100644 --- a/LEGO1/lego/legoomni/include/legoinputmanager.h +++ b/LEGO1/lego/legoomni/include/legoinputmanager.h @@ -129,14 +129,13 @@ class LegoInputManager : public MxPresenter { void SetWorld(LegoWorld* p_world); void ClearWorld(); - void SetUnknown88(MxBool p_unk0x88) { m_unk0x88 = p_unk0x88; } void SetUnknown335(MxBool p_unk0x335) { m_unk0x335 = p_unk0x335; } void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; } - // FUNCTION: BETA10 0x1002e290 + // FUNCTION: BETA10 0x1002e390 void DisableInputProcessing() { - m_unk0x88 = TRUE; + m_inputProcessingDisabled = TRUE; m_unk0x336 = FALSE; } @@ -192,7 +191,7 @@ class LegoInputManager : public MxPresenter { MxBool m_unk0x80; // 0x80 MxBool m_unk0x81; // 0x81 LegoControlManager* m_controlManager; // 0x84 - MxBool m_unk0x88; // 0x88 + MxBool m_inputProcessingDisabled; // 0x88 const bool* m_keyboardState; MxBool m_unk0x195; // 0x195 MxBool m_unk0x335; // 0x335 diff --git a/LEGO1/lego/legoomni/include/legopathactor.h b/LEGO1/lego/legoomni/include/legopathactor.h index 8df0e9db..2f1d8862 100644 --- a/LEGO1/lego/legoomni/include/legopathactor.h +++ b/LEGO1/lego/legoomni/include/legopathactor.h @@ -99,7 +99,7 @@ class LegoPathActor : public LegoActor { // FUNCTION: LEGO1 0x10002d60 // FUNCTION: BETA10 0x1000f820 - virtual MxS32 VTable0xa0() { return 0; } // vtable+0xa0 + virtual MxS32 NextTargetLocation() { return 0; } // vtable+0xa0 virtual void VTable0xa4(MxBool& p_und1, MxS32& p_und2); // vtable+0xa4 virtual void VTable0xa8(); // vtable+0xa8 diff --git a/LEGO1/lego/legoomni/include/legorace.h b/LEGO1/lego/legoomni/include/legorace.h index e1b93211..8c9c1fe2 100644 --- a/LEGO1/lego/legoomni/include/legorace.h +++ b/LEGO1/lego/legoomni/include/legorace.h @@ -153,7 +153,7 @@ class LegoRace : public LegoWorld { } // FUNCTION: LEGO1 0x1000dae0 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c void Enable(MxBool p_enable) override; // vtable+0x68 diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index 11e5e667..9e96973d 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -47,18 +47,18 @@ class LegoWorld : public LegoEntity { LegoWorld(); ~LegoWorld() override; // vtable+0x00 - MxLong Notify(MxParam& p_param) override; // vtable+0x04 - MxResult Tickle() override; // vtable+0x08 - MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18 - void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c - virtual void ReadyWorld(); // vtable+0x50 - virtual LegoCameraController* VTable0x54(); // vtable+0x54 - virtual void Add(MxCore* p_object); // vtable+0x58 + MxLong Notify(MxParam& p_param) override; // vtable+0x04 + MxResult Tickle() override; // vtable+0x08 + MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18 + void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c + virtual void ReadyWorld(); // vtable+0x50 + virtual LegoCameraController* InitializeCameraController(); // vtable+0x54 + virtual void Add(MxCore* p_object); // vtable+0x58 // The BETA10 match could also be LegoWorld::Escape(), only the child classes might be able to tell // FUNCTION: LEGO1 0x1001d670 // FUNCTION: BETA10 0x10017530 - virtual MxBool VTable0x5c() { return FALSE; } // vtable+0x5c + virtual MxBool WaitForTransition() { return FALSE; } // vtable+0x5c // FUNCTION: LEGO1 0x100010a0 virtual void VTable0x60() {} // vtable+0x60 @@ -102,8 +102,8 @@ class LegoWorld : public LegoEntity { ); void RemoveActor(LegoPathActor* p_actor); MxBool ActorExists(LegoPathActor* p_actor); - void FUN_1001fda0(LegoAnimPresenter* p_presenter); - void FUN_1001fe90(LegoAnimPresenter* p_presenter); + void AddPresenterIfInRange(LegoAnimPresenter* p_presenter); + void RemovePresenterFromBoundaries(LegoAnimPresenter* p_presenter); LegoPathBoundary* FindPathBoundary(const char* p_name); void AddPath(LegoPathController* p_controller); MxResult GetCurrPathInfo(LegoPathBoundary** p_boundaries, MxS32& p_numL); @@ -115,7 +115,7 @@ class LegoWorld : public LegoEntity { LegoEntityList* GetEntityList() { return m_entityList; } LegoOmni::World GetWorldId() { return m_worldId; } - MxBool GetUnknown0xd0Empty() { return m_set0xd0.empty(); } + MxBool NoDisabledObjects() { return m_disabledObjects.empty(); } list& GetROIList() { return m_roiList; } LegoHideAnimPresenter* GetHideAnimPresenter() { return m_hideAnim; } @@ -131,9 +131,9 @@ class LegoWorld : public LegoEntity { LegoEntityList* m_entityList; // 0x9c LegoCacheSoundList* m_cacheSoundList; // 0xa0 MxBool m_destroyed; // 0xa4 - MxCoreSet m_set0xa8; // 0xa8 + MxCoreSet m_objects; // 0xa8 MxPresenterList m_controlPresenters; // 0xb8 - MxCoreSet m_set0xd0; // 0xd0 + MxCoreSet m_disabledObjects; // 0xd0 list m_roiList; // 0xe0 LegoOmni::World m_worldId; // 0xec diff --git a/LEGO1/lego/legoomni/include/police.h b/LEGO1/lego/legoomni/include/police.h index 8d8d7840..12395cbc 100644 --- a/LEGO1/lego/legoomni/include/police.h +++ b/LEGO1/lego/legoomni/include/police.h @@ -65,7 +65,7 @@ class Police : public LegoWorld { MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x1005e1d0 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x1005e1e0 // FUNCTION: BETA10 0x100f0c50 diff --git a/LEGO1/lego/legoomni/include/registrationbook.h b/LEGO1/lego/legoomni/include/registrationbook.h index c49d6bec..c8c0c703 100644 --- a/LEGO1/lego/legoomni/include/registrationbook.h +++ b/LEGO1/lego/legoomni/include/registrationbook.h @@ -55,12 +55,12 @@ class RegistrationBook : public LegoWorld { struct { MxS16 m_letters[7]; // 0x00 MxS16 m_cursorPos; // 0x0e - } m_unk0x280; // 0x280 + } m_newName; // 0x280 MxControlPresenter* m_checkmark[10]; // 0x290 - undefined2 m_unk0x2b8; // 0x2b8 + undefined2 m_vehiclesToPosition; // 0x2b8 InfocenterState* m_infocenterState; // 0x2bc undefined m_unk0x2c0; // 0x2c0 - undefined m_unk0x2c1; // 0x2c1 + undefined m_awaitLoad; // 0x2c1 undefined m_unk0x2c2[0x02]; // 0x2c2 LPDIRECTDRAWSURFACE m_checkboxHilite; // 0x2c4 LPDIRECTDRAWSURFACE m_checkboxSurface; // 0x2c8 @@ -72,9 +72,9 @@ class RegistrationBook : public LegoWorld { MxLong HandleKeyPress(SDL_Keycode p_key); MxLong HandleControl(LegoControlManagerNotificationParam& p_param); MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param); - void FUN_100775c0(MxS16 p_playerIndex); + void LoadSave(MxS16 p_checkMarkIndex); void WriteInfocenterLetters(MxS16); - void FUN_100778c0(); + void LoadVehicles(); MxBool CreateSurface(); }; diff --git a/LEGO1/lego/legoomni/include/score.h b/LEGO1/lego/legoomni/include/score.h index 36252f6f..f2e453a5 100644 --- a/LEGO1/lego/legoomni/include/score.h +++ b/LEGO1/lego/legoomni/include/score.h @@ -60,7 +60,7 @@ class Score : public LegoWorld { MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x100010b0 - MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c + MxBool WaitForTransition() override { return TRUE; } // vtable+0x5c // FUNCTION: LEGO1 0x100010c0 // FUNCTION: BETA10 0x100f4f20 diff --git a/LEGO1/lego/legoomni/src/actors/act2actor.cpp b/LEGO1/lego/legoomni/src/actors/act2actor.cpp index 4062fef1..d35b8196 100644 --- a/LEGO1/lego/legoomni/src/actors/act2actor.cpp +++ b/LEGO1/lego/legoomni/src/actors/act2actor.cpp @@ -36,99 +36,101 @@ Act2Actor::Location g_brickstrLocations[] = { {{26.470566, 0.069, -44.670845}, {0.004602, 0.0, -0.99998897}, "int26", FALSE}, {{-6.323625, 0.069, -47.96045}, {-0.982068, 0.0, 0.188529}, "edg02_53", FALSE}, {{-36.689, -0.978409, 31.449}, {0.083792, -0.94303, -0.66398698}, "edg00_157", FALSE}, +#ifndef BETA10 {{-44.6, 0.1, 45.3}, {0.95, 0.0, -0.3}, "edg00_154", FALSE}, +#endif }; // GLOBAL: LEGO1 0x100f0f1c -MxFloat g_unk0x100f0f1c = 0.0f; +MxFloat g_lastAnimationTime = 0.0f; // GLOBAL: LEGO1 0x100f0f20 // GLOBAL: BETA10 0x101dbe40 -MxBool g_unk0x100f0f20 = FALSE; +MxBool g_nextEntityIsBuilding = FALSE; // GLOBAL: LEGO1 0x100f0f24 MxBool g_unk0x100f0f24 = FALSE; // GLOBAL: LEGO1 0x100f0f28 // GLOBAL: BETA10 0x101dbe44 -MxBool g_unk0x100f0f28 = FALSE; +MxBool g_playedShootSound = FALSE; // --- All of these are indices into g_plantInfo (0x10103180) --- // GLOBAL: LEGO1 0x100f0f30 // GLOBAL: BETA10 0x101dbe48 -MxS32 g_stage0Plants[] = {2, 23, 32, 66, 71, 72, 73, -1}; +MxS32 g_location0Plants[] = {2, 23, 32, 66, 71, 72, 73, -1}; // GLOBAL: LEGO1 0x100f0f50 // GLOBAL: BETA10 0x101dbe68 -MxS32 g_stage1Plants[] = {0, 7, 16, 18, 20, 21, 34, 49, 58, 59, 63, 65, 69, 74, -1}; +MxS32 g_location1Plants[] = {0, 7, 16, 18, 20, 21, 34, 49, 58, 59, 63, 65, 69, 74, -1}; // GLOBAL: LEGO1 0x100f0f90 // GLOBAL: BETA10 0x101dbea8 -MxS32 g_stage2Plants[] = {12, 19, 24, 48, 60, -1}; +MxS32 g_location2Plants[] = {12, 19, 24, 48, 60, -1}; // GLOBAL: LEGO1 0x100f0fa8 // GLOBAL: BETA10 0x101dbec0 -MxS32 g_stage3Plants[] = {8, 15, 46, -1}; +MxS32 g_location3Plants[] = {8, 15, 46, -1}; // GLOBAL: LEGO1 0x100f0fb8 // GLOBAL: BETA10 0x101dbed0 -MxS32 g_stage4Plants[] = {25, 26, 28, 29, 38, 39, 42, 50, 51, 56, -1}; +MxS32 g_location4Plants[] = {25, 26, 28, 29, 38, 39, 42, 50, 51, 56, -1}; // GLOBAL: LEGO1 0x100f0fe8 // GLOBAL: BETA10 0x101dbf00 -MxS32 g_stage5Plants[] = {3, 40, 53, 55, -1}; +MxS32 g_location5Plants[] = {3, 40, 53, 55, -1}; // GLOBAL: LEGO1 0x100f1000 // GLOBAL: BETA10 0x101dbf18 -MxS32 g_stage6Plants[] = {22, 33, 41, 45, 67, -1}; +MxS32 g_location6Plants[] = {22, 33, 41, 45, 67, -1}; // GLOBAL: LEGO1 0x100f1018 // GLOBAL: BETA10 0x101dbf30 -MxS32 g_stage7Plants[] = {13, 30, 31, 62, -1}; +MxS32 g_location7Plants[] = {13, 30, 31, 62, -1}; // GLOBAL: LEGO1 0x100f1030 // GLOBAL: BETA10 0x101dbf48 -MxS32 g_stage8Plants[] = {1, 27, 37, 44, 47, 54, 61, 64, -1}; +MxS32 g_location8Plants[] = {1, 27, 37, 44, 47, 54, 61, 64, -1}; // --- End of indices into g_plantInfo --- // GLOBAL: LEGO1 0x10102b1c // GLOBAL: BETA10 0x10209f60 -undefined4 g_nextHeadWavIndex = 0; +MxU32 g_nextHeadWavIndex = 0; // GLOBAL: LEGO1 0x10102b20 // GLOBAL: BETA10 0x10209f64 -undefined4 g_nextBehindWavIndex = 0; +MxU32 g_nextBehindWavIndex = 0; // GLOBAL: LEGO1 0x10102b24 // GLOBAL: BETA10 0x10209f68 -undefined4 g_nextInterruptWavIndex = 0; +MxU32 g_nextInterruptWavIndex = 0; // FUNCTION: LEGO1 0x100187e0 // FUNCTION: BETA10 0x1000c7fb Act2Actor::Act2Actor() { - m_unk0x1c = 0; - m_unk0x1d = 0; - m_unk0x1f = FALSE; - m_unk0x24 = 0; - m_unk0x20 = 0; - m_unk0x1e = 0; - m_unk0x28 = 4; - m_unk0x2c = 0; - m_unk0x30 = 0; + m_skipAnimation = FALSE; + m_targetLocation = 0; + m_animatingHit = FALSE; + m_createBrickTime = 0; + m_animationDuration = 0; + m_state = e_readyToShoot; + m_baseWorldSpeed = 4; + m_shootAnimEnd = 0; + m_entityAnimationTime = 0; m_shootAnim = NULL; - m_unk0x44 = 0; - m_unk0x40 = 1; - m_unk0x48 = 0; - m_unk0x4c = NULL; - m_unk0x38 = NULL; + m_resetWorldSpeedAt = 0; + m_initializing = TRUE; + m_visitedLocations = 0; + m_nextEntity = NULL; + m_cachedShootSound = NULL; m_unk0x3c = 0; // Odd: The code says < 10, but there are 11 entries in the array for (MxS32 i = 0; i < 10; i++) { - g_brickstrLocations[i].m_unk0x1c = FALSE; + g_brickstrLocations[i].m_cleared = FALSE; } } @@ -141,7 +143,7 @@ void Act2Actor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) // FUNCTION: LEGO1 0x10018980 // FUNCTION: BETA10 0x1000c963 -void Act2Actor::FUN_10018980() +void Act2Actor::InitializeNextShot() { for (MxS32 i = 0; i < m_animMaps.size(); i++) { if (m_animMaps[i]->GetWorldSpeed() == -1.0f) { @@ -151,14 +153,14 @@ void Act2Actor::FUN_10018980() assert(m_shootAnim); - m_unk0x38 = SoundManager()->GetCacheSoundManager()->FindSoundByKey("xarrow"); + m_cachedShootSound = SoundManager()->GetCacheSoundManager()->FindSoundByKey("xarrow"); #ifdef BETA10 // actually 0x2c and 0x30 - m_unk0x38 = SoundManager()->GetCacheSoundManager()->FindSoundByKey("bcrash"); - m_unk0x38->SetDistance(35, 60); - m_unk0x38->SetDistance(35, 60); + m_cachedShootSound = SoundManager()->GetCacheSoundManager()->FindSoundByKey("bcrash"); + m_cachedShootSound->SetDistance(35, 60); + m_cachedShootSound->SetDistance(35, 60); #else - m_unk0x38->SetDistance(45, 55); + m_cachedShootSound->SetDistance(45, 55); m_roi->SetVisibility(TRUE); #endif } @@ -167,9 +169,9 @@ void Act2Actor::FUN_10018980() // FUNCTION: BETA10 0x1000ca64 MxResult Act2Actor::HitActor(LegoPathActor*, MxBool) { - if (m_unk0x1f == FALSE) { - m_unk0x1f = TRUE; - m_unk0x20 = 0; + if (m_animatingHit == FALSE) { + m_animatingHit = TRUE; + m_animationDuration = 0; } SoundManager()->GetCacheSoundManager()->Play("hitactor", NULL, FALSE); @@ -185,7 +187,7 @@ MxResult Act2Actor::VTable0x9c() return SUCCESS; } else { - if (m_unk0x1f) { + if (m_animatingHit) { MxMatrix matrix = m_roi->GetLocal2World(); matrix[3][1] -= 3.0f; m_roi->UpdateTransformationRelativeToParent(matrix); @@ -207,28 +209,28 @@ void Act2Actor::Animate(float p_time) int dummy1; // for BETA10, not sure what it is being used for #ifndef BETA10 - MxFloat local48float = 0.0f; - if (g_unk0x100f0f1c != 0.0f) { - local48float = p_time - g_unk0x100f0f1c; + MxFloat timeSinceLastAnimate = 0.0f; + if (g_lastAnimationTime != 0.0f) { + timeSinceLastAnimate = p_time - g_lastAnimationTime; } - g_unk0x100f0f1c = p_time; + g_lastAnimationTime = p_time; #endif LegoAnimActor::Animate(p_time); - if (m_unk0x44 != 0.0f && m_unk0x44 < p_time) { - SetWorldSpeed(m_unk0x28); + if (m_resetWorldSpeedAt != 0.0f && m_resetWorldSpeedAt < p_time) { + SetWorldSpeed(m_baseWorldSpeed); } - if (m_unk0x1f) { - if (m_unk0x20 > 600.0f) { - m_unk0x1f = FALSE; - m_unk0x20 = 0; + if (m_animatingHit) { + if (m_animationDuration > 600.0f) { + m_animatingHit = FALSE; + m_animationDuration = 0; } else { #ifndef BETA10 - m_unk0x20 += local48float; + m_animationDuration += timeSinceLastAnimate; #endif MxMatrix matrix = m_roi->GetLocal2World(); matrix[3][1] += 3.0f; @@ -245,41 +247,41 @@ void Act2Actor::Animate(float p_time) } if (!m_grec) { - if (m_unk0x1e == 2) { - m_unk0x1e = 0; - m_unk0x2c = m_shootAnim->GetDuration() + p_time; - m_unk0x30 = m_unk0x2c - 1300.0f; + if (m_state == e_roaming) { + m_state = e_readyToShoot; + m_shootAnimEnd = m_shootAnim->GetDuration() + p_time; + m_entityAnimationTime = m_shootAnimEnd - 1300.0f; SetWorldSpeed(0); - m_unk0x1c = FALSE; + m_skipAnimation = FALSE; } - else if (m_unk0x1e == 1) { + else if (m_state == e_endShot) { FindROI("pwrbrik")->SetVisibility(FALSE); FindROI("debrick")->SetVisibility(FALSE); FindROI("ray")->SetVisibility(FALSE); - m_unk0x4c = NULL; - m_unk0x1e = 2; - VTable0xa0(); - FUN_10019250(m_unk0x28 + 3, p_time + 3000.0f); + m_nextEntity = NULL; + m_state = e_roaming; + NextTargetLocation(); + SetWorldSpeed(m_baseWorldSpeed + 3, p_time + 3000.0f); } - else if (m_unk0x1e == 0) { - if (m_unk0x40) { - m_unk0x40 = 0; - m_unk0x2c = m_shootAnim->GetDuration() + p_time; - m_unk0x30 = m_unk0x2c - 1300.0f; + else if (m_state == e_readyToShoot) { + if (m_initializing) { + m_initializing = FALSE; + m_shootAnimEnd = m_shootAnim->GetDuration() + p_time; + m_entityAnimationTime = m_shootAnimEnd - 1300.0f; } - if (FUN_10019700(p_time) == TRUE) { + if (UpdateShot(p_time) == TRUE) { return; } } - else if (m_unk0x1e == 5) { + else if (m_state == e_hiding) { FindROI("brickstr")->SetVisibility(FALSE); GetROI()->SetVisibility(FALSE); CurrentWorld()->RemoveActor(this); return; } #ifndef BETA10 - else if (m_unk0x1e == 4) { + else if (m_state == e_goingToHide) { if (m_worldSpeed == 0.0f) { return; } @@ -291,14 +293,14 @@ void Act2Actor::Animate(float p_time) #endif } - if (m_unk0x1e == 5 || m_unk0x1e == 4) { + if (m_state == e_hiding || m_state == e_goingToHide) { return; } - if (m_unk0x1e == 3) { - if (p_time - m_unk0x24 > 600.0f) { - m_unk0x1e = 2; - FUN_10019250(m_unk0x28 + 4, p_time + 15000.0f); + if (m_state == e_createdBrick) { + if (p_time - m_createBrickTime > 600.0f) { + m_state = e_roaming; + SetWorldSpeed(m_baseWorldSpeed + 4, p_time + 15000.0f); } } else { @@ -323,38 +325,38 @@ void Act2Actor::Animate(float p_time) const MxFloat* pepperWorldPosition = roiPepper->GetWorldPosition(); const MxFloat* worldPosition = m_roi->GetWorldPosition(); - MxFloat distance1 = DISTSQRD3(pepperWorldPosition, worldPosition); + MxFloat distanceToAmbulance = DISTSQRD3(pepperWorldPosition, worldPosition); - if (distance1 < 75.0f) { - if (!m_unk0x1c) { - m_unk0x1c = 1; + if (distanceToAmbulance < 75.0f) { + if (!m_skipAnimation) { + m_skipAnimation = TRUE; - if (!m_unk0x1e) { - FUN_100199f0(2); - m_unk0x1e = 1; + if (!m_state) { + PlayNextVoiceOver(VoiceOver::e_interrupt); + m_state = e_endShot; } else { LegoROI* childROI = m_roi->FindChildROI("windsd", m_roi); const MxFloat* childPosition = childROI->GetWorldPosition(); - MxFloat distance2 = DISTSQRD3(pepperWorldPosition, childPosition); + MxFloat distanceToWindshield = DISTSQRD3(pepperWorldPosition, childPosition); childROI = m_roi->FindChildROI("reardr", m_roi); childPosition = childROI->GetWorldPosition(); - MxFloat distance3 = DISTSQRD3(pepperWorldPosition, childPosition); + MxFloat distanceToRearDoor = DISTSQRD3(pepperWorldPosition, childPosition); - if (distance3 > distance2) { - FUN_100199f0(0); + if (distanceToRearDoor > distanceToWindshield) { + PlayNextVoiceOver(VoiceOver::e_head); } else #ifndef BETA10 - if (p_time - m_unk0x24 > 3000.0f) { + if (p_time - m_createBrickTime > 3000.0f) { #endif - SetWorldSpeed(m_unk0x28 - 1); - m_unk0x1e = 3; - m_unk0x24 = p_time; + SetWorldSpeed(m_baseWorldSpeed - 1); + m_state = e_createdBrick; + m_createBrickTime = p_time; - if (((LegoAct2*) CurrentWorld())->FUN_100516b0() == SUCCESS) { - FUN_100199f0(1); + if (((LegoAct2*) CurrentWorld())->CreateBrick() == SUCCESS) { + PlayNextVoiceOver(VoiceOver::e_behind); } #ifndef BETA10 } @@ -363,8 +365,8 @@ void Act2Actor::Animate(float p_time) } } else { - if (m_unk0x1c) { - m_unk0x1c = 0; + if (m_skipAnimation) { + m_skipAnimation = FALSE; } } } @@ -375,11 +377,11 @@ void Act2Actor::Animate(float p_time) // FUNCTION: LEGO1 0x10019250 // FUNCTION: BETA10 0x1000d45c -void Act2Actor::FUN_10019250(MxFloat p_speed, MxFloat p_param2) +void Act2Actor::SetWorldSpeed(MxFloat p_speed, MxFloat p_resetWorldSpeedAt) { // The arguments have been changed from BETA10 to LEGO1 SetWorldSpeed(p_speed); - m_unk0x44 = p_param2; + m_resetWorldSpeedAt = p_resetWorldSpeedAt; } // FUNCTION: LEGO1 0x10019280 @@ -387,12 +389,12 @@ void Act2Actor::FUN_10019250(MxFloat p_speed, MxFloat p_param2) void Act2Actor::SetWorldSpeed(MxFloat p_worldSpeed) { LegoAnimActor::SetWorldSpeed(p_worldSpeed); - m_unk0x44 = 0; + m_resetWorldSpeedAt = 0; } // FUNCTION: LEGO1 0x100192a0 // FUNCTION: BETA10 0x1000d4d6 -void Act2Actor::FUN_100192a0(undefined4 p_location) +void Act2Actor::FindPath(MxU32 p_location) { Mx3DPointFloat newPosition(0.0, 0.0, 0.0); Mx3DPointFloat newDirection(0.0, 0.0, 0.0); @@ -429,37 +431,37 @@ void Act2Actor::FUN_100192a0(undefined4 p_location) } // FUNCTION: LEGO1 0x10019520 -void Act2Actor::FUN_10019520() +void Act2Actor::GoingToHide() { - m_unk0x1e = 4; - SetWorldSpeed(m_unk0x28 + 3); - FUN_100192a0(10); + m_state = e_goingToHide; + SetWorldSpeed(m_baseWorldSpeed + 3); + FindPath(10); } // FUNCTION: LEGO1 0x10019560 -void Act2Actor::FUN_10019560() +void Act2Actor::Hide() { - m_unk0x1e = 5; - SetWorldSpeed(m_unk0x28 + 5); - FUN_100192a0(9); + m_state = e_hiding; + SetWorldSpeed(m_baseWorldSpeed + 5); + FindPath(9); } // FUNCTION: LEGO1 0x100195a0 // FUNCTION: BETA10 0x1000d7d3 -MxS32 Act2Actor::VTable0xa0() +MxS32 Act2Actor::NextTargetLocation() { - undefined4 newLocation; + MxU32 newLocation; assert(!m_grec); CurrentWorld(); MxU16 randomVal = 1 + SDL_rand(2); - if (m_unk0x48 == 8 && m_unk0x1d != 8) { + if (m_visitedLocations == 8 && m_targetLocation != 8) { newLocation = 8; } else { - switch (m_unk0x1d) { + switch (m_targetLocation) { case 0: if (randomVal == 1) { newLocation = 3; @@ -534,10 +536,10 @@ MxS32 Act2Actor::VTable0xa0() } } - undefined4 firstChoice = newLocation; + MxU32 firstChoice = newLocation; - if (m_unk0x48 < 7 || g_brickstrLocations[m_unk0x1d].m_unk0x1c) { - while (g_brickstrLocations[newLocation].m_unk0x1c || m_unk0x1d == newLocation) { + if (m_visitedLocations < 7 || g_brickstrLocations[m_targetLocation].m_cleared) { + while (g_brickstrLocations[newLocation].m_cleared || m_targetLocation == newLocation) { if (newLocation == 7) { newLocation = 0; } @@ -549,8 +551,8 @@ MxS32 Act2Actor::VTable0xa0() } } - m_unk0x1d = newLocation; - FUN_100192a0(newLocation); + m_targetLocation = newLocation; + FindPath(newLocation); if (m_grec) { return SUCCESS; @@ -562,64 +564,64 @@ MxS32 Act2Actor::VTable0xa0() // FUNCTION: LEGO1 0x10019700 // FUNCTION: BETA10 0x1000dd27 -MxU32 Act2Actor::FUN_10019700(MxFloat p_param) +MxU32 Act2Actor::UpdateShot(MxFloat p_time) { - if (!m_unk0x4c) { - g_unk0x100f0f20 = FALSE; - m_unk0x4c = FUN_10019b90(&g_unk0x100f0f20); + if (!m_nextEntity) { + g_nextEntityIsBuilding = FALSE; + m_nextEntity = GetNextEntity(&g_nextEntityIsBuilding); g_unk0x100f0f24 = FALSE; - g_unk0x100f0f28 = FALSE; + g_playedShootSound = FALSE; } - if (!m_unk0x4c) { - MxTrace("nothing left to destroy at location %d\n", m_unk0x1d); - m_unk0x1e = 1; + if (!m_nextEntity) { + MxTrace("nothing left to destroy at location %d\n", m_targetLocation); + m_state = e_endShot; - if (m_unk0x1d == 8) { + if (m_targetLocation == 8) { ((LegoAct2*) CurrentWorld())->BadEnding(); } return TRUE; } - if (!g_unk0x100f0f28 && m_unk0x30 < p_param) { - g_unk0x100f0f28 = TRUE; + if (!g_playedShootSound && m_entityAnimationTime < p_time) { + g_playedShootSound = TRUE; assert(SoundManager()->GetCacheSoundManager()); - SoundManager()->GetCacheSoundManager()->Play(m_unk0x38, "brickstr", FALSE); + SoundManager()->GetCacheSoundManager()->Play(m_cachedShootSound, "brickstr", FALSE); - if (g_unk0x100f0f20) { - BuildingManager()->ScheduleAnimation(m_unk0x4c, 800, TRUE, FALSE); + if (g_nextEntityIsBuilding) { + BuildingManager()->ScheduleAnimation(m_nextEntity, 800, TRUE, FALSE); } else { - PlantManager()->ScheduleAnimation(m_unk0x4c, 800); + PlantManager()->ScheduleAnimation(m_nextEntity, 800); } } - if (m_unk0x2c < p_param) { - g_unk0x100f0f20 = FALSE; - m_unk0x4c = FUN_10019b90(&g_unk0x100f0f20); - m_unk0x2c = m_shootAnim->GetDuration() + p_param; - m_unk0x30 = m_unk0x2c - 1300.0f; + if (m_shootAnimEnd < p_time) { + g_nextEntityIsBuilding = FALSE; + m_nextEntity = GetNextEntity(&g_nextEntityIsBuilding); + m_shootAnimEnd = m_shootAnim->GetDuration() + p_time; + m_entityAnimationTime = m_shootAnimEnd - 1300.0f; g_unk0x100f0f24 = FALSE; - g_unk0x100f0f28 = FALSE; + g_playedShootSound = FALSE; return FALSE; } - m_lastTime = p_param; + m_lastTime = p_time; LegoROI* brickstrROI = FindROI("brickstr"); - MxMatrix matrix = m_roi->GetLocal2World(); - matrix[3][1] += 1.0f; - brickstrROI->SetLocal2World(matrix); + MxMatrix initialTransform = m_roi->GetLocal2World(); + initialTransform[3][1] += 1.0f; + brickstrROI->SetLocal2World(initialTransform); brickstrROI->WrappedUpdateWorldData(); - Vector3 col0(matrix[0]); - Vector3 col1(matrix[1]); - Vector3 col2(matrix[2]); - Vector3 col3(matrix[3]); + Vector3 col0(initialTransform[0]); + Vector3 col1(initialTransform[1]); + Vector3 col2(initialTransform[2]); + Vector3 col3(initialTransform[3]); col2 = col3; - col2 -= m_unk0x4c->GetROI()->GetWorldPosition(); + col2 -= m_nextEntity->GetROI()->GetWorldPosition(); col2.Unitize(); col0.EqualsCross(col1, col2); col0.Unitize(); @@ -628,10 +630,10 @@ MxU32 Act2Actor::FUN_10019700(MxFloat p_param) assert(!m_cameraFlag); LegoTreeNode* root = m_shootAnim->GetAnimTreePtr()->GetRoot(); - MxFloat time = p_param - (m_unk0x2c - m_shootAnim->GetDuration()); + MxFloat time = p_time - (m_shootAnimEnd - m_shootAnim->GetDuration()); for (MxS32 i = 0; i < root->GetNumChildren(); i++) { - LegoROI::ApplyAnimationTransformation(root->GetChild(i), matrix, time, m_shootAnim->GetROIMap()); + LegoROI::ApplyAnimationTransformation(root->GetChild(i), initialTransform, time, m_shootAnim->GetROIMap()); } return FALSE; @@ -639,68 +641,68 @@ MxU32 Act2Actor::FUN_10019700(MxFloat p_param) // FUNCTION: LEGO1 0x100199f0 // FUNCTION: BETA10 0x1000e11a -void Act2Actor::FUN_100199f0(MxS8 p_param) +void Act2Actor::PlayNextVoiceOver(MxS8 p_voiceOverType) { - switch (p_param) { - case 0: + switch (p_voiceOverType) { + case VoiceOver::e_head: switch (g_nextHeadWavIndex) { case 0: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VOhead0_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VOhead0_PlayWav, FALSE, FALSE, NULL, NULL, NULL); g_nextHeadWavIndex++; break; default: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VOhead1_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VOhead1_PlayWav, FALSE, FALSE, NULL, NULL, NULL); g_nextHeadWavIndex = 0; break; } break; - case 1: + case VoiceOver::e_behind: switch (g_nextBehindWavIndex) { case 0: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VObehind0_PlayWav, FALSE, TRUE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VObehind0_PlayWav, FALSE, TRUE, NULL, NULL, NULL); g_nextBehindWavIndex++; break; case 1: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VObehind1_PlayWav, FALSE, TRUE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VObehind1_PlayWav, FALSE, TRUE, NULL, NULL, NULL); g_nextBehindWavIndex++; break; case 2: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VObehind2_PlayWav, FALSE, TRUE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VObehind2_PlayWav, FALSE, TRUE, NULL, NULL, NULL); g_nextBehindWavIndex++; break; default: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VObehind3_PlayWav, FALSE, TRUE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VObehind3_PlayWav, FALSE, TRUE, NULL, NULL, NULL); g_nextBehindWavIndex = 0; break; } break; - case 2: + case VoiceOver::e_interrupt: switch (g_nextInterruptWavIndex) { case 0: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VOinterrupt0_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VOinterrupt0_PlayWav, FALSE, FALSE, NULL, NULL, NULL); g_nextInterruptWavIndex++; break; case 1: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VOinterrupt1_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VOinterrupt1_PlayWav, FALSE, FALSE, NULL, NULL, NULL); g_nextInterruptWavIndex++; break; case 2: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VOinterrupt2_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VOinterrupt2_PlayWav, FALSE, FALSE, NULL, NULL, NULL); g_nextInterruptWavIndex++; break; default: ((LegoAct2*) CurrentWorld()) - ->FUN_10052560(Act2mainScript::c_VOinterrupt3_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + ->StartAction(Act2mainScript::c_VOinterrupt3_PlayWav, FALSE, FALSE, NULL, NULL, NULL); g_nextInterruptWavIndex = 0; break; } @@ -709,27 +711,27 @@ void Act2Actor::FUN_100199f0(MxS8 p_param) // FUNCTION: LEGO1 0x10019b90 // FUNCTION: BETA10 0x1000e374 -LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) +LegoEntity* Act2Actor::GetNextEntity(MxBool* p_isBuilding) { MxS32 i; LegoBuildingInfo* buildingInfo = BuildingManager()->GetInfoArray(i); LegoPlantInfo* plantInfo = PlantManager()->GetInfoArray(i); LegoEntity* result = 0; - switch (m_unk0x1d) { + switch (m_targetLocation) { case 0: if (buildingInfo[12].m_counter) { result = buildingInfo[12].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else if (buildingInfo[14].m_counter) { result = buildingInfo[14].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else { - for (i = 0; g_stage0Plants[i] != -1; i++) { - if (plantInfo[g_stage0Plants[i]].m_counter) { - result = plantInfo[g_stage0Plants[i]].m_entity; + for (i = 0; g_location0Plants[i] != -1; i++) { + if (plantInfo[g_location0Plants[i]].m_counter) { + result = plantInfo[g_location0Plants[i]].m_entity; break; } } @@ -738,12 +740,12 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) case 1: if (buildingInfo[13].m_counter) { result = buildingInfo[13].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else { - for (i = 0; g_stage1Plants[i] != -1; i++) { - if (plantInfo[g_stage1Plants[i]].m_counter) { - result = plantInfo[g_stage1Plants[i]].m_entity; + for (i = 0; g_location1Plants[i] != -1; i++) { + if (plantInfo[g_location1Plants[i]].m_counter) { + result = plantInfo[g_location1Plants[i]].m_entity; break; } } @@ -752,16 +754,16 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) case 2: if (buildingInfo[9].m_counter) { result = buildingInfo[9].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else if (buildingInfo[11].m_counter) { result = buildingInfo[11].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else { - for (i = 0; g_stage2Plants[i] != -1; i++) { - if (plantInfo[g_stage2Plants[i]].m_counter) { - result = plantInfo[g_stage2Plants[i]].m_entity; + for (i = 0; g_location2Plants[i] != -1; i++) { + if (plantInfo[g_location2Plants[i]].m_counter) { + result = plantInfo[g_location2Plants[i]].m_entity; break; } } @@ -770,20 +772,20 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) case 3: if (buildingInfo[7].m_counter) { result = buildingInfo[7].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else if (buildingInfo[8].m_counter) { result = buildingInfo[8].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else if (buildingInfo[3].m_counter) { result = buildingInfo[3].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else { - for (i = 0; g_stage3Plants[i] != -1; i++) { - if (plantInfo[g_stage3Plants[i]].m_counter) { - result = plantInfo[g_stage3Plants[i]].m_entity; + for (i = 0; g_location3Plants[i] != -1; i++) { + if (plantInfo[g_location3Plants[i]].m_counter) { + result = plantInfo[g_location3Plants[i]].m_entity; break; } } @@ -792,16 +794,16 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) case 4: if (buildingInfo[5].m_counter) { result = buildingInfo[5].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else if (buildingInfo[10].m_counter) { result = buildingInfo[10].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else { - for (i = 0; g_stage4Plants[i] != -1; i++) { - if (plantInfo[g_stage4Plants[i]].m_counter) { - result = plantInfo[g_stage4Plants[i]].m_entity; + for (i = 0; g_location4Plants[i] != -1; i++) { + if (plantInfo[g_location4Plants[i]].m_counter) { + result = plantInfo[g_location4Plants[i]].m_entity; break; } } @@ -810,12 +812,12 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) case 5: if (buildingInfo[4].m_counter) { result = buildingInfo[4].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else { - for (i = 0; g_stage5Plants[i] != -1; i++) { - if (plantInfo[g_stage5Plants[i]].m_counter) { - result = plantInfo[g_stage5Plants[i]].m_entity; + for (i = 0; g_location5Plants[i] != -1; i++) { + if (plantInfo[g_location5Plants[i]].m_counter) { + result = plantInfo[g_location5Plants[i]].m_entity; break; } } @@ -824,12 +826,12 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) case 6: if (buildingInfo[2].m_counter) { result = buildingInfo[2].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else { - for (i = 0; g_stage6Plants[i] != -1; i++) { - if (plantInfo[g_stage6Plants[i]].m_counter) { - result = plantInfo[g_stage6Plants[i]].m_entity; + for (i = 0; g_location6Plants[i] != -1; i++) { + if (plantInfo[g_location6Plants[i]].m_counter) { + result = plantInfo[g_location6Plants[i]].m_entity; break; } } @@ -838,21 +840,21 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) case 7: if (buildingInfo[6].m_counter) { result = buildingInfo[6].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } else { - for (i = 0; g_stage7Plants[i] != -1; i++) { - if (plantInfo[g_stage7Plants[i]].m_counter) { - result = plantInfo[g_stage7Plants[i]].m_entity; + for (i = 0; g_location7Plants[i] != -1; i++) { + if (plantInfo[g_location7Plants[i]].m_counter) { + result = plantInfo[g_location7Plants[i]].m_entity; break; } } } break; case 8: - for (i = 0; g_stage8Plants[i] != -1; i++) { - if (plantInfo[g_stage8Plants[i]].m_counter) { - result = plantInfo[g_stage8Plants[i]].m_entity; + for (i = 0; g_location8Plants[i] != -1; i++) { + if (plantInfo[g_location8Plants[i]].m_counter) { + result = plantInfo[g_location8Plants[i]].m_entity; break; } } @@ -863,14 +865,14 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param) if (buildingInfo[15].m_counter) { result = buildingInfo[15].m_entity; - *p_param = TRUE; + *p_isBuilding = TRUE; } break; } - if (!result && !g_brickstrLocations[m_unk0x1d].m_unk0x1c) { - g_brickstrLocations[m_unk0x1d].m_unk0x1c = TRUE; - m_unk0x48++; + if (!result && !g_brickstrLocations[m_targetLocation].m_cleared) { + g_brickstrLocations[m_targetLocation].m_cleared = TRUE; + m_visitedLocations++; } return result; diff --git a/LEGO1/lego/legoomni/src/actors/islepathactor.cpp b/LEGO1/lego/legoomni/src/actors/islepathactor.cpp index efba4068..1c58cecf 100644 --- a/LEGO1/lego/legoomni/src/actors/islepathactor.cpp +++ b/LEGO1/lego/legoomni/src/actors/islepathactor.cpp @@ -583,11 +583,11 @@ void IslePathActor::SpawnPlayer(LegoGameState::Area p_area, MxBool p_enter, MxU8 break; } - if (state != NULL && state->m_unk0x4d && !state->m_unk0x4e) { + if (state != NULL && state->m_finishedBuild && !state->m_playedExitScript) { if (AnimationManager() ->FUN_10060dc0(anim, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, FALSE, TRUE, TRUE, TRUE) == SUCCESS) { - state->m_unk0x4e = TRUE; + state->m_playedExitScript = TRUE; camAnim = FALSE; } } diff --git a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp index ab456f39..e06469f3 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp @@ -205,7 +205,7 @@ MxResult LegoCarBuild::Create(MxDSAction& p_dsAction) } m_buildState = buildState; - m_unk0x174 = m_buildState->m_unk0x4d; + m_unk0x174 = m_buildState->m_finishedBuild; GameState()->StopArea(LegoGameState::e_previousArea); @@ -515,10 +515,10 @@ void LegoCarBuild::AddSelectedPartToBuild() FUN_100243a0(); } else { - m_buildState->m_unk0x4d = TRUE; + m_buildState->m_finishedBuild = TRUE; InvokeAction(Extra::e_start, m_atomId, m_carId, NULL); NotificationManager()->Send(this, MxNotificationParam()); - m_buildState->m_animationState = LegoVehicleBuildState::e_unknown4; + m_buildState->m_animationState = LegoVehicleBuildState::e_finishedBuild; m_buildState->m_placedPartCount = 0; } } @@ -674,7 +674,8 @@ MxLong LegoCarBuild::Notify(MxParam& p_param) ((LegoEventNotificationParam&) p_param).GetY() ); - if (result || m_unk0x10a || m_buildState->m_animationState == 4 || m_buildState->m_animationState == 6) { + if (result || m_unk0x10a || m_buildState->m_animationState == LegoVehicleBuildState::e_finishedBuild || + m_buildState->m_animationState == LegoVehicleBuildState::e_exiting) { m_unk0x109 = 0; break; } @@ -687,9 +688,10 @@ MxLong LegoCarBuild::Notify(MxParam& p_param) break; case c_notificationButtonDown: assert(m_buildState); - if (((m_buildState->m_animationState != 4) && (m_buildState->m_animationState != 6)) && - (m_buildState->m_animationState != 2)) { - m_buildState->m_animationState = LegoVehicleBuildState::e_unknown0; + if (((m_buildState->m_animationState != LegoVehicleBuildState::e_finishedBuild) && + (m_buildState->m_animationState != LegoVehicleBuildState::e_exiting)) && + (m_buildState->m_animationState != LegoVehicleBuildState::e_settingUpMovie)) { + m_buildState->m_animationState = LegoVehicleBuildState::e_none; result = SelectPartFromMousePosition( ((LegoEventNotificationParam&) p_param).GetX(), ((LegoEventNotificationParam&) p_param).GetY() @@ -738,7 +740,8 @@ MxLong LegoCarBuild::Notify(MxParam& p_param) // FUNCTION: BETA10 0x1006cc48 undefined4 LegoCarBuild::FUN_10024250(LegoEventNotificationParam* p_param) { - if (p_param->GetKey() == ' ' && m_buildState->m_animationState != 4 && m_buildState->m_animationState != 2) { + if (p_param->GetKey() == ' ' && m_buildState->m_animationState != LegoVehicleBuildState::e_finishedBuild && + m_buildState->m_animationState != LegoVehicleBuildState::e_settingUpMovie) { if (m_numAnimsRun > 0) { DeleteObjects(&m_atomId, 500, 0x1fe); BackgroundAudioManager()->RaiseVolume(); @@ -759,7 +762,7 @@ void LegoCarBuild::ReadyWorld() if (BackgroundAudioManager()->GetEnabled()) { InvokeAction(Extra::ActionType::e_start, *g_jukeboxScript, FUN_10025ee0(m_carId), NULL); - m_buildState->m_animationState = LegoVehicleBuildState::e_unknown2; + m_buildState->m_animationState = LegoVehicleBuildState::e_settingUpMovie; NotificationManager()->Send(this, MxNotificationParam()); } else { @@ -802,12 +805,12 @@ undefined4 LegoCarBuild::FUN_10024480(MxActionNotificationParam* p_param) MxS32 result = 0; switch (m_buildState->m_animationState) { - case 3: + case LegoVehicleBuildState::e_cutscene: BackgroundAudioManager()->RaiseVolume(); - m_buildState->m_animationState = LegoVehicleBuildState::e_unknown0; + m_buildState->m_animationState = LegoVehicleBuildState::e_none; result = 1; break; - case 6: + case LegoVehicleBuildState::e_exiting: if (p_param->GetAction()->GetObjectId() == m_unk0x344) { FUN_100243a0(); result = 1; @@ -858,8 +861,8 @@ undefined4 LegoCarBuild::SelectPartFromMousePosition(MxLong p_x, MxLong p_y) } } else { - if (m_animPresenter->FUN_10079c30(m_selectedPart->GetName())) { - m_unk0x114 = m_animPresenter->FUN_10079e20(); + if (m_animPresenter->IsNextPartToPlace(m_selectedPart->GetName())) { + m_unk0x114 = m_animPresenter->GetTargetBoundingSphere(); } } @@ -905,7 +908,7 @@ undefined4 LegoCarBuild::FUN_100246e0(MxLong p_x, MxLong p_y) m_PlaceBrick_Sound->Enable(TRUE); m_animPresenter->SetShelfState(LegoCarBuildAnimPresenter::e_stopped); } - else if (m_animPresenter->FUN_10079c30(m_selectedPart->GetName())) { + else if (m_animPresenter->IsNextPartToPlace(m_selectedPart->GetName())) { if (SpheresIntersect(m_unk0x114, m_selectedPart->GetWorldBoundingSphere())) { m_PlaceBrick_Sound->Enable(FALSE); m_PlaceBrick_Sound->Enable(TRUE); @@ -960,8 +963,8 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param) switch (param->m_clickedObjectId) { // The enum values are all identical between CopterScript, DunecarScript, JetskiScript, and RacecarScript case CopterScript::c_Info_Ctl: - if (m_buildState->m_animationState != LegoVehicleBuildState::e_unknown4 && - m_buildState->m_animationState != LegoVehicleBuildState::e_unknown2 && + if (m_buildState->m_animationState != LegoVehicleBuildState::e_finishedBuild && + m_buildState->m_animationState != LegoVehicleBuildState::e_settingUpMovie && m_buildState->m_animationState != LegoVehicleBuildState::e_exiting && GameState()->GetCurrentAct() != LegoGameState::e_act2) { if (m_numAnimsRun > 0) { @@ -977,7 +980,7 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param) break; case CopterScript::c_Exit_Ctl: if (m_buildState->m_animationState != LegoVehicleBuildState::e_exiting && - m_buildState->m_animationState != LegoVehicleBuildState::e_unknown4) { + m_buildState->m_animationState != LegoVehicleBuildState::e_finishedBuild) { if (m_numAnimsRun > 0) { DeleteObjects(&m_atomId, 500, 510); } @@ -987,13 +990,13 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param) if (GameState()->GetCurrentAct() == LegoGameState::e_act2) { FUN_100243a0(); } - else if (m_animPresenter->AllPartsPlaced() || m_buildState->m_unk0x4d) { - m_buildState->m_unk0x4d = TRUE; + else if (m_animPresenter->AllPartsPlaced() || m_buildState->m_finishedBuild) { + m_buildState->m_finishedBuild = TRUE; InvokeAction(Extra::e_start, m_atomId, m_carId, NULL); NotificationManager()->Send(this, MxNotificationParam()); - m_buildState->m_animationState = LegoVehicleBuildState::e_unknown4; + m_buildState->m_animationState = LegoVehicleBuildState::e_finishedBuild; } else { FUN_10025720(4); @@ -1066,8 +1069,8 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param) if (m_buildState->m_animationState != LegoVehicleBuildState::e_exiting) { m_animPresenter->SetShelfState(LegoCarBuildAnimPresenter::e_selected); - if (m_animPresenter->AllPartsPlaced() || m_buildState->m_unk0x4d) { - m_buildState->m_unk0x4d = TRUE; + if (m_animPresenter->AllPartsPlaced() || m_buildState->m_finishedBuild) { + m_buildState->m_finishedBuild = TRUE; // GameState()->GetCurrentAct() returns an MxS16 in BETA10 if (GameState()->GetCurrentAct() == 0) { @@ -1076,7 +1079,7 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param) NotificationManager()->Send(this, MxNotificationParam()); assert(m_buildState); - m_buildState->m_animationState = LegoVehicleBuildState::e_unknown4; + m_buildState->m_animationState = LegoVehicleBuildState::e_finishedBuild; } else { @@ -1156,7 +1159,7 @@ undefined4 LegoCarBuild::FUN_10024c20(MxNotificationParam* p_param) assert(m_buildState); switch (m_buildState->m_animationState) { - case 4: + case LegoVehicleBuildState::e_finishedBuild: entity = (LegoEntity*) Find(m_atomId, m_carId); if (entity && entity->GetROI()) { @@ -1216,7 +1219,7 @@ undefined4 LegoCarBuild::FUN_10024c20(MxNotificationParam* p_param) NotificationManager()->Send(this, MxNotificationParam()); } break; - case 2: + case LegoVehicleBuildState::e_settingUpMovie: MxU32 jukeboxScript; switch (m_carId) { @@ -1255,7 +1258,7 @@ void LegoCarBuild::FUN_10024ef0() ResetViewVelocity(); m_buildState->m_animationState = LegoVehicleBuildState::e_cutscene; FUN_10025720(FUN_10025d70()); - m_buildState->m_unk0x4c += 1; + m_buildState->m_introductionCounter += 1; Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } @@ -1421,7 +1424,7 @@ void LegoCarBuild::FUN_10025450() else { const LegoChar* wiredName; - if (!m_animPresenter->FUN_10079c30(m_selectedPart->GetName())) { + if (!m_animPresenter->IsNextPartToPlace(m_selectedPart->GetName())) { wiredName = m_animPresenter->GetWiredNameByPartName(m_selectedPart->GetName()); } else { @@ -1626,7 +1629,7 @@ void LegoCarBuild::FUN_10025d10(MxS32 p_param) // FUNCTION: LEGO1 0x10025d70 MxS32 LegoCarBuild::FUN_10025d70() { - switch (m_buildState->m_unk0x4c % 3) { + switch (m_buildState->m_introductionCounter % 3) { case 1: return 1; case 2: @@ -1679,7 +1682,7 @@ MxBool LegoCarBuild::Escape() InvokeAction(Extra::ActionType::e_stop, *g_jukeboxScript, targetEntityId, NULL); DeleteObjects(&m_atomId, 500, 999); - m_buildState->m_animationState = LegoVehicleBuildState::e_unknown0; + m_buildState->m_animationState = LegoVehicleBuildState::e_none; m_destLocation = LegoGameState::e_infomain; return TRUE; } @@ -1706,9 +1709,9 @@ MxS32 LegoCarBuild::FUN_10025ee0(undefined4 p_param1) LegoVehicleBuildState::LegoVehicleBuildState(const char* p_classType) { m_className = p_classType; - m_unk0x4c = 0; - m_unk0x4d = FALSE; - m_unk0x4e = FALSE; + m_introductionCounter = 0; + m_finishedBuild = FALSE; + m_playedExitScript = FALSE; m_placedPartCount = 0; } @@ -1719,17 +1722,17 @@ MxResult LegoVehicleBuildState::Serialize(LegoStorage* p_storage) LegoState::Serialize(p_storage); if (p_storage->IsReadMode()) { - p_storage->ReadU8(m_unk0x4c); - p_storage->ReadU8(m_unk0x4d); - p_storage->ReadU8(m_unk0x4e); + p_storage->ReadU8(m_introductionCounter); + p_storage->ReadU8(m_finishedBuild); + p_storage->ReadU8(m_playedExitScript); #ifndef BETA10 p_storage->ReadU8(m_placedPartCount); #endif } else { - p_storage->WriteU8(m_unk0x4c); - p_storage->WriteU8(m_unk0x4d); - p_storage->WriteU8(m_unk0x4e); + p_storage->WriteU8(m_introductionCounter); + p_storage->WriteU8(m_finishedBuild); + p_storage->WriteU8(m_playedExitScript); #ifndef BETA10 p_storage->WriteU8(m_placedPartCount); #endif diff --git a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp index a3adac06..f5c92492 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp @@ -18,7 +18,7 @@ #include -DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::UnknownListEntry, 0x0c) +DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::CarBuildPart, 0x0c) DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter, 0x150) // FUNCTION: LEGO1 0x10078400 @@ -34,7 +34,7 @@ LegoCarBuildAnimPresenter::LegoCarBuildAnimPresenter() m_shelfFrameBuffer = 0; m_shelfFrameMax = 0; m_shelfFrameInterval = 0; - m_unk0x13c = 0; + m_flashingPartTimeState = 0; m_carBuildEntity = NULL; m_unk0x144 = -1; m_unk0x148 = -1; @@ -62,28 +62,28 @@ LegoCarBuildAnimPresenter::~LegoCarBuildAnimPresenter() } // FUNCTION: BETA10 0x100733d0 -inline void LegoCarBuildAnimPresenter::Beta10Inline0x100733d0() +inline void LegoCarBuildAnimPresenter::UpdateFlashingPartVisibility() { MxLong time = Timer()->GetTime(); - MxLong bvar5; + MxLong showFlashingPart; - if (m_unk0x13c < time) { - bvar5 = FALSE; + if (m_flashingPartTimeState < time) { + showFlashingPart = FALSE; // I have no idea why this conditional is so convoluted - if (m_unk0x13c & c_bit1) { - bvar5 = TRUE; - m_unk0x13c = time + 400; + if (m_flashingPartTimeState & c_bit1) { + showFlashingPart = TRUE; + m_flashingPartTimeState = time + 400; } else { - m_unk0x13c = time + 200; + m_flashingPartTimeState = time + 200; } - if (bvar5) { - m_unk0x13c &= ~c_bit1; + if (showFlashingPart) { + m_flashingPartTimeState &= ~c_bit1; } else { - m_unk0x13c |= c_bit1; + m_flashingPartTimeState |= c_bit1; } if (m_placedPartCount < m_numberOfParts) { @@ -98,7 +98,7 @@ inline void LegoCarBuildAnimPresenter::Beta10Inline0x100733d0() const LegoChar* name = roi->GetName(); if (name && SDL_strcasecmp(wiredName, name) == 0) { - if (bvar5) { + if (showFlashingPart) { roi->SetVisibility(TRUE); } else { @@ -129,7 +129,7 @@ void LegoCarBuildAnimPresenter::PutFrame() break; } - Beta10Inline0x100733d0(); + UpdateFlashingPartVisibility(); } // FUNCTION: LEGO1 0x100788c0 @@ -211,7 +211,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle() } if (i < m_placedPartCount) { - FUN_10079050(i); + MakePartPlaced(i); ShowBuildPartByName(m_parts[i].m_name); } @@ -318,7 +318,7 @@ MxResult LegoCarBuildAnimPresenter::Serialize(LegoStorage* p_storage) // FUNCTION: LEGO1 0x10079050 // FUNCTION: BETA10 0x1007151e -void LegoCarBuildAnimPresenter::FUN_10079050(MxS16 p_index) +void LegoCarBuildAnimPresenter::MakePartPlaced(MxS16 p_index) { SwapNodesByName(m_parts[p_index].m_wiredName, m_parts[p_index].m_name); HideBuildPartByName(m_parts[p_index].m_wiredName); @@ -384,7 +384,7 @@ void LegoCarBuildAnimPresenter::InitBuildPlatform() } assert(m_numberOfParts); - m_parts = new UnknownListEntry[m_numberOfParts]; + m_parts = new CarBuildPart[m_numberOfParts]; assert(m_parts); // Go through and add the wired name of each part @@ -553,7 +553,7 @@ void LegoCarBuildAnimPresenter::AddPartToBuildByName(const LegoChar* p_name) strcpy(m_parts[i].m_name, buffer); Swap(m_parts[m_placedPartCount].m_objectId, m_parts[i].m_objectId); } - FUN_10079050(m_placedPartCount); + MakePartPlaced(m_placedPartCount); m_placedPartCount++; ((LegoCarBuild*) m_currentWorld)->SetPlacedPartCount(m_placedPartCount); @@ -646,7 +646,7 @@ MxBool LegoCarBuildAnimPresenter::StringEqualsShelf(const LegoChar* p_string) // FUNCTION: LEGO1 0x10079c30 // FUNCTION: BETA10 0x100726a6 -MxBool LegoCarBuildAnimPresenter::FUN_10079c30(const LegoChar* p_name) +MxBool LegoCarBuildAnimPresenter::IsNextPartToPlace(const LegoChar* p_name) { if (PartIsPlaced(p_name)) { return FALSE; @@ -710,7 +710,7 @@ void LegoCarBuildAnimPresenter::SetPartObjectIdByName(const LegoChar* p_name, Mx // FUNCTION: LEGO1 0x10079e20 // FUNCTION: BETA10 0x10072959 -const BoundingSphere& LegoCarBuildAnimPresenter::FUN_10079e20() +const BoundingSphere& LegoCarBuildAnimPresenter::GetTargetBoundingSphere() { LegoROI* roi = m_carBuildEntity->GetROI(); return roi->FindChildROI(m_parts[m_placedPartCount].m_wiredName, roi)->GetWorldBoundingSphere(); diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 90ea44c6..49a837e1 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -1800,7 +1800,7 @@ void LegoAnimationManager::FUN_10062580(AnimInfo& p_info) // FUNCTION: LEGO1 0x10062650 // FUNCTION: BETA10 0x100436e2 -MxBool LegoAnimationManager::FUN_10062650(Vector3& p_position, float p_und, LegoROI* p_roi) +MxBool LegoAnimationManager::FUN_10062650(Mx3DPointFloat& p_position, float p_und, LegoROI* p_roi) { if (p_roi != NULL) { Mx3DPointFloat position(p_position); diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index b306e06a..fb50b5ef 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -850,7 +850,7 @@ inline void LoadIsle() { LegoWorld* world = FindWorld(*g_isleScript, IsleScript::c__Isle); if (world != NULL) { - if (!world->GetUnknown0xd0Empty()) { + if (!world->NoDisabledObjects()) { NotificationManager()->Send(world, MxNotificationParam(c_notificationType20, NULL)); } } diff --git a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp index fde06e8f..725e73d4 100644 --- a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp @@ -125,15 +125,9 @@ MxResult MxTransitionManager::StartTransition( m_animationSpeed = p_speed; - MxTickleManager* tickleManager = TickleManager(); - tickleManager->RegisterClient(this, p_speed); - - LegoInputManager* inputManager = InputManager(); - inputManager->SetUnknown88(TRUE); - inputManager->SetUnknown336(FALSE); - - LegoVideoManager* videoManager = VideoManager(); - videoManager->SetRender3D(FALSE); + TickleManager()->RegisterClient(this, p_speed); + InputManager()->DisableInputProcessing(); + VideoManager()->SetRender3D(FALSE); SetAppCursor(e_cursorBusy); return SUCCESS; diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index fe4bbc63..f8e9b3cb 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -75,7 +75,7 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction) return FAILURE; } - if (!VTable0x54()) { + if (!InitializeCameraController()) { return FAILURE; } @@ -135,10 +135,10 @@ void LegoWorld::Destroy(MxBool p_fromDestructor) } } - while (!m_set0xa8.empty()) { - MxCoreSet::iterator it = m_set0xa8.begin(); + while (!m_objects.empty()) { + MxCoreSet::iterator it = m_objects.begin(); MxCore* object = *it; - m_set0xa8.erase(it); + m_objects.erase(it); if (object->IsA("MxPresenter")) { MxPresenter* presenter = (MxPresenter*) object; @@ -166,7 +166,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor) } } - if (m_worldId != LegoOmni::e_undefined && m_set0xd0.empty()) { + if (m_worldId != LegoOmni::e_undefined && m_disabledObjects.empty()) { PlantManager()->Reset(m_worldId); BuildingManager()->Reset(); } @@ -234,7 +234,7 @@ MxLong LegoWorld::Notify(MxParam& p_param) // FUNCTION: LEGO1 0x1001f630 // FUNCTION: BETA10 0x100d9fc2 -LegoCameraController* LegoWorld::VTable0x54() +LegoCameraController* LegoWorld::InitializeCameraController() { MxBool success = FALSE; @@ -357,7 +357,7 @@ MxBool LegoWorld::ActorExists(LegoPathActor* p_actor) // FUNCTION: LEGO1 0x1001fda0 // FUNCTION: BETA10 0x100da621 -void LegoWorld::FUN_1001fda0(LegoAnimPresenter* p_presenter) +void LegoWorld::AddPresenterIfInRange(LegoAnimPresenter* p_presenter) { LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; @@ -369,7 +369,7 @@ void LegoWorld::FUN_1001fda0(LegoAnimPresenter* p_presenter) // FUNCTION: LEGO1 0x1001fe90 // FUNCTION: BETA10 0x100da6b5 -void LegoWorld::FUN_1001fe90(LegoAnimPresenter* p_presenter) +void LegoWorld::RemovePresenterFromBoundaries(LegoAnimPresenter* p_presenter) { LegoPathControllerListCursor cursor(&m_pathControllerList); LegoPathController* controller; @@ -486,25 +486,25 @@ void LegoWorld::Add(MxCore* p_object) } #endif else { - MxCoreSet::iterator it = m_set0xa8.find(p_object); - if (it == m_set0xa8.end()) { + MxCoreSet::iterator it = m_objects.find(p_object); + if (it == m_objects.end()) { #ifdef BETA10 if (p_object->IsA("MxPresenter")) { assert(static_cast(p_object)->GetAction()); } #endif - m_set0xa8.insert(p_object); + m_objects.insert(p_object); } else { assert(0); } } - if (m_set0xd0.size() != 0 && p_object->IsA("MxPresenter")) { + if (m_disabledObjects.size() != 0 && p_object->IsA("MxPresenter")) { if (((MxPresenter*) p_object)->IsEnabled()) { ((MxPresenter*) p_object)->Enable(FALSE); - m_set0xd0.insert(p_object); + m_disabledObjects.insert(p_object); } } } @@ -562,15 +562,15 @@ void LegoWorld::Remove(MxCore* p_object) } #endif else { - it = m_set0xa8.find(p_object); - if (it != m_set0xa8.end()) { - m_set0xa8.erase(it); + it = m_objects.find(p_object); + if (it != m_objects.end()) { + m_objects.erase(it); } } - it = m_set0xd0.find(p_object); - if (it != m_set0xd0.end()) { - m_set0xd0.erase(it); + it = m_disabledObjects.find(p_object); + if (it != m_disabledObjects.end()) { + m_disabledObjects.erase(it); } } @@ -622,7 +622,7 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name) return NULL; } - for (MxCoreSet::iterator i = m_set0xa8.begin(); i != m_set0xa8.end(); i++) { + for (MxCoreSet::iterator i = m_objects.begin(); i != m_objects.end(); i++) { if ((*i)->IsA(p_class) && (*i)->IsA("MxPresenter")) { assert(((MxPresenter*) (*i))->GetAction()); @@ -675,7 +675,7 @@ MxCore* LegoWorld::Find(const MxAtomId& p_atom, MxS32 p_entityId) } } - for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) { + for (MxCoreSet::iterator it = m_objects.begin(); it != m_objects.end(); it++) { MxCore* core = *it; if (core->IsA("MxPresenter")) { @@ -697,7 +697,7 @@ void LegoWorld::Enable(MxBool p_enable) { MxCoreSet::iterator it; - if (p_enable && m_set0xd0.size() != 0) { + if (p_enable && m_disabledObjects.size() != 0) { if (CurrentWorld() == this) { return; } @@ -720,8 +720,8 @@ void LegoWorld::Enable(MxBool p_enable) } } - while (m_set0xd0.size() != 0) { - it = m_set0xd0.begin(); + while (m_disabledObjects.size() != 0) { + it = m_disabledObjects.begin(); if ((*it)->IsA("MxPresenter")) { ((MxPresenter*) *it)->Enable(TRUE); @@ -730,7 +730,7 @@ void LegoWorld::Enable(MxBool p_enable) ((LegoPathController*) *it)->Enable(TRUE); } - m_set0xd0.erase(it); + m_disabledObjects.erase(it); } SetCurrentWorld(this); @@ -754,7 +754,7 @@ void LegoWorld::Enable(MxBool p_enable) SetIsWorldActive(TRUE); #endif } - else if (!p_enable && m_set0xd0.size() == 0) { + else if (!p_enable && m_disabledObjects.size() == 0) { MxPresenter* presenter; LegoPathController* controller; LegoPathActor* actor = UserActor(); @@ -764,7 +764,7 @@ void LegoWorld::Enable(MxBool p_enable) } AnimationManager()->Reset(FALSE); - m_set0xd0.insert(this); + m_disabledObjects.insert(this); if (m_worldId != LegoOmni::e_undefined) { PlantManager()->Reset(m_worldId); @@ -777,15 +777,15 @@ void LegoWorld::Enable(MxBool p_enable) while (controlPresenterCursor.Next(presenter)) { if (presenter->IsEnabled()) { - m_set0xd0.insert(presenter); + m_disabledObjects.insert(presenter); presenter->Enable(FALSE); } } - for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) { + for (MxCoreSet::iterator it = m_objects.begin(); it != m_objects.end(); it++) { if ((*it)->IsA("LegoActionControlPresenter") || ((*it)->IsA("MxPresenter") && ((MxPresenter*) *it)->IsEnabled())) { - m_set0xd0.insert(*it); + m_disabledObjects.insert(*it); ((MxPresenter*) *it)->Enable(FALSE); } } @@ -811,7 +811,7 @@ void LegoWorld::Enable(MxBool p_enable) while (pathControllerCursor.Next(controller)) { controller->Enable(FALSE); - m_set0xd0.insert(controller); + m_disabledObjects.insert(controller); } GetViewManager()->RemoveAll(NULL); @@ -869,7 +869,7 @@ MxBool LegoWorld::PresentersPending() } } - for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) { + for (MxCoreSet::iterator it = m_objects.begin(); it != m_objects.end(); it++) { if ((*it)->IsA("MxPresenter")) { presenter = (MxPresenter*) *it; diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index abf6c32a..17bfedf2 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -59,7 +59,7 @@ LegoWorldPresenter::~LegoWorldPresenter() PlantManager()->LoadWorldInfo(worldId); AnimationManager()->LoadWorldInfo(worldId); BuildingManager()->LoadWorldInfo(); - result = ((LegoWorld*) m_entity)->VTable0x5c(); + result = ((LegoWorld*) m_entity)->WaitForTransition(); } if (result == FALSE) { diff --git a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp index 39a97cc0..b56acab1 100644 --- a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp +++ b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp @@ -41,7 +41,7 @@ LegoInputManager::LegoInputManager() m_y = 0; m_controlManager = NULL; m_unk0x81 = FALSE; - m_unk0x88 = FALSE; + m_inputProcessingDisabled = FALSE; m_unk0x195 = 0; m_unk0x335 = FALSE; m_unk0x336 = FALSE; @@ -248,7 +248,7 @@ void LegoInputManager::QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p { LegoEventNotificationParam param = LegoEventNotificationParam(p_id, NULL, p_modifier, p_x, p_y, p_key); - if (((!m_unk0x88) || ((m_unk0x335 && (param.GetNotification() == c_notificationButtonDown)))) || + if (((!m_inputProcessingDisabled) || ((m_unk0x335 && (param.GetNotification() == c_notificationButtonDown)))) || ((m_unk0x336 && (p_key == SDLK_SPACE)))) { ProcessOneEvent(param); } @@ -499,9 +499,10 @@ void LegoInputManager::StopAutoDragTimer() } // FUNCTION: LEGO1 0x1005cff0 +// FUNCTION: BETA10 0x10096a10 void LegoInputManager::EnableInputProcessing() { - m_unk0x88 = FALSE; + m_inputProcessingDisabled = FALSE; g_clickedObjectId = -1; g_clickedAtom = NULL; } diff --git a/LEGO1/lego/legoomni/src/paths/legopathstruct.cpp b/LEGO1/lego/legoomni/src/paths/legopathstruct.cpp index 276b66ab..7d8dfc0f 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathstruct.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathstruct.cpp @@ -19,7 +19,6 @@ DECOMP_SIZE_ASSERT(LegoPathStruct, 0x14) extern MxU32 g_isleFlags; // GLOBAL: LEGO1 0x100f119c -// GLOBAL: BETA10 0x100f119c MxBool g_unk0x100f119c = FALSE; // FUNCTION: LEGO1 0x1001b700 diff --git a/LEGO1/lego/legoomni/src/race/carrace.cpp b/LEGO1/lego/legoomni/src/race/carrace.cpp index 33c740a1..805ee9d6 100644 --- a/LEGO1/lego/legoomni/src/race/carrace.cpp +++ b/LEGO1/lego/legoomni/src/race/carrace.cpp @@ -70,6 +70,7 @@ const LegoChar* g_strCRCEDGEY0 = "C_RCEDGEY0"; MxS32 g_unk0x100f0c7c = 2; // FUNCTION: LEGO1 0x10016a90 +// FUNCTION: BETA10 0x100c82e8 CarRace::CarRace() { m_skeleton = NULL; diff --git a/LEGO1/lego/legoomni/src/race/legorace.cpp b/LEGO1/lego/legoomni/src/race/legorace.cpp index 91374766..71e59f02 100644 --- a/LEGO1/lego/legoomni/src/race/legorace.cpp +++ b/LEGO1/lego/legoomni/src/race/legorace.cpp @@ -53,6 +53,7 @@ MxResult LegoRace::Create(MxDSAction& p_dsAction) } // FUNCTION: LEGO1 0x10015d40 +// FUNCTION: BETA10 0x100c7ab5 LegoRace::~LegoRace() { g_unk0x100f119c = FALSE; @@ -101,7 +102,7 @@ MxLong LegoRace::Notify(MxParam& p_param) // FUNCTION: BETA10 0x100c7c3f void LegoRace::Enable(MxBool p_enable) { - if (GetUnknown0xd0Empty() != p_enable && !p_enable) { + if (NoDisabledObjects() != p_enable && !p_enable) { Remove(UserActor()); MxU8 oldActorId = GameState()->GetActorId(); diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index 42e7bb02..fe0fea08 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -1139,7 +1139,7 @@ void LegoAnimPresenter::VTable0x8c() } if (m_currentWorld) { - m_currentWorld->FUN_1001fda0(this); + m_currentWorld->AddPresenterIfInRange(this); if (!m_compositePresenter || !m_compositePresenter->IsA("LegoAnimMMPresenter")) { m_currentWorld->Add(this); } @@ -1151,7 +1151,7 @@ void LegoAnimPresenter::VTable0x8c() void LegoAnimPresenter::VTable0x90() { if (m_currentWorld != NULL) { - m_currentWorld->FUN_1001fe90(this); + m_currentWorld->RemovePresenterFromBoundaries(this); if (m_compositePresenter != NULL && m_compositePresenter->IsA("LegoAnimMMPresenter")) { return; diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index bad2762e..f897bc2e 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -893,7 +893,7 @@ void Act3::FUN_10073a60() // FUNCTION: LEGO1 0x10073a90 void Act3::Enable(MxBool p_enable) { - if ((MxBool) m_set0xd0.empty() == p_enable) { + if ((MxBool) m_disabledObjects.empty() == p_enable) { return; } diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index 45885c31..8884551b 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -1301,7 +1301,7 @@ void Infocenter::StopCutscene() } // FUNCTION: LEGO1 0x10070d00 -MxBool Infocenter::VTable0x5c() +MxBool Infocenter::WaitForTransition() { return TRUE; } @@ -1453,10 +1453,10 @@ void Infocenter::StartCredits() { MxPresenter* presenter; - while (!m_set0xa8.empty()) { - MxCoreSet::iterator it = m_set0xa8.begin(); + while (!m_objects.empty()) { + MxCoreSet::iterator it = m_objects.begin(); MxCore* object = *it; - m_set0xa8.erase(it); + m_objects.erase(it); if (object->IsA("MxPresenter")) { presenter = (MxPresenter*) object; diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index 8e3c0535..a455c744 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -540,7 +540,7 @@ MxLong Isle::HandlePathStruct(LegoPathStructNotificationParam& p_param) // FUNCTION: BETA10 0x10034158 void Isle::Enable(MxBool p_enable) { - if ((MxBool) m_set0xd0.empty() == p_enable) { + if ((MxBool) m_disabledObjects.empty() == p_enable) { return; } diff --git a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp index fea291ba..85faa9e1 100644 --- a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp +++ b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp @@ -33,11 +33,11 @@ DECOMP_SIZE_ASSERT(LegoAct2, 0x1154) DECOMP_SIZE_ASSERT(LegoAct2State, 0x10) // GLOBAL: LEGO1 0x100f4474 -Act2mainScript::Script g_unk0x100f4474 = (Act2mainScript::Script) 0; +Act2mainScript::Script g_bricksterSpeech = (Act2mainScript::Script) 0; // GLOBAL: LEGO1 0x100f43f0 // GLOBAL: BETA10 0x101e14a8 -MxS32 g_unk0x100f43f0[] = { +MxS32 g_animationsBricksterIsLoose[] = { Act2mainScript::c_tns030bd_RunAnim, Act2mainScript::c_tns030pg_RunAnim, Act2mainScript::c_tns030rd_RunAnim, @@ -49,7 +49,7 @@ MxS32 g_unk0x100f43f0[] = { }; // GLOBAL: LEGO1 0x100f4410 -const LegoChar* g_unk0x100f4410[] = {"bd", "pg", "rd", "sy", "ro", "cl"}; +const LegoChar* g_charactersBricksterIsLoose[] = {"bd", "pg", "rd", "sy", "ro", "cl"}; // GLOBAL: LEGO1 0x100f4428 MxS32 g_unk0x100f4428[] = { @@ -74,17 +74,17 @@ const LegoChar* g_unk0x100f4458[] = {"papa", "nick", "laura", "cl", "pg", "rd", // FUNCTION: BETA10 0x1003a5a0 LegoAct2::LegoAct2() { - m_unk0x10c4 = 0; + m_state = LegoAct2::e_initial; m_gameState = NULL; m_pepper = NULL; m_ambulance = NULL; m_ready = FALSE; m_unk0x1130 = 0; m_nextBrick = 0; - m_unk0x10c1 = 0; + m_removedBricks = 0; m_unk0x1138 = NULL; - m_unk0x1140 = (Act2mainScript::Script) 0; - m_unk0x1144 = (Act2mainScript::Script) 0; + m_currentAction = (Act2mainScript::Script) 0; + m_infomanDirecting = (Act2mainScript::Script) 0; m_destLocation = LegoGameState::e_undefined; m_music = JukeboxScript::c_MusicTheme1; m_siFile = ""; @@ -166,97 +166,97 @@ MxResult LegoAct2::Tickle() return SUCCESS; } - switch (m_unk0x10c4) { - case 0: - m_unk0x10c4 = 1; + switch (m_state) { + case LegoAct2::e_initial: + m_state = LegoAct2::e_startSpeech; break; - case 1: + case LegoAct2::e_startSpeech: ((LegoPathActor*) m_pepper->GetEntity())->SetActorState(LegoPathActor::c_disabled); switch (SDL_rand(3)) { case 0: - g_unk0x100f4474 = Act2mainScript::c_tns002br_RunAnim; + g_bricksterSpeech = Act2mainScript::c_tns002br_RunAnim; break; case 1: - g_unk0x100f4474 = Act2mainScript::c_tns003br_RunAnim; + g_bricksterSpeech = Act2mainScript::c_tns003br_RunAnim; break; case 2: - g_unk0x100f4474 = Act2mainScript::c_tns004br_RunAnim; + g_bricksterSpeech = Act2mainScript::c_tns004br_RunAnim; break; } - FUN_10052560(g_unk0x100f4474, TRUE, TRUE, NULL, NULL, NULL); - m_unk0x10d0 = 0; - m_unk0x10c4 = 2; + StartAction(g_bricksterSpeech, TRUE, TRUE, NULL, NULL, NULL); + m_timeSinceLastStage = 0; + m_state = LegoAct2::e_holdingSpeech; break; - case 2: - if (g_unk0x100f4474) { - if (AnimationManager()->FUN_10064ee0(g_unk0x100f4474)) { + case LegoAct2::e_holdingSpeech: + if (g_bricksterSpeech) { + if (AnimationManager()->FUN_10064ee0(g_bricksterSpeech)) { Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); - g_unk0x100f4474 = (Act2mainScript::Script) 0; + g_bricksterSpeech = (Act2mainScript::Script) 0; } } - m_unk0x10d0 += 50; + m_timeSinceLastStage += 50; break; - case 3: + case LegoAct2::e_startDescription: Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); - m_unk0x10d0 = 0; - m_unk0x10c4 = 4; - FUN_10052560(Act2mainScript::c_tja009ni_RunAnim, TRUE, TRUE, NULL, NULL, NULL); + m_timeSinceLastStage = 0; + m_state = LegoAct2::e_explaining; + StartAction(Act2mainScript::c_tja009ni_RunAnim, TRUE, TRUE, NULL, NULL, NULL); AnimationManager()->EnableCamAnims(TRUE); AnimationManager()->FUN_1005f6d0(TRUE); - AnimationManager()->FUN_100604f0(g_unk0x100f43f0, sizeOfArray(g_unk0x100f43f0)); - AnimationManager()->FUN_10060480(g_unk0x100f4410, sizeOfArray(g_unk0x100f4410)); + AnimationManager()->FUN_100604f0(g_animationsBricksterIsLoose, sizeOfArray(g_animationsBricksterIsLoose)); + AnimationManager()->FUN_10060480(g_charactersBricksterIsLoose, sizeOfArray(g_charactersBricksterIsLoose)); break; - case 4: - m_unk0x10d0 += 50; + case LegoAct2::e_explaining: + m_timeSinceLastStage += 50; break; - case 5: - m_unk0x10d0 += 50; + case LegoAct2::e_goingToResidentialArea: + m_timeSinceLastStage += 50; - if (m_unk0x10d0 == 20000) { + if (m_timeSinceLastStage == 20000) { const MxFloat* pepperPosition = FindROI("pepper")->GetWorldPosition(); MxFloat otherPoint[] = {-52.0f, 5.25f, -16.5f}; distance = DISTSQRD3(pepperPosition, otherPoint); - if (m_unk0x1144 == (Act2mainScript::Script) 0 && distance > 50.0f && pepperPosition[0] > -57.0f) { - FUN_10052560(Act2mainScript::c_Avo906In_PlayWav, FALSE, FALSE, NULL, NULL, NULL); - m_unk0x1144 = Act2mainScript::c_Avo906In_PlayWav; + if (m_infomanDirecting == (Act2mainScript::Script) 0 && distance > 50.0f && pepperPosition[0] > -57.0f) { + StartAction(Act2mainScript::c_Avo906In_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + m_infomanDirecting = Act2mainScript::c_Avo906In_PlayWav; } } - else if (m_unk0x10d0 >= 90000 && m_unk0x10d0 % 90000 == 0 && m_unk0x1144 == (Act2mainScript::Script) 0) { - FUN_10052560(Act2mainScript::c_Avo908In_PlayWav, FALSE, FALSE, NULL, NULL, NULL); - m_unk0x1144 = Act2mainScript::c_Avo908In_PlayWav; + else if (m_timeSinceLastStage >= 90000 && m_timeSinceLastStage % 90000 == 0 && m_infomanDirecting == (Act2mainScript::Script) 0) { + StartAction(Act2mainScript::c_Avo908In_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + m_infomanDirecting = Act2mainScript::c_Avo908In_PlayWav; } break; - case 6: - m_unk0x10d0 += 50; + case LegoAct2::e_atResidentialArea: + m_timeSinceLastStage += 50; break; - case 9: - m_unk0x10d0 += 50; + case LegoAct2::e_droppingBrick: + m_timeSinceLastStage += 50; - if (m_unk0x10d0 >= 200) { + if (m_timeSinceLastStage >= 200) { if (m_nextBrick < 5) { - m_unk0x10c4 = 7; + m_state = LegoAct2::e_chase; } else { - m_unk0x10c4 = 10; - m_unk0x10d0 = 0; - m_unk0x1138->FUN_10019520(); + m_state = LegoAct2::e_goingToHide; + m_timeSinceLastStage = 0; + m_unk0x1138->GoingToHide(); } } break; - case 10: - m_unk0x10d0 += 50; + case LegoAct2::e_goingToHide: + m_timeSinceLastStage += 50; break; - case 11: + case LegoAct2::e_hidden: break; - case 12: + case LegoAct2::e_distributeRemainingBricks: break; } @@ -297,9 +297,9 @@ MxLong LegoAct2::Notify(MxParam& p_param) case c_notificationAct2Brick: SoundManager()->GetCacheSoundManager()->Play("28bng", NULL, FALSE); - m_unk0x10c1++; - if (m_unk0x10c1 == 10 && m_unk0x10c4 == 13) { - m_unk0x10c4 = 14; + m_removedBricks++; + if (m_removedBricks == 10 && m_state == LegoAct2::e_brickHunt) { + m_state = LegoAct2::e_allPiecesCollected; LegoEntity* entity = (LegoEntity*) param.GetSender(); @@ -326,10 +326,10 @@ MxLong LegoAct2::Notify(MxParam& p_param) Mx3DPointFloat locald4(local2world[2]); Mx3DPointFloat localc0(local2world[1]); - FUN_10052560(Act2mainScript::c_tns051in_RunAnim, TRUE, TRUE, &locala4, &locald4, NULL); + StartAction(Act2mainScript::c_tns051in_RunAnim, TRUE, TRUE, &locala4, &locald4, NULL); - m_unk0x10c4 = 14; - m_unk0x10d0 = 0; + m_state = LegoAct2::e_allPiecesCollected; + m_timeSinceLastStage = 0; ((LegoPathActor*) m_pepper->GetEntity())->SetActorState(LegoPathActor::c_disabled); } break; @@ -348,27 +348,27 @@ MxLong LegoAct2::HandleEndAction(MxEndActionNotificationParam& p_param) if (m_gameState->m_enabled && p_param.GetAction() != NULL) { MxU32 objectId = p_param.GetAction()->GetObjectId(); - if (m_unk0x10c4 == 5 && m_unk0x1144 == objectId) { - m_unk0x1144 = (Act2mainScript::Script) 0; + if (m_state == LegoAct2::e_goingToResidentialArea && m_infomanDirecting == objectId) { + m_infomanDirecting = (Act2mainScript::Script) 0; return 0; } - if (m_unk0x1140 != objectId) { + if (m_currentAction != objectId) { return 0; } - m_unk0x1140 = (Act2mainScript::Script) 0; + m_currentAction = (Act2mainScript::Script) 0; - switch (m_unk0x10c4) { - case 2: - m_unk0x10c4 = 3; + switch (m_state) { + case LegoAct2::e_holdingSpeech: + m_state = LegoAct2::e_startDescription; break; - case 4: - FUN_10051960(); - m_unk0x10c4 = 5; - m_unk0x10d0 = 0; + case LegoAct2::e_explaining: + HideMaPaInfo(); + m_state = LegoAct2::e_goingToResidentialArea; + m_timeSinceLastStage = 0; break; - case 6: { + case LegoAct2::e_atResidentialArea: { LegoROI* roi; roi = FindROI("nick"); @@ -400,24 +400,24 @@ MxLong LegoAct2::HandleEndAction(MxEndActionNotificationParam& p_param) roi->SetVisibility(FALSE); VariableTable()->SetVariable("ACTOR_01", "brickstr"); - FUN_10052800(); - m_unk0x10c4 = 7; + InitializeShooting(); + m_state = LegoAct2::e_chase; PlayMusic(JukeboxScript::c_BrickstrChase); break; } - case 11: + case LegoAct2::e_hidden: m_bricks[m_nextBrick - 1].Mute(TRUE); - m_unk0x10c4 = 12; - m_unk0x10d0 = 0; + m_state = LegoAct2::e_distributeRemainingBricks; + m_timeSinceLastStage = 0; - FUN_10052560(Act2mainScript::c_tra045la_RunAnim, TRUE, TRUE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_tra045la_RunAnim, TRUE, TRUE, NULL, NULL, NULL); ((LegoPathActor*) m_pepper->GetEntity())->SetActorState(LegoPathActor::c_disabled); AnimationManager()->EnableCamAnims(TRUE); AnimationManager()->FUN_1005f6d0(TRUE); AnimationManager()->FUN_100604f0(g_unk0x100f4428, sizeOfArray(g_unk0x100f4428)); AnimationManager()->FUN_10060480(g_unk0x100f4458, sizeOfArray(g_unk0x100f4458)); break; - case 12: { + case LegoAct2::e_distributeRemainingBricks: { LegoROI* roi; roi = FindROI("nick"); @@ -441,13 +441,13 @@ MxLong LegoAct2::HandleEndAction(MxEndActionNotificationParam& p_param) } m_bricks[m_nextBrick - 1].Mute(FALSE); - m_unk0x10c4 = 13; + m_state = LegoAct2::e_brickHunt; SpawnBricks(); PlayMusic(JukeboxScript::c_BrickHunt); ((LegoPathActor*) m_pepper->GetEntity())->SetActorState(LegoPathActor::c_initial); break; } - case 14: + case LegoAct2::e_allPiecesCollected: for (MxS32 i = 0; i < (MxS32) sizeOfArray(m_bricks); i++) { m_bricks[i].Remove(); } @@ -522,7 +522,7 @@ void LegoAct2::ReadyWorld() // FUNCTION: BETA10 0x1003bb2d void LegoAct2::Enable(MxBool p_enable) { - if ((MxBool) m_set0xd0.empty() == p_enable) { + if ((MxBool) m_disabledObjects.empty() == p_enable) { return; } @@ -534,7 +534,7 @@ void LegoAct2::Enable(MxBool p_enable) GameState()->SetActor(LegoActor::c_pepper); m_pepper = FindROI("pepper"); - ((IslePathActor*) m_pepper->GetEntity())->VTable0xec(m_unk0x10dc, m_unk0x1124, TRUE); + ((IslePathActor*) m_pepper->GetEntity())->VTable0xec(m_transformOnDisable, m_boundaryOnDisable, TRUE); if (GameState()->m_previousArea == LegoGameState::e_infomain) { GameState()->StopArea(LegoGameState::e_infomain); @@ -542,26 +542,27 @@ void LegoAct2::Enable(MxBool p_enable) Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); - if (m_unk0x10c4 != 6 && m_unk0x10c4 != 12) { + if (m_state != LegoAct2::e_atResidentialArea && m_state != LegoAct2::e_distributeRemainingBricks) { PlayMusic(m_music); } - if (m_unk0x10c4 == 10 && m_nextBrick == 6 && m_bricks[5].GetROI() != NULL) { + if (m_state == LegoAct2::e_goingToHide && m_nextBrick == 6 && m_bricks[5].GetROI() != NULL) { m_bricks[5].PlayWhistleSound(); } - else if (m_unk0x10c4 == 13) { + else if (m_state == LegoAct2::e_brickHunt) { InitBricks(); } TickleManager()->RegisterClient(this, 20); SetAppCursor(e_cursorArrow); - if (m_unk0x10c4 == 2 || m_unk0x10c4 == 4 || m_unk0x10c4 == 6 || m_unk0x10c4 == 11 || m_unk0x10c4 == 12 || - m_unk0x10c4 == 14) { + if (m_state == LegoAct2::e_holdingSpeech || m_state == LegoAct2::e_explaining || + m_state == LegoAct2::e_atResidentialArea || m_state == LegoAct2::e_hidden || + m_state == LegoAct2::e_distributeRemainingBricks || m_state == LegoAct2::e_allPiecesCollected) { MxDSAction action; MxEndActionNotificationParam param(c_notificationEndAction, NULL, &action, FALSE); - m_unk0x1140 = (Act2mainScript::Script) 0; + m_currentAction = (Act2mainScript::Script) 0; action.SetObjectId(0); HandleEndAction(param); } @@ -569,21 +570,21 @@ void LegoAct2::Enable(MxBool p_enable) GameState()->m_isDirty = TRUE; } else { - m_unk0x10dc = m_pepper->GetLocal2World(); - m_unk0x1124 = ((LegoPathActor*) m_pepper->GetEntity())->GetBoundary(); + m_transformOnDisable = m_pepper->GetLocal2World(); + m_boundaryOnDisable = ((LegoPathActor*) m_pepper->GetEntity())->GetBoundary(); FUN_10051900(); BackgroundAudioManager()->Stop(); UninitBricks(); DeleteObjects(&m_atomId, Act2mainScript::c_VOhead0_PlayWav, Act2mainScript::c_VOhide_PlayWav); - if (m_unk0x1144 != (Act2mainScript::Script) 0) { + if (m_infomanDirecting != (Act2mainScript::Script) 0) { MxDSAction action; action.SetAtomId(m_atomId); action.SetUnknown24(-2); - action.SetObjectId(m_unk0x1144); + action.SetObjectId(m_infomanDirecting); DeleteObject(action); - m_unk0x1144 = (Act2mainScript::Script) 0; + m_infomanDirecting = (Act2mainScript::Script) 0; } TickleManager()->UnregisterClient(this); @@ -594,46 +595,46 @@ void LegoAct2::Enable(MxBool p_enable) // FUNCTION: BETA10 0x1003bb72 MxLong LegoAct2::HandlePathStruct(LegoPathStructNotificationParam& p_param) { - if (m_unk0x10c4 == 5 && p_param.GetData() == 0x32) { + if (m_state == LegoAct2::e_goingToResidentialArea && p_param.GetData() == 0x32) { LegoPathActor* actor = (LegoPathActor*) m_pepper->GetEntity(); actor->SetActorState(LegoPathActor::c_disabled); actor->SetWorldSpeed(0.0f); FUN_10051900(); - if (m_unk0x10d0 < 90000) { - FUN_10052560(Act2mainScript::c_tra031ni_RunAnim, TRUE, TRUE, NULL, NULL, NULL); + if (m_timeSinceLastStage < 90000) { + StartAction(Act2mainScript::c_tra031ni_RunAnim, TRUE, TRUE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_tra032ni_RunAnim, TRUE, TRUE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_tra032ni_RunAnim, TRUE, TRUE, NULL, NULL, NULL); } m_unk0x112c = 50; - m_unk0x10c4 = 6; - m_unk0x10d0 = 0; + m_state = LegoAct2::e_atResidentialArea; + m_timeSinceLastStage = 0; } - else if (m_unk0x10c4 == 5 && p_param.GetData() == 0x2a) { - if (m_unk0x1144 == (Act2mainScript::Script) 0) { - FUN_10052560(Act2mainScript::c_Avo907In_PlayWav, FALSE, FALSE, NULL, NULL, NULL); - m_unk0x1144 = Act2mainScript::c_Avo907In_PlayWav; + else if (m_state == LegoAct2::e_goingToResidentialArea && p_param.GetData() == 0x2a) { + if (m_infomanDirecting == (Act2mainScript::Script) 0) { + StartAction(Act2mainScript::c_Avo907In_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + m_infomanDirecting = Act2mainScript::c_Avo907In_PlayWav; } } - else if (m_unk0x10c4 == 5) { - FUN_100521f0(p_param.GetData()); + else if (m_state == LegoAct2::e_goingToResidentialArea) { + CheckBricksterIsLoose(p_param.GetData()); } - else if (m_unk0x10c4 == 7) { - FUN_10051fa0(p_param.GetData()); + else if (m_state == LegoAct2::e_chase) { + CheckBricksterDestroying(p_param.GetData()); } - else if (m_unk0x10c4 == 10 && p_param.GetData() == 0x165) { + else if (m_state == LegoAct2::e_goingToHide && p_param.GetData() == 0x165) { ((LegoPathActor*) m_pepper->GetEntity())->SetActorState(LegoPathActor::c_disabled); - if (FUN_10052560(Act2mainScript::c_VOhide_PlayWav, FALSE, TRUE, NULL, NULL, NULL) == SUCCESS) { - m_unk0x1140 = Act2mainScript::c_VOhide_PlayWav; + if (StartAction(Act2mainScript::c_VOhide_PlayWav, FALSE, TRUE, NULL, NULL, NULL) == SUCCESS) { + m_currentAction = Act2mainScript::c_VOhide_PlayWav; } - m_unk0x1138->FUN_10019560(); + m_unk0x1138->Hide(); - m_unk0x10c4 = 11; - m_unk0x10d0 = 0; + m_state = LegoAct2::e_hidden; + m_timeSinceLastStage = 0; if (m_nextBrick < 6) { m_bricks[m_nextBrick].Create(m_nextBrick); @@ -655,7 +656,7 @@ MxLong LegoAct2::HandlePathStruct(LegoPathStructNotificationParam& p_param) // FUNCTION: LEGO1 0x100516b0 // FUNCTION: BETA10 0x1003bcbc -MxResult LegoAct2::FUN_100516b0() +MxResult LegoAct2::CreateBrick() { if (m_nextBrick > 4) { return FAILURE; @@ -673,8 +674,8 @@ MxResult LegoAct2::FUN_100516b0() brick.Place(local2world, local2world2, boundary); m_nextBrick++; - m_unk0x10c4 = 9; - m_unk0x10d0 = 0; + m_state = LegoAct2::e_droppingBrick; + m_timeSinceLastStage = 0; return SUCCESS; } @@ -721,7 +722,7 @@ void LegoAct2::FUN_10051900() // FUNCTION: LEGO1 0x10051960 // FUNCTION: BETA10 0x1003bf2c -void LegoAct2::FUN_10051960() +void LegoAct2::HideMaPaInfo() { LegoROI* roi; @@ -938,94 +939,94 @@ MxResult LegoAct2::BadEnding() TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); MxTrace("Bad End of Act2\n"); - m_unk0x10c4 = 14; + m_state = LegoAct2::e_allPiecesCollected; EmitGameEvent(e_badEnding); return SUCCESS; } // FUNCTION: LEGO1 0x10051fa0 // FUNCTION: BETA10 0x10013fd3 -void LegoAct2::FUN_10051fa0(MxS32 p_param1) +void LegoAct2::CheckBricksterDestroying(MxS32 p_pathData) { MxU8 randN = SDL_rand(3); randN++; - switch (p_param1) { + switch (p_pathData) { case 2: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx50bu_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx50bu_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx51bu_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx51bu_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; case 8: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx29nu_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx29nu_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx30nu_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx30nu_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; case 9: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx33na_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx33na_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx34na_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx34na_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; case 14: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx46cl_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx46cl_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx48cl_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx48cl_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; case 23: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx58va_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx58va_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx60va_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx60va_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; case 24: case 25: - FUN_10052560(Act2mainScript::c_snsx31sh_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx31sh_RunAnim, TRUE, FALSE, NULL, NULL, NULL); break; case 26: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx52sn_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx52sn_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx53sn_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx53sn_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; case 34: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx15la_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx15la_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx16la_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx16la_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; case 36: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx10ni_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx10ni_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx11ni_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx11ni_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; case 38: case 42: if (randN == 1) { - FUN_10052560(Act2mainScript::c_snsx03ma_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx03ma_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } else { - FUN_10052560(Act2mainScript::c_snsx04ma_RunAnim, TRUE, FALSE, NULL, NULL, NULL); + StartAction(Act2mainScript::c_snsx04ma_RunAnim, TRUE, FALSE, NULL, NULL, NULL); } break; } @@ -1033,44 +1034,44 @@ void LegoAct2::FUN_10051fa0(MxS32 p_param1) // FUNCTION: LEGO1 0x100521f0 // FUNCTION: BETA10 0x100142f1 -void LegoAct2::FUN_100521f0(MxS32 p_param1) +void LegoAct2::CheckBricksterIsLoose(MxS32 p_pathData) { Act2mainScript::Script objectId = (Act2mainScript::Script) 0; - Mx3DPointFloat vec; + Mx3DPointFloat actorPosition; - switch (p_param1) { + switch (p_pathData) { case 0x02: { - vec = Mx3DPointFloat(-9.1f, 0.0f, -16.5f); + actorPosition = Mx3DPointFloat(-9.1f, 0.0f, -16.5f); VariableTable()->SetVariable("ACTOR_01", "bd"); objectId = Act2mainScript::c_tns030bd_RunAnim; break; } case 0x2a: { - vec = Mx3DPointFloat(-9.67f, 0.0f, -44.3f); + actorPosition = Mx3DPointFloat(-9.67f, 0.0f, -44.3f); VariableTable()->SetVariable("ACTOR_01", "rd"); objectId = Act2mainScript::c_tns030rd_RunAnim; break; } case 0x133: { - vec = Mx3DPointFloat(25.75f, 0.0f, -13.0f); + actorPosition = Mx3DPointFloat(25.75f, 0.0f, -13.0f); VariableTable()->SetVariable("ACTOR_01", "pg"); objectId = Act2mainScript::c_tns030pg_RunAnim; break; } case 0x134: { - vec = Mx3DPointFloat(43.63f, 0.0f, -46.33f); + actorPosition = Mx3DPointFloat(43.63f, 0.0f, -46.33f); VariableTable()->SetVariable("ACTOR_01", "sy"); objectId = Act2mainScript::c_tns030sy_RunAnim; break; } case 0x135: { - vec = Mx3DPointFloat(50.0f, 0.0f, -34.6f); + actorPosition = Mx3DPointFloat(50.0f, 0.0f, -34.6f); VariableTable()->SetVariable("ACTOR_01", "rd"); objectId = Act2mainScript::c_tns030rd_RunAnim; break; } case 0x138: { - vec = Mx3DPointFloat(-41.15f, 4.0f, 31.0f); + actorPosition = Mx3DPointFloat(-41.15f, 4.0f, 31.0f); VariableTable()->SetVariable("ACTOR_01", "sy"); objectId = Act2mainScript::c_tns030sy_RunAnim; break; @@ -1078,30 +1079,30 @@ void LegoAct2::FUN_100521f0(MxS32 p_param1) } if (objectId != (Act2mainScript::Script) 0) { - Mx3DPointFloat local30(vec); + Mx3DPointFloat lookingAtPepper(actorPosition); Mx3DPointFloat position(m_pepper->GetWorldPosition()); - local30 -= position; - Mx3DPointFloat local44 = local30; - local30.Unitize(); - FUN_10052560(objectId, TRUE, TRUE, &vec, &local30, NULL); + lookingAtPepper -= position; + Mx3DPointFloat local44 = lookingAtPepper; + lookingAtPepper.Unitize(); + StartAction(objectId, TRUE, TRUE, &actorPosition, &lookingAtPepper, NULL); } } // FUNCTION: LEGO1 0x10052560 // FUNCTION: BETA10 0x100145c6 -MxResult LegoAct2::FUN_10052560( +MxResult LegoAct2::StartAction( Act2mainScript::Script p_objectId, - MxBool p_param2, - MxBool p_param3, + MxBool p_isAnimation, + MxBool p_ignoreCurrentAction, Mx3DPointFloat* p_location, Mx3DPointFloat* p_direction, Mx3DPointFloat* p_param6 ) { - if (m_unk0x1140 == (Act2mainScript::Script) 0 || p_param3) { + if (m_currentAction == (Act2mainScript::Script) 0 || p_ignoreCurrentAction) { assert(strlen(m_siFile)); - if (!p_param2) { + if (!p_isAnimation) { MxDSAction action; action.SetObjectId(p_objectId); @@ -1189,7 +1190,7 @@ MxResult LegoAct2::FUN_10052560( } if (result == SUCCESS) { - m_unk0x1140 = p_objectId; + m_currentAction = p_objectId; } } } @@ -1199,7 +1200,7 @@ MxResult LegoAct2::FUN_10052560( // FUNCTION: LEGO1 0x10052800 // FUNCTION: BETA10 0x10014aa8 -MxResult LegoAct2::FUN_10052800() +MxResult LegoAct2::InitializeShooting() { LegoPathActor* actor = m_unk0x1138; LegoLocomotionAnimPresenter* ap; @@ -1223,6 +1224,6 @@ MxResult LegoAct2::FUN_10052800() ap->FUN_1006d680(m_unk0x1138, -1.0f); actor->SetWorldSpeed(0.0f); - m_unk0x1138->FUN_10018980(); + m_unk0x1138->InitializeNextShot(); return SUCCESS; } diff --git a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp index 28407834..a3e068f0 100644 --- a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp +++ b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp @@ -49,17 +49,17 @@ RegistrationBook::RegistrationBook() : m_registerDialogueTimer(0x80000000), m_un memset(m_alphabet, 0, sizeof(m_alphabet)); memset(m_intAlphabet, 0, sizeof(m_intAlphabet)); memset(m_name, 0, sizeof(m_name)); - m_unk0x280.m_cursorPos = 0; + m_newName.m_cursorPos = 0; memset(m_checkmark, 0, sizeof(m_checkmark)); - memset(&m_unk0x280, -1, sizeof(m_unk0x280) - 2); + memset(&m_newName, -1, sizeof(m_newName) - 2); - m_unk0x2b8 = 0; + m_vehiclesToPosition = 0; m_infocenterState = NULL; NotificationManager()->Register(this); - m_unk0x2c1 = FALSE; + m_awaitLoad = FALSE; m_checkboxHilite = NULL; m_checkboxSurface = NULL; m_checkboxNormal = NULL; @@ -155,9 +155,9 @@ MxLong RegistrationBook::HandleEndAction(MxEndActionNotificationParam& p_param) switch ((MxS32) p_param.GetAction()->GetObjectId()) { case RegbookScript::c_Textures: - m_unk0x2c1 = FALSE; + m_awaitLoad = FALSE; - if (m_unk0x2b8 == 0) { + if (m_vehiclesToPosition == 0) { TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } break; @@ -198,40 +198,40 @@ MxLong RegistrationBook::HandleKeyPress(SDL_Keycode p_key) BackgroundAudioManager()->RaiseVolume(); } } - else if (key != SDLK_BACKSPACE && m_unk0x280.m_cursorPos < 7) { - m_name[0][m_unk0x280.m_cursorPos] = (*intoAlphabet)->Clone(); + else if (key != SDLK_BACKSPACE && m_newName.m_cursorPos < 7) { + m_name[0][m_newName.m_cursorPos] = (*intoAlphabet)->Clone(); - if (m_name[0][m_unk0x280.m_cursorPos] != NULL) { + if (m_name[0][m_newName.m_cursorPos] != NULL) { (*intoAlphabet)->GetAction()->SetUnknown24((*intoAlphabet)->GetAction()->GetUnknown24() + 1); - m_name[0][m_unk0x280.m_cursorPos]->Enable(TRUE); - m_name[0][m_unk0x280.m_cursorPos]->SetTickleState(MxPresenter::e_repeating); - m_name[0][m_unk0x280.m_cursorPos]->SetPosition(m_unk0x280.m_cursorPos * 23 + 343, 121); + m_name[0][m_newName.m_cursorPos]->Enable(TRUE); + m_name[0][m_newName.m_cursorPos]->SetTickleState(MxPresenter::e_repeating); + m_name[0][m_newName.m_cursorPos]->SetPosition(m_newName.m_cursorPos * 23 + 343, 121); - if (m_unk0x280.m_cursorPos == 0) { + if (m_newName.m_cursorPos == 0) { m_checkmark[0]->Enable(TRUE); } - m_unk0x280.m_letters[m_unk0x280.m_cursorPos] = + m_newName.m_letters[m_newName.m_cursorPos] = key >= SDLK_A && key <= SDLK_Z ? key - SDLK_A : (intoAlphabet - m_intAlphabet) + sizeOfArray(m_alphabet) - m_intAlphabetOffset; - m_unk0x280.m_cursorPos++; + m_newName.m_cursorPos++; } } else { - if (key == SDLK_BACKSPACE && m_unk0x280.m_cursorPos > 0) { - m_unk0x280.m_cursorPos--; + if (key == SDLK_BACKSPACE && m_newName.m_cursorPos > 0) { + m_newName.m_cursorPos--; - m_name[0][m_unk0x280.m_cursorPos]->Enable(FALSE); + m_name[0][m_newName.m_cursorPos]->Enable(FALSE); - delete m_name[0][m_unk0x280.m_cursorPos]; - m_name[0][m_unk0x280.m_cursorPos] = NULL; + delete m_name[0][m_newName.m_cursorPos]; + m_name[0][m_newName.m_cursorPos] = NULL; - if (m_unk0x280.m_cursorPos == 0) { + if (m_newName.m_cursorPos == 0) { m_checkmark[0]->Enable(FALSE); } - m_unk0x280.m_letters[m_unk0x280.m_cursorPos] = -1; + m_newName.m_letters[m_newName.m_cursorPos] = -1; } } @@ -298,7 +298,7 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa } } - FUN_100775c0(i); + LoadSave(i); } } @@ -307,56 +307,57 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa // FUNCTION: LEGO1 0x100775c0 // STUB: BETA10 0x100f32b2 -void RegistrationBook::FUN_100775c0(MxS16 p_playerIndex) +void RegistrationBook::LoadSave(MxS16 p_checkMarkIndex) { if (m_infocenterState->HasRegistered()) { GameState()->Save(0); } + // The first checkmark searches for the name and is -1 if not found, while all other checkmarks start at 1 // TODO: structure incorrect - MxS16 player = p_playerIndex == 0 ? GameState()->FindPlayer(*(LegoGameState::Username*) &m_unk0x280.m_letters) - : p_playerIndex - 1; + MxS16 player = p_checkMarkIndex == 0 ? GameState()->FindPlayer(*(LegoGameState::Username*) &m_newName.m_letters) + : p_checkMarkIndex - 1; switch (player) { - case 0: + case 0: // Current save if (!m_infocenterState->HasRegistered()) { GameState()->SwitchPlayer(0); WriteInfocenterLetters(1); - FUN_100778c0(); + LoadVehicles(); } break; - case -1: + case -1: // New save GameState()->Init(); PlayAction(RegbookScript::c_Textures); - m_unk0x2c1 = TRUE; + m_awaitLoad = TRUE; // TOOD: structure incorrect - GameState()->AddPlayer(*(LegoGameState::Username*) &m_unk0x280.m_letters); + GameState()->AddPlayer(*(LegoGameState::Username*) &m_newName.m_letters); GameState()->Save(0); WriteInfocenterLetters(0); - GameState()->SerializePlayersInfo(2); - FUN_100778c0(); + GameState()->SerializePlayersInfo(LegoFile::c_write); + LoadVehicles(); break; default: GameState()->Init(); PlayAction(RegbookScript::c_Textures); - m_unk0x2c1 = TRUE; + m_awaitLoad = TRUE; GameState()->SwitchPlayer(player); WriteInfocenterLetters(player + 1); - GameState()->SerializePlayersInfo(2); - FUN_100778c0(); + GameState()->SerializePlayersInfo(LegoFile::c_write); + LoadVehicles(); break; } m_infocenterState->m_state = InfocenterState::e_selectedSave; - if (m_unk0x2b8 == 0 && !m_unk0x2c1) { + if (m_vehiclesToPosition == 0 && !m_awaitLoad) { DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } @@ -373,7 +374,7 @@ void RegistrationBook::WriteInfocenterLetters(MxS16 p_user) } // FUNCTION: LEGO1 0x100778c0 -void RegistrationBook::FUN_100778c0() +void RegistrationBook::LoadVehicles() { if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); @@ -385,7 +386,7 @@ void RegistrationBook::FUN_100778c0() LegoPathStructNotificationParam(c_notificationPathStruct, NULL, 0, CopterScript::c_Helicopter_Actor) ); - m_unk0x2b8++; + m_vehiclesToPosition++; } if (act1state->m_jetskiPlane.IsPresent()) { @@ -395,7 +396,7 @@ void RegistrationBook::FUN_100778c0() LegoPathStructNotificationParam(c_notificationPathStruct, NULL, 0, JetskiScript::c_Jetski_Actor) ); - m_unk0x2b8++; + m_vehiclesToPosition++; } if (act1state->m_dunebuggyPlane.IsPresent()) { @@ -405,7 +406,7 @@ void RegistrationBook::FUN_100778c0() LegoPathStructNotificationParam(c_notificationPathStruct, NULL, 0, DunecarScript::c_DuneBugy_Actor) ); - m_unk0x2b8++; + m_vehiclesToPosition++; } if (act1state->m_racecarPlane.IsPresent()) { @@ -415,10 +416,10 @@ void RegistrationBook::FUN_100778c0() LegoPathStructNotificationParam(c_notificationPathStruct, NULL, 0, RacecarScript::c_RaceCar_Actor) ); - m_unk0x2b8++; + m_vehiclesToPosition++; } - if (m_unk0x2b8 != 0) { + if (m_vehiclesToPosition != 0) { DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); InputManager()->DisableInputProcessing(); SetAppCursor(e_cursorBusy); @@ -656,10 +657,10 @@ MxLong RegistrationBook::HandlePathStruct(LegoPathStructNotificationParam& p_par else { RemoveActor(actor); Remove(actor); - m_unk0x2b8--; + m_vehiclesToPosition--; } - if (m_unk0x2b8 == 0 && !m_unk0x2c1) { + if (m_vehiclesToPosition == 0 && !m_awaitLoad) { DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } diff --git a/LEGO1/mxgeometry/mxgeometry3d.h b/LEGO1/mxgeometry/mxgeometry3d.h index f9f8fa49..81f33bd1 100644 --- a/LEGO1/mxgeometry/mxgeometry3d.h +++ b/LEGO1/mxgeometry/mxgeometry3d.h @@ -22,11 +22,11 @@ class Mx3DPointFloat : public Vector3 { } // FUNCTION: LEGO1 0x100343a0 - // FUNCTION: BETA10 0x10011600 + // FUNCTION: BETA10 0x100151e0 Mx3DPointFloat(const Mx3DPointFloat& p_other) : Vector3(m_elements) { EqualsImpl(p_other.m_data); } // FUNCTION: LEGO1 0x10048ed0 - // FUNCTION: BETA10 0x100151e0 + // FUNCTION: BETA10 0x10011600 Mx3DPointFloat(const Vector3& p_other) : Vector3(m_elements) { EqualsImpl(p_other.m_data); } // FUNCTION: LEGO1 0x10003c10 diff --git a/LEGO1/mxgeometry/mxmatrix.h b/LEGO1/mxgeometry/mxmatrix.h index 7fc5c605..7ae5d439 100644 --- a/LEGO1/mxgeometry/mxmatrix.h +++ b/LEGO1/mxgeometry/mxmatrix.h @@ -14,10 +14,10 @@ class MxMatrix : public Matrix4 { // FUNCTION: LEGO1 0x10032770 // FUNCTION: BETA10 0x1001ff30 - MxMatrix(const MxMatrix& p_matrix) : Matrix4(m_elements) { Equals(p_matrix); } + MxMatrix(const MxMatrix& p_matrix) : Matrix4(m_elements) { CopyFrom(p_matrix); } // FUNCTION: BETA10 0x1000fc20 - MxMatrix(const Matrix4& p_matrix) : Matrix4(m_elements) { Equals(p_matrix); } + MxMatrix(const Matrix4& p_matrix) : Matrix4(m_elements) { CopyFrom(p_matrix); } // FUNCTION: BETA10 0x10010860 float* operator[](int idx) { return m_data[idx]; } @@ -25,10 +25,10 @@ class MxMatrix : public Matrix4 { const float* operator[](int idx) const { return m_data[idx]; } // FUNCTION: LEGO1 0x10002850 - void operator=(const Matrix4& p_matrix) override { Equals(p_matrix); } // vtable+0x28 + void operator=(const Matrix4& p_matrix) override { CopyFrom(p_matrix); } // vtable+0x28 // FUNCTION: LEGO1 0x10002860 - virtual void operator=(const MxMatrix& p_matrix) { Equals(p_matrix); } // vtable+0x48 + virtual void operator=(const MxMatrix& p_matrix) { CopyFrom(p_matrix); } // vtable+0x48 private: float m_elements[4][4]; // 0x08 diff --git a/LEGO1/omni/include/mxvideomanager.h b/LEGO1/omni/include/mxvideomanager.h index 08632f74..3e3266aa 100644 --- a/LEGO1/omni/include/mxvideomanager.h +++ b/LEGO1/omni/include/mxvideomanager.h @@ -47,7 +47,7 @@ class MxVideoManager : public MxPresentationManager { MxVideoParam& GetVideoParam() { return this->m_videoParam; } LPDIRECTDRAW GetDirectDraw() { return this->m_pDirectDraw; } - // FUNCTION: BETA10 0x1002e290 + // FUNCTION: BETA10 0x100969e0 MxDisplaySurface* GetDisplaySurface() { return this->m_displaySurface; } MxRegion* GetRegion() { return this->m_region; } diff --git a/LEGO1/realtime/matrix.h b/LEGO1/realtime/matrix.h index 1b8d1fdb..cd87da48 100644 --- a/LEGO1/realtime/matrix.h +++ b/LEGO1/realtime/matrix.h @@ -24,8 +24,8 @@ class Matrix4 { virtual ~Matrix4() {} - inline virtual void Equals(float (*p_data)[4]); // vtable+0x04 - inline virtual void Equals(const Matrix4& p_matrix); // vtable+0x00 + inline virtual void CopyFrom(float (*p_data)[4]); // vtable+0x04 + inline virtual void CopyFrom(const Matrix4& p_matrix); // vtable+0x00 inline virtual void SetData(float (*p_data)[4]); // vtable+0x0c inline virtual void SetData(UnknownMatrixType& p_matrix); // vtable+0x08 inline virtual float (*GetData())[4]; // vtable+0x14 diff --git a/LEGO1/realtime/matrix4d.inl.h b/LEGO1/realtime/matrix4d.inl.h index c1643f76..a5df1bc9 100644 --- a/LEGO1/realtime/matrix4d.inl.h +++ b/LEGO1/realtime/matrix4d.inl.h @@ -8,14 +8,14 @@ // FUNCTION: LEGO1 0x10002320 // FUNCTION: BETA10 0x1000fcb0 -void Matrix4::Equals(float (*p_data)[4]) +void Matrix4::CopyFrom(float (*p_data)[4]) { memcpy(m_data, p_data, sizeof(float) * 4 * 4); } // FUNCTION: LEGO1 0x10002340 // FUNCTION: BETA10 0x1000fcf0 -void Matrix4::Equals(const Matrix4& p_matrix) +void Matrix4::CopyFrom(const Matrix4& p_matrix) { memcpy(m_data, p_matrix.m_data, sizeof(float) * 4 * 4); } @@ -84,7 +84,7 @@ void Matrix4::SetIdentity() // FUNCTION: BETA10 0x1000ff20 void Matrix4::operator=(const Matrix4& p_matrix) { - Equals(p_matrix); + CopyFrom(p_matrix); } // FUNCTION: LEGO1 0x10002430 diff --git a/LEGO1/realtime/roi.h b/LEGO1/realtime/roi.h index dd5b9993..25829f7e 100644 --- a/LEGO1/realtime/roi.h +++ b/LEGO1/realtime/roi.h @@ -56,7 +56,7 @@ class BoundingSphere { // BoundingSphere::operator= // SYNTHETIC: BETA10 0x1001fc50 - // BoundingSphere::BoundingSphere + // ??0BoundingSphere@@QAE@XZ private: Mx3DPointFloat center; // 0x00 diff --git a/LEGO1/viewmanager/viewmanager.cpp b/LEGO1/viewmanager/viewmanager.cpp index a6f4aaba..aaf37eec 100644 --- a/LEGO1/viewmanager/viewmanager.cpp +++ b/LEGO1/viewmanager/viewmanager.cpp @@ -270,6 +270,7 @@ inline void ViewManager::ManageVisibilityAndDetailRecursively(ViewROI* p_from, i p_from->SetLodLevel(ViewROI::c_lodLevelUnset); for (CompoundObject::const_iterator it = comp->begin(); it != comp->end(); it++) { + // LINE: BETA10 0x10172bbd ManageVisibilityAndDetailRecursively((ViewROI*) *it, p_lodLevel); } }