23 Commits

Author SHA1 Message Date
MS
828254cbfe Entropy CI: Use new virtualenv upon retry (#1695) 2025-10-14 19:52:09 -04:00
jonschz
fe5a238ae1 Add SmartHeap for LEGO1 (#1694)
---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-10-12 07:36:36 +02:00
jonschz
e355b55907 Fix some library globals (#1692)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-10-09 22:28:38 +02:00
Fabian Neundorf
9531678dfd Clear unknowns in LegoCarBuild (#1691) 2025-10-07 23:04:02 +02:00
Fabian Neundorf
d05d583368 Clear unknown parameter in LegoEntity::SetROI (#1688) 2025-09-21 11:11:04 -07:00
jonschz
c06ffe71b5 Add name substitution config (#1680)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-09-13 06:51:45 +02:00
Fabian Neundorf
6c83ceb549 Clear unknowns in Act2Actor (#1687) 2025-09-12 21:22:48 +02:00
Fabian Neundorf
0832bedbf2 Improve naming for Equals in MxMatrix (#1685) 2025-09-08 18:21:12 -07:00
Fabian Neundorf
4460d2a33d Clear unknowns in LegoVehicleBuildState (#1684) 2025-09-08 09:19:49 -07:00
Fabian Neundorf
ef2d438a7d Clear unknowns in LegoCarBuildAnimPresenter (#1683) 2025-09-07 15:07:39 -07:00
Fabian Neundorf
e3b77fb50b Clear unknowns in LegoAct2 (#1679) 2025-09-07 22:54:22 +02:00
jonschz
48febaf5c5 Match Mx3DPointFloat overloads on BETA10 (#1682)
* Match Mx3DPointFloat overloads on BETA10

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-09-07 17:16:36 +02:00
jonschz
a7c43cbe17 Small BETA10 corrections (#1681)
* Small BETA10 corrections

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2025-09-06 17:39:28 +02:00
Fabian Neundorf
190c040c96 Clear unknowns in LegoWorld (#1674) 2025-08-25 15:13:10 -04:00
Fabian Neundorf
34293a9c04 Clear unknowns in RegistrationBook (#1678) 2025-08-25 08:18:56 -04:00
Christian Semmler
7c95890cad Remove obsolete enums in Infocenter (#1677) 2025-08-21 00:04:08 +02:00
Christian Semmler
689b44d87c Make atoms in RemoveFromWorld const& (#1676) 2025-08-10 21:53:27 +02:00
Fabian Neundorf
15fec495e5 Clear unknowns in Act2Brick (#1675) 2025-08-09 18:05:43 +02:00
Fabian Neundorf
61eaea8bb4 Clear unknowns in LegoAnimActorStruct and LegoAnimActor (#1673) 2025-08-09 17:40:12 +02:00
Fabian Neundorf
1a317a3ef8 Clear unknowns in LegoEntity (#1672) 2025-08-09 17:38:59 +02:00
Fabian Neundorf
4eba95c309 Clear unknowns in LegoAct2State (#1671) 2025-08-09 00:38:37 +02:00
Fabian Neundorf
33c4d1fdcb Clear unknowns in LegoGameState (#1670) 2025-08-08 12:32:37 -07:00
Fabian Neundorf
3d6ab8ff9d Name g_plantInfo indices in act2actor.cpp (#1669) 2025-08-08 12:31:39 -07:00
72 changed files with 1713 additions and 1305 deletions

View File

@@ -38,7 +38,7 @@ jobs:
- name: Cache venv
uses: actions/cache@v4
with:
key: venv-entropy-${{ github.run_id }}
key: venv-entropy-${{ github.run_id }}-${{ github.run_attempt }}
path: .venv
- name: Install python packages
@@ -97,7 +97,7 @@ jobs:
- name: Restore cached virtualenv
uses: actions/cache@v4
with:
key: venv-entropy-${{ github.run_id }}
key: venv-entropy-${{ github.run_id }}-${{ github.run_attempt }}
path: .venv
- name: Prepare builds
@@ -166,7 +166,7 @@ jobs:
- name: Restore cached virtualenv
uses: actions/cache@v4
with:
key: venv-entropy-${{ github.run_id }}
key: venv-entropy-${{ github.run_id }}-${{ github.run_attempt }}
path: .venv
- name: Aggregate Accuracy

View File

@@ -324,9 +324,6 @@
// GLOBAL: ISLE 0x411850
// __cflush
// XGLOBAL ISLE 0x4125f8
// ?_pnhHeap@@3P6AHI@ZA
// GLOBAL: ISLE 0x412888
// ___setlc_active

View File

@@ -14,18 +14,24 @@ public:
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();
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) override; // vtable+0x24
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform) override; // vtable+0x24
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
// 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 @@ public:
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 @@ public:
// `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
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_unk0x38; // 0x38
LegoCacheSound* m_cachedShootSound; // 0x38
undefined4 m_unk0x3c; // 0x3c
undefined m_unk0x40; // 0x40
MxFloat m_unk0x44; // 0x44
MxS8 m_unk0x48; // 0x48
LegoEntity* m_unk0x4c; // 0x4c
MxBool m_initializing; // 0x40
MxFloat m_resetWorldSpeedAt; // 0x44
MxS8 m_visitedLocations; // 0x48
LegoEntity* m_nextEntity; // 0x4c
};
// TEMPLATE: LEGO1 0x100194f0

View File

@@ -8,6 +8,13 @@
// SIZE 0x194
class Act2Brick : public LegoPathActor {
public:
enum {
e_removed = 0,
e_created = 1,
e_placed = 2,
e_atRest = 3,
};
Act2Brick();
~Act2Brick() override; // vtable+0x00
@@ -35,7 +42,7 @@ public:
MxResult Create(MxS32 p_index);
void Remove();
void FUN_1007a670(MxMatrix& p_param1, MxMatrix& p_param2, LegoPathBoundary* p_boundary);
void Place(MxMatrix& p_localToWorld, MxMatrix& p_endLocalToWorld, LegoPathBoundary* p_boundary);
void PlayWhistleSound();
void StopWhistleSound();
void Mute(MxBool p_muted);
@@ -46,10 +53,10 @@ private:
LegoCacheSound* m_whistleSound; // 0x154
undefined m_unk0x158[0x0c]; // 0x158
undefined4 m_unk0x164; // 0x164
Mx3DPointFloat m_unk0x168; // 0x168
Mx3DPointFloat m_unk0x17c; // 0x17c
MxS32 m_unk0x190; // 0x190
MxU32 m_state; // 0x164
Mx3DPointFloat m_localToWorldMovementStep; // 0x168
Mx3DPointFloat m_endLocalToWorld; // 0x17c
MxS32 m_step; // 0x190
};
#endif // ACT2BRICK_H

View File

@@ -106,7 +106,7 @@ public:
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

View File

@@ -18,7 +18,7 @@ public:
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

View File

@@ -75,7 +75,7 @@ public:
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

View File

@@ -79,7 +79,7 @@ public:
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

View File

@@ -119,25 +119,6 @@ struct InfocenterMapEntry {
// SIZE 0x1d8
class Infocenter : public LegoWorld {
public:
enum Cutscene {
e_noIntro = -1,
e_legoMovie,
e_mindscapeMovie,
e_introMovie,
e_outroMovie,
e_badEndMovie,
e_goodEndMovie
};
enum Character {
e_noCharacter = 0,
e_pepper,
e_mama,
e_papa,
e_nick,
e_laura
};
Infocenter();
~Infocenter() override;
@@ -160,7 +141,7 @@ public:
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
@@ -180,7 +161,7 @@ private:
void UpdateFrameHot(MxBool p_display);
void Reset();
void PlayCutscene(Cutscene p_entityId, MxBool p_scale);
void PlayCutscene(IntroScript::Script p_entityId, MxBool p_scale);
void StopCutscene();
void UpdateEnabledGlowControl(MxS32 p_x, MxS32 p_y);
@@ -198,7 +179,7 @@ private:
MxS16 m_selectedCharacter; // 0xfc
InfocenterState* m_infocenterState; // 0x100
LegoGameState::Area m_destLocation; // 0x104
Cutscene m_currentCutscene; // 0x108
IntroScript::Script m_currentCutscene; // 0x108
Radio m_radio; // 0x10c
MxStillPresenter* m_dragPresenter; // 0x11c
InfocenterMapEntry m_glowInfo[7]; // 0x120

View File

@@ -17,7 +17,7 @@ public:
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

View File

@@ -134,7 +134,7 @@ public:
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

View File

@@ -60,7 +60,7 @@ public:
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

View File

@@ -15,9 +15,13 @@ class MxEndActionNotificationParam;
// SIZE 0x10
class LegoAct2State : public LegoState {
public:
enum {
c_badEnding = 104
};
LegoAct2State()
{
m_unk0x08 = 0;
m_state = 0;
m_enabled = FALSE;
}
~LegoAct2State() override {}
@@ -43,13 +47,13 @@ public:
// LegoAct2State::`scalar deleting destructor'
// FUNCTION: BETA10 0x100151b0
void SetUnknown0x08(undefined4 p_unk0x08) { m_unk0x08 = p_unk0x08; }
void SetState(MxU32 p_state) { m_state = p_state; }
undefined4 GetUnknown0x08() { return m_unk0x08; }
MxU32 GetState() { return m_state; }
// TODO: Most likely getters/setters are not used according to BETA. (?)
undefined4 m_unk0x08; // 0x08
MxU32 m_state; // 0x08
MxBool m_enabled; // 0x0c
};
@@ -67,7 +71,7 @@ public:
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
@@ -76,10 +80,10 @@ public:
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,
@@ -92,42 +96,59 @@ public:
// 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
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_unk0x1140; // 0x1140
Act2mainScript::Script m_unk0x1144; // 0x1144
Act2mainScript::Script m_currentAction; // 0x1140
Act2mainScript::Script m_infomanDirecting; // 0x1144
undefined4 m_unk0x1148; // 0x1148
undefined m_firstBrick; // 0x114c
undefined m_secondBrick; // 0x114d

View File

@@ -41,7 +41,7 @@ public:
}
void ParseAction(char* p_extra) override; // vtable+0x20
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) override; // vtable+0x24
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform) override; // vtable+0x24
// FUNCTION: LEGO1 0x10002cc0
// FUNCTION: BETA10 0x1000f3e0

View File

@@ -8,13 +8,13 @@ class LegoAnim;
// SIZE 0x20
struct LegoAnimActorStruct {
LegoAnimActorStruct(float p_unk0x00, LegoAnim* p_AnimTreePtr, LegoROI** p_roiMap, MxU32 p_numROIs);
LegoAnimActorStruct(float p_worldSpeed, LegoAnim* p_AnimTreePtr, LegoROI** p_roiMap, MxU32 p_numROIs);
~LegoAnimActorStruct();
float GetDuration();
// FUNCTION: BETA10 0x1000fb10
float GetUnknown0x00() { return m_unk0x00; }
float GetWorldSpeed() { return m_worldSpeed; }
// FUNCTION: BETA10 0x10012210
LegoAnim* GetAnimTreePtr() { return m_AnimTreePtr; }
@@ -23,7 +23,7 @@ struct LegoAnimActorStruct {
LegoROI** GetROIMap() { return m_roiMap; }
// TODO: Possibly private
float m_unk0x00; // 0x00
float m_worldSpeed; // 0x00
LegoAnim* m_AnimTreePtr; // 0x04
LegoROI** m_roiMap; // 0x08
MxU32 m_numROIs; // 0x0c
@@ -47,9 +47,14 @@ public:
void Animate(float p_time) override; // vtable+0x70
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
virtual MxResult FUN_1001c1f0(float& p_und);
virtual MxResult FUN_1001c360(float, Matrix4& p_transform);
virtual MxResult FUN_1001c450(LegoAnim* p_AnimTreePtr, float p_unk0x00, LegoROI** p_roiMap, MxU32 p_numROIs);
virtual MxResult GetTimeInCycle(float& p_timeInCycle);
virtual MxResult AnimateWithTransform(float p_time, Matrix4& p_transform);
virtual MxResult CreateAnimActorStruct(
LegoAnim* p_AnimTreePtr,
float p_worldSpeed,
LegoROI** p_roiMap,
MxU32 p_numROIs
);
virtual void ClearMaps();
// FUNCTION: LEGO1 0x1000fba0

View File

@@ -231,7 +231,7 @@ private:
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);

View File

@@ -20,11 +20,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
};
@@ -57,9 +57,9 @@ public:
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
};
@@ -75,18 +75,28 @@ class LegoCarBuild : public LegoWorld {
public:
// SIZE 0x1c
struct LookupTableActions {
undefined4 m_unk0x00; // 0x00
undefined4 m_unk0x04; // 0x04
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
undefined4 m_unk0x10; // 0x10
undefined4 m_unk0x14; // 0x14
undefined4 m_unk0x18; // 0x18
MxU32 m_introduction0; // 0x00
MxU32 m_leaveUnfinished; // 0x04
MxU32 m_completed; // 0x08
MxU32 m_introduction1; // 0x0c
MxU32 m_introduction2; // 0x10
MxU32 m_introduction3; // 0x14
MxU32 m_shortExplanation; // 0x18
};
enum Unknown0xf8 {
c_unknownminusone = -1,
c_unknown8 = 8
enum LookupTableActionType {
e_introduction0 = 0,
e_introduction1 = 1,
e_introduction2 = 2,
e_introduction3 = 3,
e_leaveUnfinished = 4,
e_completed = 5,
e_shortExplanation = 6,
};
enum ResetPlacedSelectedPart {
c_disabled = -1,
c_enabled = 8
};
LegoCarBuild();
@@ -94,7 +104,7 @@ public:
// 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
@@ -117,11 +127,11 @@ public:
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
virtual void VTable0x6c(); // vtable+0x6c
virtual void VTable0x70(); // vtable+0x70
virtual void VTable0x74(MxFloat p_param1[2], MxFloat p_param2[3]); // vtable+0x74
virtual void VTable0x78(MxFloat p_param1[2], MxFloat p_param2[3]); // vtable+0x78
virtual void VTable0x7c(MxFloat p_param1[2], MxFloat p_param2[3]); // vtable+0x7c
virtual void InitializeDisplayingTransform(); // vtable+0x6c
virtual void CalculateStartAndTargetScreenPositions(); // vtable+0x70
virtual void CalculateDragPositionAbove(MxFloat p_coordinates[2], MxFloat p_position[3]); // vtable+0x74
virtual void CalculateDragPositionBetween(MxFloat p_coordinates[2], MxFloat p_position[3]); // vtable+0x78
virtual void CalculateDragPositionOnGround(MxFloat p_coordinates[2], MxFloat p_position[3]); // vtable+0x7c
virtual void VTable0x80(
MxFloat p_param1[2],
MxFloat p_param2[2],
@@ -132,33 +142,33 @@ public:
MxS16 GetPlacedPartCount();
void SetPlacedPartCount(MxU8 p_placedPartCount);
void InitPresenters();
void FUN_10022f00();
void FUN_10022f30();
void FUN_10023130(MxLong p_x, MxLong p_y);
void DisplaySelectedPart();
void ResetSelectedPart();
void CalculateSelectedPartMatrix(MxLong p_x, MxLong p_y);
void AddSelectedPartToBuild();
undefined4 FUN_10024250(LegoEventNotificationParam* p_param);
void FUN_100243a0();
undefined4 FUN_10024480(MxActionNotificationParam* p_param);
undefined4 SelectPartFromMousePosition(MxLong p_x, MxLong p_y);
undefined4 FUN_100246e0(MxLong p_x, MxLong p_y);
MxS32 FUN_10024850(MxLong p_x, MxLong p_y);
undefined4 FUN_10024890(MxParam* p_param);
undefined4 FUN_10024c20(MxNotificationParam* p_param);
void FUN_10024ef0();
void FUN_10024f30();
void FUN_10024f50();
void FUN_10024f70(MxBool p_enabled);
void SetPresentersEnabled(MxBool p_enabled);
void TogglePresentersEnabled();
void FUN_100250e0(MxBool p_param);
void FUN_10025350(MxS32 p_objectId);
void FUN_10025450();
void FUN_10025720(undefined4 p_param1);
void FUN_10025d10(MxS32 p_param);
MxS32 FUN_10025d70();
void FUN_10025db0(const char* p_param1, undefined4 p_param2);
void FUN_10025e40();
MxS32 FUN_10025ee0(undefined4 p_param1);
MxLong HandleKeyPress(LegoEventNotificationParam* p_param);
void InitExiting();
MxLong HandleEndAction(MxActionNotificationParam* p_param);
MxLong SelectPartFromMousePosition(MxLong p_x, MxLong p_y);
MxLong HandleButtonUp(MxLong p_x, MxLong p_y);
MxLong HandleMouseMove(MxLong p_x, MxLong p_y);
MxLong HandleControl(MxParam* p_param);
MxLong HandleType0Notification(MxNotificationParam* p_param);
void StartIntroduction();
void MoveShelves();
void RotateVehicle();
void EnableColorControlsForSelectedPart(MxBool p_enabled);
void SetColorControlsEnabled(MxBool p_enabled);
void ToggleColorControlsEnabled();
void EnableDecalForSelectedPart(MxBool p_enabled);
void SetPartColor(MxS32 p_objectId);
void CalculateStartAndTargetTransforms();
void StartActorScriptByType(MxS32 p_actionType);
void StartActorScript(MxS32 p_streamId);
MxS32 GetNextIntroduction();
void TickleControl(const char* p_controlName, MxULong p_time);
void HandleEndAnim();
MxS32 GetBuildMovieId(MxS32 p_carId);
// FUNCTION: BETA10 0x100735b0
void SetCarBuildAnimPresenter(LegoCarBuildAnimPresenter* p_animPresenter) { m_animPresenter = p_animPresenter; }
@@ -167,43 +177,45 @@ public:
// LegoCarBuild::`scalar deleting destructor'
private:
// inline functions
MxU32 Beta0x10070520();
void StopActionIn0x344();
enum {
e_idle = 0,
e_returning = 3,
e_selecting = 4,
e_displaying = 5,
e_dragging = 6,
};
Unknown0xf8 m_unk0xf8; // 0xf8
MxS16 m_unk0xfc; // 0xfc
MxS32 m_unk0x100; // 0x100
// inline functions
MxU32 GetLookupIndex();
void StopPlayingActorScript();
ResetPlacedSelectedPart m_resetPlacedSelectedPart; // 0xf8
MxS16 m_rotateBuild; // 0xfc
MxS32 m_clickState; // 0x100
undefined4 m_unk0x104; // 0x104
// name verified by BETA10 0x1006ebba
MxS8 m_numAnimsRun; // 0x108
MxU8 m_unk0x109; // 0x109
MxU16 m_unk0x10a; // 0x10a
DWORD m_unk0x10c; // 0x10c
MxU8 m_missclickCounter; // 0x109
MxU16 m_lastActorScript; // 0x10a
MxULong m_lastActorScriptStartTime; // 0x10c
LegoROI* m_selectedPart; // 0x110
BoundingSphere m_unk0x114; // 0x114
MxMatrix m_unk0x12c; // 0x12c
undefined m_unk0x174; // 0x174
MxMatrix m_unk0x178; // 0x178
MxMatrix m_unk0x1c0; // 0x1c0
MxMatrix m_unk0x208; // 0x208
// This is likely a location in pixel space
MxS32 m_unk0x250[2]; // 0x250
BoundingSphere m_targetBoundingSphere; // 0x114
MxMatrix m_originalSelectedPartTransform; // 0x12c
MxBool m_alreadyFinished; // 0x174
MxMatrix m_selectedPartStartTransform; // 0x178
MxMatrix m_displayTransform; // 0x1c0
MxMatrix m_selectedPartTargetTransform; // 0x208
MxS32 m_selectedPartStartMousePosition[2]; // 0x250
LegoCarBuildAnimPresenter* m_animPresenter; // 0x258
MxQuaternionTransformer m_unk0x25c; // 0x25c
// These two are likely locations in pixel space
MxS32 m_unk0x290[2]; // 0x290
MxS32 m_unk0x298[2]; // 0x298
MxFloat m_unk0x2a0; // 0x2a0
Mx4DPointFloat m_unk0x2a4; // 0x2a4
Mx4DPointFloat m_unk0x2bc; // 0x2bc
MxBool m_selectedPartIsPlaced; // 0x2d4
MxQuaternionTransformer m_draggingQuarternionTransformer; // 0x25c
MxS32 m_selectedPartStartScreenPosition[2]; // 0x290
MxS32 m_selectedPartTargetScreenPosition[2]; // 0x298
MxFloat m_normalizedDistance; // 0x2a0
Mx4DPointFloat m_selectedPartStartPosition; // 0x2a4
Mx4DPointFloat m_selectedPartTargetPosition; // 0x2bc
MxBool m_displayedPartIsPlaced; // 0x2d4
// variable names verified by BETA10 0x1006b27a
MxStillPresenter* m_ColorBook_Bitmap; // 0x2dc
@@ -232,21 +244,21 @@ private:
LegoVehicleBuildState* m_buildState; // 0x32c
// variable name verified by BETA10 0x1006d742
undefined4 m_carId; // 0x330
MxS32 m_carId; // 0x330
// variable name verified by BETA10 0x1006cba7
LegoGameState::Area m_destLocation; // 0x334
MxPresenter* m_unk0x338; // 0x338
MxControlPresenter* m_unk0x33c; // 0x33c
MxPresenter* m_jukeboxPresenter; // 0x338
MxControlPresenter* m_tickledControl; // 0x33c
undefined4 m_unk0x340; // 0x340
undefined4 m_unk0x344; // 0x344
MxS32 m_playingActorScript; // 0x344
MxU8 m_presentersEnabled; // 0x348
static MxS16 g_unk0x100f11cc;
static MxFloat g_unk0x100d65a4;
static MxS16 g_lastTickleState;
static MxFloat g_selectedPartRotationAngleStepYAxis;
static MxFloat g_rotationAngleStepYAxis;
static LookupTableActions g_unk0x100d65b0[];
static LookupTableActions g_actorScripts[];
};
#endif // LEGOCARBUILD_H

View File

@@ -21,10 +21,10 @@ public:
};
// SIZE 0x0c
struct UnknownListEntry {
struct CarBuildPart {
// FUNCTION: LEGO1 0x100795c0
// FUNCTION: BETA10 0x10073850
UnknownListEntry()
CarBuildPart()
{
m_name = NULL;
m_wiredName = NULL;
@@ -74,7 +74,7 @@ public:
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 @@ public:
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 @@ public:
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 @@ public:
// LegoCarBuildAnimPresenter::`scalar deleting destructor'
private:
void Beta10Inline0x100733d0();
void UpdateFlashingPartVisibility();
MxU16 m_shelfState; // 0xbc
@@ -136,13 +136,13 @@ private:
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
MxULong m_flashingPartTimeState; // 0x13c
LegoEntity* m_carBuildEntity; // 0x140
MxS32 m_unk0x144; // 0x144
MxS32 m_unk0x148; // 0x148

View File

@@ -56,7 +56,7 @@ public:
virtual MxResult Create(MxDSAction& p_dsAction); // vtable+0x18
virtual void Destroy(MxBool p_fromDestructor); // vtable+0x1c
virtual void ParseAction(char* p_extra); // vtable+0x20
virtual void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2); // vtable+0x24
virtual void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform); // vtable+0x24
virtual void SetWorldTransform(
const Vector3& p_location,
const Vector3& p_direction,
@@ -76,9 +76,9 @@ public:
virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48
virtual void SwitchMood(); // vtable+0x4c
void FUN_10010c30();
void TransformPointOfView();
void SetType(MxU8 p_type);
void SetLocation(const Vector3& p_location, const Vector3& p_direction, const Vector3& p_up, MxBool p_und);
void SetLocation(const Vector3& p_location, const Vector3& p_direction, const Vector3& p_up, MxBool p_updateCamera);
Mx3DPointFloat GetWorldDirection();
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldPosition();

View File

@@ -172,7 +172,7 @@ public:
History();
void WriteScoreHistory();
MxResult Serialize(LegoStorage* p_storage);
ScoreItem* FindPlayerInScoreHistory(Username* p_player, MxS16 p_unk0x24, MxS32& p_unk0x2c);
ScoreItem* FindPlayerInScoreHistory(Username* p_player, MxS16 p_playerId, MxS32& p_playerScoreHistoryIndex);
// FUNCTION: BETA10 0x1002c2b0
MxS16 GetCount() { return m_count; }
@@ -260,7 +260,7 @@ public:
MxBool m_isDirty; // 0x420
Area m_currentArea; // 0x424
Area m_previousArea; // 0x428
Area m_unk0x42c; // 0x42c
Area m_savedPreviousArea; // 0x42c
};
MxBool ROIColorOverride(const char* p_input, char* p_output, MxU32 p_copyLen);

View File

@@ -111,16 +111,15 @@ public:
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; }
void SetUseJoystick(MxBool p_useJoystick) { m_useJoystick = p_useJoystick; }
void SetJoystickIndex(MxS32 p_joystickIndex) { m_joystickIndex = p_joystickIndex; }
// FUNCTION: BETA10 0x1002e290
// FUNCTION: BETA10 0x1002e390
void DisableInputProcessing()
{
m_unk0x88 = TRUE;
m_inputProcessingDisabled = TRUE;
m_unk0x336 = FALSE;
}
@@ -155,7 +154,7 @@ private:
MxBool m_unk0x80; // 0x80
MxBool m_unk0x81; // 0x81
LegoControlManager* m_controlManager; // 0x84
MxBool m_unk0x88; // 0x88
MxBool m_inputProcessingDisabled; // 0x88
IDirectInput* m_directInput; // 0x8c
IDirectInputDevice* m_directInputDevice; // 0x90
MxBool m_kbStateSuccess; // 0x94

View File

@@ -99,7 +99,7 @@ public:
// 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

View File

@@ -153,7 +153,7 @@ public:
}
// 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

View File

@@ -60,7 +60,12 @@ MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id);
void EnableAnimations(MxBool p_enable);
void SetAppCursor(Cursor p_cursor);
MxBool CanExit();
MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId);
MxBool RemoveFromWorld(
const MxAtomId& p_entityAtom,
MxS32 p_entityId,
const MxAtomId& p_worldAtom,
MxS32 p_worldEntityId
);
MxS32 UpdateLightPosition(MxS32 p_increase);
void SetLightPosition(MxS32 p_index);
LegoNamedTexture* ReadNamedTexture(LegoStorage* p_storage);

View File

@@ -52,13 +52,13 @@ public:
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 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 @@ public:
);
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 @@ public:
LegoEntityList* GetEntityList() { return m_entityList; }
LegoOmni::World GetWorldId() { return m_worldId; }
MxBool GetUnknown0xd0Empty() { return m_set0xd0.empty(); }
MxBool NoDisabledObjects() { return m_disabledObjects.empty(); }
list<LegoROI*>& GetROIList() { return m_roiList; }
LegoHideAnimPresenter* GetHideAnimPresenter() { return m_hideAnim; }
@@ -131,9 +131,9 @@ protected:
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<LegoROI*> m_roiList; // 0xe0
LegoOmni::World m_worldId; // 0xec

View File

@@ -65,7 +65,7 @@ public:
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

View File

@@ -15,7 +15,7 @@ public:
void ParseAction(char* p_extra) override; // vtable+0x20
MxResult FUN_1001c360(float p_und, Matrix4& p_transform) override;
MxResult AnimateWithTransform(float p_time, Matrix4& p_transform) override;
virtual void FUN_10071c80(Vector3& p_vec);

View File

@@ -54,12 +54,12 @@ private:
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
@@ -69,9 +69,9 @@ private:
MxLong HandleKeyPress(MxU8 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();
};

View File

@@ -60,7 +60,7 @@ public:
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

View File

@@ -36,129 +36,131 @@ 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_unk0x100f0f30[] = {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_unk0x100f0f50[] = {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_unk0x100f0f90[] = {12, 19, 24, 48, 60, -1};
MxS32 g_location2Plants[] = {12, 19, 24, 48, 60, -1};
// GLOBAL: LEGO1 0x100f0fa8
// GLOBAL: BETA10 0x101dbec0
MxS32 g_unk0x100f0fa8[] = {8, 15, 46, -1};
MxS32 g_location3Plants[] = {8, 15, 46, -1};
// GLOBAL: LEGO1 0x100f0fb8
// GLOBAL: BETA10 0x101dbed0
MxS32 g_unk0x100f0fb8[] = {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_unk0x100f0fe8[] = {3, 40, 53, 55, -1};
MxS32 g_location5Plants[] = {3, 40, 53, 55, -1};
// GLOBAL: LEGO1 0x100f1000
// GLOBAL: BETA10 0x101dbf18
MxS32 g_unk0x100f1000[] = {22, 33, 41, 45, 67, -1};
MxS32 g_location6Plants[] = {22, 33, 41, 45, 67, -1};
// GLOBAL: LEGO1 0x100f1018
// GLOBAL: BETA10 0x101dbf30
MxS32 g_unk0x100f1018[] = {13, 30, 31, 62, -1};
MxS32 g_location7Plants[] = {13, 30, 31, 62, -1};
// GLOBAL: LEGO1 0x100f1030
// GLOBAL: BETA10 0x101dbf48
MxS32 g_unk0x100f1030[] = {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;
}
}
// FUNCTION: LEGO1 0x10018940
void Act2Actor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
void Act2Actor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform)
{
LegoAnimActor::SetROI(p_roi, p_bool1, p_bool2);
LegoAnimActor::SetROI(p_roi, p_bool1, p_updateTransform);
m_roi->SetVisibility(FALSE);
}
// 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]->GetUnknown0x00() == -1.0f) {
if (m_animMaps[i]->GetWorldSpeed() == -1.0f) {
m_shootAnim = m_animMaps[i];
}
}
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 = rand() / (RAND_MAX / 2) + 1;
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_unk0x100f0f30[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f30[i]].m_counter) {
result = plantInfo[g_unk0x100f0f30[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_unk0x100f0f50[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f50[i]].m_counter) {
result = plantInfo[g_unk0x100f0f50[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_unk0x100f0f90[i] != -1; i++) {
if (plantInfo[g_unk0x100f0f90[i]].m_counter) {
result = plantInfo[g_unk0x100f0f90[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_unk0x100f0fa8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fa8[i]].m_counter) {
result = plantInfo[g_unk0x100f0fa8[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_unk0x100f0fb8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fb8[i]].m_counter) {
result = plantInfo[g_unk0x100f0fb8[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_unk0x100f0fe8[i] != -1; i++) {
if (plantInfo[g_unk0x100f0fe8[i]].m_counter) {
result = plantInfo[g_unk0x100f0fe8[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_unk0x100f1000[i] != -1; i++) {
if (plantInfo[g_unk0x100f1000[i]].m_counter) {
result = plantInfo[g_unk0x100f1000[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_unk0x100f1018[i] != -1; i++) {
if (plantInfo[g_unk0x100f1018[i]].m_counter) {
result = plantInfo[g_unk0x100f1018[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_unk0x100f1030[i] != -1; i++) {
if (plantInfo[g_unk0x100f1030[i]].m_counter) {
result = plantInfo[g_unk0x100f1030[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;

View File

@@ -270,7 +270,7 @@ void Act3Cop::ParseAction(char* p_extra)
}
for (i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetUnknown0x00() == -1.0f) {
if (m_animMaps[i]->GetWorldSpeed() == -1.0f) {
m_eatAnim = m_animMaps[i];
}
}
@@ -558,7 +558,7 @@ void Act3Brickster::ParseAction(char* p_extra)
((Act3*) m_world)->SetBrickster(this);
for (MxS32 i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetUnknown0x00() == -1.0f) {
if (m_animMaps[i]->GetWorldSpeed() == -1.0f) {
m_shootAnim = m_animMaps[i];
}
}

View File

@@ -342,7 +342,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
assert(m_world && m_world->GetCameraController());
m_world->GetCameraController()->SetWorldTransform(at, dir, up);
FUN_10010c30();
TransformPointOfView();
result = 1;
break;
}
@@ -388,13 +388,13 @@ void Helicopter::VTable0x74(Matrix4& p_transform)
{
if (m_userNavFlag) {
m_roi->UpdateTransformationRelativeToParent(p_transform);
FUN_10010c30();
TransformPointOfView();
}
else {
m_roi->SetLocal2World(p_transform);
m_roi->WrappedUpdateWorldData();
if (m_cameraFlag) {
FUN_10010c30();
TransformPointOfView();
}
}
}

View File

@@ -93,7 +93,7 @@ void IslePathActor::Enter()
SetUserActor(this);
FUN_1001b660();
FUN_10010c30();
TransformPointOfView();
}
}
@@ -152,7 +152,7 @@ void IslePathActor::Exit()
}
FUN_1001b660();
FUN_10010c30();
TransformPointOfView();
ResetViewVelocity();
}
@@ -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;
}
}
@@ -633,7 +633,7 @@ void IslePathActor::VTable0xec(MxMatrix p_transform, LegoPathBoundary* p_boundar
m_roi->SetLocal2World(p_transform);
if (m_cameraFlag) {
ResetViewVelocity();
FUN_10010c30();
TransformPointOfView();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@
#include "mxtimer.h"
#include "realtime/realtime.h"
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::UnknownListEntry, 0x0c)
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::CarBuildPart, 0x0c)
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter, 0x150)
// FUNCTION: LEGO1 0x10078400
@@ -32,7 +32,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;
@@ -60,28 +60,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) {
@@ -96,7 +96,7 @@ inline void LegoCarBuildAnimPresenter::Beta10Inline0x100733d0()
const LegoChar* name = roi->GetName();
if (name && stricmp(wiredName, name) == 0) {
if (bvar5) {
if (showFlashingPart) {
roi->SetVisibility(TRUE);
}
else {
@@ -127,7 +127,7 @@ void LegoCarBuildAnimPresenter::PutFrame()
break;
}
Beta10Inline0x100733d0();
UpdateFlashingPartVisibility();
}
// FUNCTION: LEGO1 0x100788c0
@@ -209,7 +209,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle()
}
if (i < m_placedPartCount) {
FUN_10079050(i);
MakePartPlaced(i);
ShowBuildPartByName(m_parts[i].m_name);
}
@@ -316,7 +316,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);
@@ -382,7 +382,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
@@ -551,7 +551,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);
@@ -644,7 +644,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;
@@ -708,7 +708,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();

View File

@@ -1794,7 +1794,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);

View File

@@ -154,7 +154,7 @@ LegoGameState::LegoGameState()
m_jukeboxMusic = JukeboxScript::c_noneJukebox;
m_currentArea = e_undefined;
m_previousArea = e_undefined;
m_unk0x42c = e_undefined;
m_savedPreviousArea = e_undefined;
m_playerCount = 0;
m_isDirty = FALSE;
m_loadedAct = e_actNotFound;
@@ -313,7 +313,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
}
}
area = m_unk0x42c;
area = m_savedPreviousArea;
storage.WriteU16(area);
SerializeScoreHistory(LegoFile::c_write);
m_isDirty = FALSE;
@@ -431,10 +431,10 @@ MxResult LegoGameState::Load(MxULong p_slot)
storage.ReadS16(actArea);
if (m_currentAct == e_act1) {
m_unk0x42c = e_undefined;
m_savedPreviousArea = e_undefined;
}
else {
m_unk0x42c = (Area) actArea;
m_savedPreviousArea = (Area) actArea;
}
result = SUCCESS;
@@ -835,7 +835,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));
}
}
@@ -1190,7 +1190,7 @@ void LegoGameState::Init()
}
}
m_unk0x42c = e_undefined;
m_savedPreviousArea = e_undefined;
}
// FUNCTION: BETA10 0x10086510
@@ -1569,18 +1569,18 @@ void LegoGameState::History::WriteScoreHistory()
// FUNCTION: BETA10 0x1008732a
LegoGameState::ScoreItem* LegoGameState::History::FindPlayerInScoreHistory(
LegoGameState::Username* p_player,
MxS16 p_unk0x24,
MxS32& p_unk0x2c
MxS16 p_playerId,
MxS32& p_playerScoreHistoryIndex
)
{
MxS32 i = 0;
for (; i < m_count; i++) {
if (!memcmp(p_player, &m_scores[i].m_name, sizeof(*p_player)) && m_scores[i].m_playerId == p_unk0x24) {
if (!memcmp(p_player, &m_scores[i].m_name, sizeof(*p_player)) && m_scores[i].m_playerId == p_playerId) {
break;
}
}
p_unk0x2c = i;
p_playerScoreHistoryIndex = i;
if (i >= m_count) {
return NULL;

View File

@@ -521,7 +521,12 @@ MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id)
}
// FUNCTION: LEGO1 0x1003ee80
MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId)
MxBool RemoveFromWorld(
const MxAtomId& p_entityAtom,
MxS32 p_entityId,
const MxAtomId& p_worldAtom,
MxS32 p_worldEntityId
)
{
LegoWorld* world = FindWorld(p_worldAtom, p_worldEntityId);

View File

@@ -121,15 +121,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;

View File

@@ -31,7 +31,7 @@ MxLong Act2Brick::g_lastHitActorTime = 0;
Act2Brick::Act2Brick()
{
m_whistleSound = NULL;
m_unk0x164 = 0;
m_state = Act2Brick::e_removed;
}
// FUNCTION: LEGO1 0x1007a470
@@ -72,7 +72,7 @@ MxResult Act2Brick::Create(MxS32 p_index)
m_roi->SetEntity(this);
CurrentWorld()->Add(this);
m_unk0x164 = 1;
m_state = Act2Brick::e_created;
return SUCCESS;
}
@@ -88,27 +88,27 @@ void Act2Brick::Remove()
m_roi = NULL;
}
m_unk0x164 = 0;
m_state = Act2Brick::e_removed;
}
// FUNCTION: LEGO1 0x1007a670
// FUNCTION: BETA10 0x10012c04
void Act2Brick::FUN_1007a670(MxMatrix& p_param1, MxMatrix& p_param2, LegoPathBoundary* p_boundary)
void Act2Brick::Place(MxMatrix& p_localToWorld, MxMatrix& p_endLocalToWorld, LegoPathBoundary* p_boundary)
{
m_unk0x17c = p_param2[3];
m_unk0x168 = p_param2[3];
m_unk0x168 -= p_param1[3];
m_unk0x168 /= 8.0f;
m_endLocalToWorld = p_endLocalToWorld[3];
m_localToWorldMovementStep = p_endLocalToWorld[3];
m_localToWorldMovementStep -= p_localToWorld[3];
m_localToWorldMovementStep /= 8.0f;
m_unk0x190 = 0;
m_step = 0;
TickleManager()->RegisterClient(this, 20);
m_unk0x164 = 2;
m_state = Act2Brick::e_placed;
CurrentWorld()->PlaceActor(this);
p_boundary->AddActor(this);
SetActorState(c_disabled);
m_roi->SetLocal2World(p_param1);
m_roi->SetLocal2World(p_localToWorld);
m_roi->WrappedUpdateWorldData();
m_roi->SetVisibility(TRUE);
}
@@ -136,15 +136,15 @@ MxResult Act2Brick::HitActor(LegoPathActor* p_actor, MxBool)
MxResult Act2Brick::Tickle()
{
MxMatrix local2world(m_roi->GetLocal2World());
m_unk0x190++;
m_step++;
if (m_unk0x190 >= 8) {
local2world.SetTranslation(m_unk0x17c[0], m_unk0x17c[1], m_unk0x17c[2]);
m_unk0x164 = 3;
if (m_step >= 8) {
local2world.SetTranslation(m_endLocalToWorld[0], m_endLocalToWorld[1], m_endLocalToWorld[2]);
m_state = Act2Brick::e_atRest;
TickleManager()->UnregisterClient(this);
}
else {
VPV3(local2world[3], local2world[3], m_unk0x168);
VPV3(local2world[3], local2world[3], m_localToWorldMovementStep);
}
m_roi->SetLocal2World(local2world);
@@ -165,7 +165,7 @@ MxLong Act2Brick::Notify(MxParam& p_param)
StopWhistleSound();
}
MxNotificationParam param(c_notificationType22, this);
MxNotificationParam param(c_notificationAct2Brick, this);
NotificationManager()->Send(CurrentWorld(), param);
return 1;
}

View File

@@ -127,7 +127,7 @@ const char* LegoActor::GetActorName(MxU8 p_id)
// FUNCTION: LEGO1 0x1002d670
// FUNCTION: BETA10 0x1003d65f
void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform)
{
if (p_roi) {
const char* name = p_roi->GetName();
@@ -141,7 +141,7 @@ void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
}
}
LegoEntity::SetROI(p_roi, p_bool1, p_bool2);
LegoEntity::SetROI(p_roi, p_bool1, p_updateTransform);
}
// FUNCTION: LEGO1 0x1002d6e0

View File

@@ -124,12 +124,12 @@ void LegoEntity::SetWorld()
// FUNCTION: LEGO1 0x100108a0
// FUNCTION: BETA10 0x1007e724
void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_updateTransform)
{
m_roi = p_roi;
if (m_roi != NULL) {
if (p_bool2) {
if (p_updateTransform) {
MxMatrix mat;
CalcLocalTransform(
Mx3DPointFloat(m_worldLocation[0], m_worldLocation[1], m_worldLocation[2]),
@@ -155,7 +155,12 @@ void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
// FUNCTION: LEGO1 0x100109b0
// FUNCTION: BETA10 0x1007e8b8
void LegoEntity::SetLocation(const Vector3& p_location, const Vector3& p_direction, const Vector3& p_up, MxBool p_und)
void LegoEntity::SetLocation(
const Vector3& p_location,
const Vector3& p_direction,
const Vector3& p_up,
MxBool p_updateCamera
)
{
Mx3DPointFloat direction;
Mx3DPointFloat up;
@@ -182,14 +187,14 @@ void LegoEntity::SetLocation(const Vector3& p_location, const Vector3& p_directi
m_roi->UpdateTransformationRelativeToParent(mat);
VideoManager()->Get3DManager()->Moved(*m_roi);
if (p_und) {
FUN_10010c30();
if (p_updateCamera) {
TransformPointOfView();
}
}
}
// FUNCTION: LEGO1 0x10010c30
void LegoEntity::FUN_10010c30()
void LegoEntity::TransformPointOfView()
{
LegoWorld* world = CurrentWorld();

View File

@@ -70,7 +70,7 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction)
return FAILURE;
}
if (!VTable0x54()) {
if (!InitializeCameraController()) {
return FAILURE;
}
@@ -130,10 +130,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;
@@ -161,7 +161,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();
}
@@ -229,7 +229,7 @@ MxLong LegoWorld::Notify(MxParam& p_param)
// FUNCTION: LEGO1 0x1001f630
// FUNCTION: BETA10 0x100d9fc2
LegoCameraController* LegoWorld::VTable0x54()
LegoCameraController* LegoWorld::InitializeCameraController()
{
MxBool success = FALSE;
@@ -352,7 +352,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;
@@ -364,7 +364,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;
@@ -481,25 +481,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<MxPresenter*>(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);
}
}
}
@@ -557,15 +557,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);
}
}
@@ -617,7 +617,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());
@@ -664,7 +664,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")) {
@@ -686,7 +686,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;
}
@@ -709,8 +709,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);
@@ -719,7 +719,7 @@ void LegoWorld::Enable(MxBool p_enable)
((LegoPathController*) *it)->Enable(TRUE);
}
m_set0xd0.erase(it);
m_disabledObjects.erase(it);
}
SetCurrentWorld(this);
@@ -743,7 +743,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();
@@ -753,7 +753,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);
@@ -766,15 +766,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);
}
}
@@ -800,7 +800,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);
@@ -858,7 +858,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;

View File

@@ -58,7 +58,7 @@ LegoWorldPresenter::~LegoWorldPresenter()
PlantManager()->LoadWorldInfo(worldId);
AnimationManager()->LoadWorldInfo(worldId);
BuildingManager()->LoadWorldInfo();
result = ((LegoWorld*) m_entity)->VTable0x5c();
result = ((LegoWorld*) m_entity)->WaitForTransition();
}
if (result == FALSE) {

View File

@@ -39,7 +39,7 @@ LegoInputManager::LegoInputManager()
m_y = 0;
m_controlManager = NULL;
m_unk0x81 = FALSE;
m_unk0x88 = FALSE;
m_inputProcessingDisabled = FALSE;
m_directInput = NULL;
m_directInputDevice = NULL;
m_kbStateSuccess = FALSE;
@@ -346,7 +346,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 == VK_SPACE)))) {
ProcessOneEvent(param);
}
@@ -585,9 +585,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;
}

View File

@@ -13,9 +13,14 @@ DECOMP_SIZE_ASSERT(LegoAnimActorStruct, 0x20)
// FUNCTION: LEGO1 0x1001bf80
// FUNCTION: BETA10 0x1003dc10
LegoAnimActorStruct::LegoAnimActorStruct(float p_unk0x00, LegoAnim* p_AnimTreePtr, LegoROI** p_roiMap, MxU32 p_numROIs)
LegoAnimActorStruct::LegoAnimActorStruct(
float p_worldSpeed,
LegoAnim* p_AnimTreePtr,
LegoROI** p_roiMap,
MxU32 p_numROIs
)
{
m_unk0x00 = p_unk0x00;
m_worldSpeed = p_worldSpeed;
m_AnimTreePtr = p_AnimTreePtr;
m_roiMap = p_roiMap;
m_numROIs = p_numROIs;
@@ -50,22 +55,22 @@ LegoAnimActor::~LegoAnimActor()
// FUNCTION: LEGO1 0x1001c1f0
// FUNCTION: BETA10 0x1003f240
MxResult LegoAnimActor::FUN_1001c1f0(float& p_und)
MxResult LegoAnimActor::GetTimeInCycle(float& p_timeInCycle)
{
float duration = (float) m_animMaps[m_curAnim]->m_AnimTreePtr->GetDuration();
p_und = m_actorTime - duration * ((MxS32) (m_actorTime / duration));
p_timeInCycle = m_actorTime - duration * ((MxS32) (m_actorTime / duration));
return SUCCESS;
}
// FUNCTION: LEGO1 0x1001c240
void LegoAnimActor::VTable0x74(Matrix4& p_transform)
{
float und;
float timeInCycle;
LegoPathActor::VTable0x74(p_transform);
if (m_curAnim >= 0) {
FUN_1001c1f0(und);
FUN_1001c360(und, p_transform);
GetTimeInCycle(timeInCycle);
AnimateWithTransform(timeInCycle, p_transform);
}
}
@@ -81,10 +86,10 @@ void LegoAnimActor::Animate(float p_time)
if (m_actorState == c_initial && !m_userNavFlag && m_worldSpeed <= 0) {
if (m_curAnim >= 0) {
MxMatrix matrix(m_unk0xec);
float f;
FUN_1001c1f0(f);
FUN_1001c360(f, matrix);
MxMatrix transform(m_unk0xec);
float timeInCycle;
GetTimeInCycle(timeInCycle);
AnimateWithTransform(timeInCycle, transform);
}
m_lastTime = m_actorTime = p_time;
@@ -96,9 +101,9 @@ void LegoAnimActor::Animate(float p_time)
// FUNCTION: LEGO1 0x1001c360
// FUNCTION: BETA10 0x1003e2d3
MxResult LegoAnimActor::FUN_1001c360(float p_und, Matrix4& p_transform)
MxResult LegoAnimActor::AnimateWithTransform(float p_time, Matrix4& p_transform)
{
if (p_und >= 0) {
if (p_time >= 0) {
assert((m_curAnim >= 0) && (m_curAnim < m_animMaps.size()));
LegoROI** roiMap = m_animMaps[m_curAnim]->m_roiMap;
@@ -133,11 +138,11 @@ MxResult LegoAnimActor::FUN_1001c360(float p_und, Matrix4& p_transform)
}
for (MxS32 j = 0; j < n->GetNumChildren(); j++) {
LegoROI::ApplyAnimationTransformation(n->GetChild(j), p_transform, p_und, roiMap);
LegoROI::ApplyAnimationTransformation(n->GetChild(j), p_transform, p_time, roiMap);
}
if (m_cameraFlag) {
FUN_10010c30();
TransformPointOfView();
}
}
@@ -150,15 +155,20 @@ MxResult LegoAnimActor::FUN_1001c360(float p_und, Matrix4& p_transform)
// FUNCTION: LEGO1 0x1001c450
// FUNCTION: BETA10 0x1003e590
MxResult LegoAnimActor::FUN_1001c450(LegoAnim* p_AnimTreePtr, float p_unk0x00, LegoROI** p_roiMap, MxU32 p_numROIs)
MxResult LegoAnimActor::CreateAnimActorStruct(
LegoAnim* p_AnimTreePtr,
float p_worldSpeed,
LegoROI** p_roiMap,
MxU32 p_numROIs
)
{
// the capitalization of `p_AnimTreePtr` was taken from BETA10
assert(p_AnimTreePtr && p_roiMap);
LegoAnimActorStruct* laas = new LegoAnimActorStruct(p_unk0x00, p_AnimTreePtr, p_roiMap, p_numROIs);
LegoAnimActorStruct* laas = new LegoAnimActorStruct(p_worldSpeed, p_AnimTreePtr, p_roiMap, p_numROIs);
for (vector<LegoAnimActorStruct*>::iterator it = m_animMaps.begin(); it != m_animMaps.end(); it++) {
if (p_unk0x00 < (*it)->m_unk0x00) {
if (p_worldSpeed < (*it)->m_worldSpeed) {
m_animMaps.insert(it, laas);
SetWorldSpeed(m_worldSpeed);
return SUCCESS;
@@ -196,12 +206,12 @@ void LegoAnimActor::SetWorldSpeed(MxFloat p_worldSpeed)
if (m_animMaps.size() > 0) {
m_curAnim = 0;
if (m_worldSpeed >= m_animMaps[m_animMaps.size() - 1]->m_unk0x00) {
if (m_worldSpeed >= m_animMaps[m_animMaps.size() - 1]->m_worldSpeed) {
m_curAnim = m_animMaps.size() - 1;
}
else {
for (MxU32 i = 0; i < m_animMaps.size(); i++) {
if (m_worldSpeed <= m_animMaps[i]->m_unk0x00) {
if (m_worldSpeed <= m_animMaps[i]->m_worldSpeed) {
m_curAnim = i;
break;
}

View File

@@ -169,7 +169,7 @@ inline void LegoExtraActor::FUN_1002ad8a()
m_assAnimP->FUN_1006d680(this, -20.0f);
for (MxS32 i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetUnknown0x00() == -20.0f) {
if (m_animMaps[i]->GetWorldSpeed() == -20.0f) {
m_assAnim = new LegoAnimActorStruct(*m_animMaps[i]);
break;
}
@@ -181,7 +181,7 @@ inline void LegoExtraActor::FUN_1002ad8a()
m_disAnimP->FUN_1006d680(this, -21.0f);
for (MxS32 i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetUnknown0x00() == -21.0f) {
if (m_animMaps[i]->GetWorldSpeed() == -21.0f) {
m_disAnim = new LegoAnimActorStruct(*m_animMaps[i]);
break;
}
@@ -410,7 +410,7 @@ void LegoExtraActor::VTable0xc4()
if (b) {
float duration = m_animMaps[m_curAnim]->GetDuration();
MxMatrix matrix(m_unk0xec);
LegoAnimActor::FUN_1001c360(duration, matrix);
LegoAnimActor::AnimateWithTransform(duration, matrix);
}
}
}

View File

@@ -162,7 +162,7 @@ MxResult LegoPathActor::VTable0x88(
}
else {
m_boundary->AddActor(this);
FUN_10010c30();
TransformPointOfView();
}
m_unk0xec = m_roi->GetLocal2World();
@@ -222,7 +222,7 @@ MxResult LegoPathActor::VTable0x84(
if (m_cameraFlag && m_userNavFlag) {
m_boundary->AddActor(this);
FUN_10010c30();
TransformPointOfView();
}
else {
p5.EqualsCross(*p_boundary->GetUp(), p3);
@@ -392,14 +392,14 @@ void LegoPathActor::VTable0x74(Matrix4& p_transform)
{
if (m_userNavFlag) {
m_roi->WrappedSetLocal2WorldWithWorldDataUpdate(p_transform);
FUN_10010c30();
TransformPointOfView();
}
else {
m_roi->WrappedSetLocal2WorldWithWorldDataUpdate(p_transform);
m_roi->WrappedUpdateWorldData();
if (m_cameraFlag) {
FUN_10010c30();
TransformPointOfView();
}
}
}
@@ -745,7 +745,7 @@ void LegoPathActor::VTable0xa8()
if (m_userNavFlag) {
m_roi->WrappedSetLocal2WorldWithWorldDataUpdate(m_unk0xec);
FUN_10010c30();
TransformPointOfView();
}
}

View File

@@ -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

View File

@@ -68,6 +68,7 @@ const LegoChar* g_strCRCEDGEY0 = "C_RCEDGEY0";
MxS32 g_unk0x100f0c7c = 2;
// FUNCTION: LEGO1 0x10016a90
// FUNCTION: BETA10 0x100c82e8
CarRace::CarRace()
{
m_skeleton = NULL;

View File

@@ -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();

View File

@@ -268,10 +268,10 @@ void LegoRaceCar::ParseAction(char* p_extra)
MxS32 i;
for (i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetUnknown0x00() == -1.0f) {
if (m_animMaps[i]->GetWorldSpeed() == -1.0f) {
m_skelKick1Anim = m_animMaps[i];
}
else if (m_animMaps[i]->GetUnknown0x00() == -2.0f) {
else if (m_animMaps[i]->GetWorldSpeed() == -2.0f) {
m_skelKick2Anim = m_animMaps[i];
}
}

View File

@@ -22,15 +22,15 @@ RaceSkel::~RaceSkel()
// FUNCTION: LEGO1 0x10071b50
// FUNCTION: BETA10 0x100f13cf
MxResult RaceSkel::FUN_1001c360(float p_und, Matrix4& p_transform)
MxResult RaceSkel::AnimateWithTransform(float p_time, Matrix4& p_transform)
{
p_transform[3][0] = -630.0f;
p_transform[3][1] = -4.688f;
p_transform[3][2] = 323.0f;
m_animPosition = p_und;
m_animPosition = p_time;
return LegoAnimActor::FUN_1001c360(p_und, p_transform);
return LegoAnimActor::AnimateWithTransform(p_time, p_transform);
}
// FUNCTION: LEGO1 0x10071b90

View File

@@ -1136,7 +1136,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);
}
@@ -1148,7 +1148,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;
@@ -1435,7 +1435,7 @@ void LegoLocomotionAnimPresenter::FUN_1006d680(LegoAnimActor* p_actor, MxFloat p
if (m_roiMap != NULL) {
m_roiMapList->Append(m_roiMap);
p_actor->FUN_1001c450(m_anim, p_value, m_roiMap, m_roiMapSize);
p_actor->CreateAnimActorStruct(m_anim, p_value, m_roiMap, m_roiMapSize);
m_roiMap = NULL;
}

View File

@@ -888,7 +888,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;
}

View File

@@ -4,6 +4,7 @@
#include "credits_actions.h"
#include "helicopter.h"
#include "infomain_actions.h"
#include "intro_actions.h"
#include "jukebox.h"
#include "jukebox_actions.h"
#include "legoact2.h"
@@ -128,13 +129,13 @@ InfomainScript::Script g_bricksterDialogue[2] = {
// FUNCTION: LEGO1 0x1006ea20
Infocenter::Infocenter()
{
m_selectedCharacter = e_noCharacter;
m_selectedCharacter = LegoActor::c_none;
m_dragPresenter = NULL;
m_infocenterState = NULL;
m_frame = NULL;
m_destLocation = LegoGameState::e_undefined;
m_currentInfomainScript = InfomainScript::c_noneInfomain;
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
memset(&m_glowInfo, 0, sizeof(m_glowInfo));
@@ -220,7 +221,7 @@ MxResult Infocenter::Create(MxDSAction& p_dsAction)
if (m_infocenterState->m_state == InfocenterState::e_selectedSave) {
LegoGameState* state = GameState();
state->m_previousArea = GameState()->m_unk0x42c;
state->m_previousArea = GameState()->m_savedPreviousArea;
}
InputManager()->Register(this);
@@ -306,19 +307,19 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
GameState()->SetActor(m_selectedCharacter);
switch (m_selectedCharacter) {
case e_pepper:
case LegoActor::c_pepper:
PlayAction(InfomainScript::c_avo901in_RunAnim);
break;
case e_mama:
case LegoActor::c_mama:
PlayAction(InfomainScript::c_avo902in_RunAnim);
break;
case e_papa:
case LegoActor::c_papa:
PlayAction(InfomainScript::c_avo903in_RunAnim);
break;
case e_nick:
case LegoActor::c_nick:
PlayAction(InfomainScript::c_avo904in_RunAnim);
break;
case e_laura:
case LegoActor::c_laura:
PlayAction(InfomainScript::c_avo905in_RunAnim);
break;
default:
@@ -343,23 +344,23 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
switch (m_infocenterState->m_state) {
case InfocenterState::e_playCutscene:
switch (m_currentCutscene) {
case e_legoMovie:
PlayCutscene(e_mindscapeMovie, FALSE);
case IntroScript::c_Lego_Movie:
PlayCutscene(IntroScript::c_Mindscape_Movie, FALSE);
return 1;
case e_mindscapeMovie:
PlayCutscene(e_introMovie, TRUE);
case IntroScript::c_Mindscape_Movie:
PlayCutscene(IntroScript::c_Intro_Movie, TRUE);
return 1;
case e_badEndMovie:
case IntroScript::c_BadEnd_Movie:
StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_tic092in_RunAnim);
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
return 1;
case e_goodEndMovie:
case IntroScript::c_GoodEnd_Movie:
StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_tic089in_RunAnim);
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
return 1;
}
@@ -367,7 +368,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_iic001in_RunAnim);
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
if (!m_infocenterState->HasRegistered()) {
m_bookAnimationTimer = 1;
@@ -378,17 +379,17 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
switch (m_currentCutscene) {
case e_badEndMovie:
case IntroScript::c_BadEnd_Movie:
PlayAction(InfomainScript::c_tic092in_RunAnim);
break;
case e_goodEndMovie:
case IntroScript::c_GoodEnd_Movie:
PlayAction(InfomainScript::c_tic089in_RunAnim);
break;
default:
PlayAction(InfomainScript::c_iic001in_RunAnim);
}
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
return 1;
case InfocenterState::e_notRegistered:
SetROIVisible(g_object2x4red, FALSE);
@@ -405,7 +406,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
break;
case InfocenterState::e_selectedCharacterAndDestination:
if (action->GetObjectId() == m_currentInfomainScript) {
if (GameState()->GetCurrentAct() != LegoGameState::e_act3 && m_selectedCharacter != e_noCharacter) {
if (GameState()->GetCurrentAct() != LegoGameState::e_act3 && m_selectedCharacter != LegoActor::c_none) {
GameState()->SetActor(m_selectedCharacter);
}
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
@@ -455,7 +456,7 @@ void Infocenter::ReadyWorld()
switch (m_infocenterState->m_state) {
case InfocenterState::e_newState:
PlayCutscene(e_legoMovie, TRUE);
PlayCutscene(IntroScript::c_Lego_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
case InfocenterState::e_selectedSave:
@@ -516,9 +517,9 @@ void Infocenter::ReadyWorld()
LegoAct2State* state = (LegoAct2State*) GameState()->GetState("LegoAct2State");
GameState()->FindLoadedAct();
if (state && state->GetUnknown0x08() == 0x68) {
if (state && state->GetState() == LegoAct2State::c_badEnding) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
PlayCutscene(IntroScript::c_BadEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
}
@@ -563,14 +564,14 @@ void Infocenter::ReadyWorld()
if (state && state->GetState() == Act3State::e_badEnding) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
PlayCutscene(IntroScript::c_BadEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
}
if (state && state->GetState() == Act3State::e_goodEnding) {
bg->Enable(TRUE);
PlayCutscene(e_goodEndMovie, TRUE);
PlayCutscene(IntroScript::c_GoodEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
}
@@ -752,19 +753,19 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
switch (m_dragPresenter->GetAction()->GetObjectId()) {
case InfomainScript::c_PepperHot_Bitmap:
m_selectedCharacter = e_pepper;
m_selectedCharacter = LegoActor::c_pepper;
break;
case InfomainScript::c_MamaHot_Bitmap:
m_selectedCharacter = e_mama;
m_selectedCharacter = LegoActor::c_mama;
break;
case InfomainScript::c_PapaHot_Bitmap:
m_selectedCharacter = e_papa;
m_selectedCharacter = LegoActor::c_papa;
break;
case InfomainScript::c_NickHot_Bitmap:
m_selectedCharacter = e_nick;
m_selectedCharacter = LegoActor::c_nick;
break;
case InfomainScript::c_LauraHot_Bitmap:
m_selectedCharacter = e_laura;
m_selectedCharacter = LegoActor::c_laura;
break;
}
@@ -773,7 +774,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
switch (control->GetAction()->GetObjectId()) {
case InfomainScript::c_Pepper_Ctl:
if (m_selectedCharacter == e_pepper) {
if (m_selectedCharacter == LegoActor::c_pepper) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Pepper_All_Movie);
@@ -781,7 +782,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
break;
case InfomainScript::c_Mama_Ctl:
if (m_selectedCharacter == e_mama) {
if (m_selectedCharacter == LegoActor::c_mama) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Mama_All_Movie);
@@ -789,7 +790,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
break;
case InfomainScript::c_Papa_Ctl:
if (m_selectedCharacter == e_papa) {
if (m_selectedCharacter == LegoActor::c_papa) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Papa_All_Movie);
@@ -797,7 +798,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
break;
case InfomainScript::c_Nick_Ctl:
if (m_selectedCharacter == e_nick) {
if (m_selectedCharacter == LegoActor::c_nick) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Nick_All_Movie);
@@ -805,7 +806,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
break;
case InfomainScript::c_Laura_Ctl:
if (m_selectedCharacter == e_laura) {
if (m_selectedCharacter == LegoActor::c_laura) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Laura_All_Movie);
@@ -823,19 +824,19 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
GameState()->SetActor(m_selectedCharacter);
switch (m_selectedCharacter) {
case e_pepper:
case LegoActor::c_pepper:
PlayAction(InfomainScript::c_avo901in_RunAnim);
break;
case e_mama:
case LegoActor::c_mama:
PlayAction(InfomainScript::c_avo902in_RunAnim);
break;
case e_papa:
case LegoActor::c_papa:
PlayAction(InfomainScript::c_avo903in_RunAnim);
break;
case e_nick:
case LegoActor::c_nick:
PlayAction(InfomainScript::c_avo904in_RunAnim);
break;
case e_laura:
case LegoActor::c_laura:
PlayAction(InfomainScript::c_avo905in_RunAnim);
break;
}
@@ -894,23 +895,23 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
else {
switch (m_selectedCharacter) {
case e_pepper:
case LegoActor::c_pepper:
dialogueToPlay = InfomainScript::c_avo901in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
case e_mama:
case LegoActor::c_mama:
dialogueToPlay = InfomainScript::c_avo902in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
case e_papa:
case LegoActor::c_papa:
dialogueToPlay = InfomainScript::c_avo903in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
case e_nick:
case LegoActor::c_nick:
dialogueToPlay = InfomainScript::c_avo904in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
case e_laura:
case LegoActor::c_laura:
dialogueToPlay = InfomainScript::c_avo905in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
@@ -1082,7 +1083,7 @@ MxU8 Infocenter::HandleControl(LegoControlManagerNotificationParam& p_param)
actionToPlay = GameState()->GetCurrentAct() != LegoGameState::e_act1 ? InfomainScript::c_GoTo_RegBook_Red
: InfomainScript::c_GoTo_RegBook;
m_radio.Stop();
GameState()->m_unk0x42c = GameState()->m_previousArea;
GameState()->m_savedPreviousArea = GameState()->m_previousArea;
InputManager()->DisableInputProcessing();
break;
case InfomainScript::c_Mama_Ctl:
@@ -1255,7 +1256,7 @@ MxResult Infocenter::Tickle()
}
// FUNCTION: LEGO1 0x10070c20
void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
void Infocenter::PlayCutscene(IntroScript::Script p_entityId, MxBool p_scale)
{
m_currentCutscene = p_entityId;
@@ -1265,9 +1266,9 @@ void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
SetAppCursor(e_cursorNone);
VideoManager()->GetDisplaySurface()->ClearScreen();
if (m_currentCutscene != e_noIntro) {
if (m_currentCutscene != IntroScript::c_noneIntro) {
// check if the cutscene is an ending
if (m_currentCutscene >= e_badEndMovie && m_currentCutscene <= e_goodEndMovie) {
if (m_currentCutscene >= IntroScript::c_BadEnd_Movie && m_currentCutscene <= IntroScript::c_GoodEnd_Movie) {
Reset();
}
@@ -1278,7 +1279,7 @@ void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
// FUNCTION: LEGO1 0x10070cb0
void Infocenter::StopCutscene()
{
if (m_currentCutscene != e_noIntro) {
if (m_currentCutscene != IntroScript::c_noneIntro) {
InvokeAction(Extra::ActionType::e_close, *g_introScript, m_currentCutscene, NULL);
}
@@ -1289,7 +1290,7 @@ void Infocenter::StopCutscene()
}
// FUNCTION: LEGO1 0x10070d00
MxBool Infocenter::VTable0x5c()
MxBool Infocenter::WaitForTransition()
{
return TRUE;
}
@@ -1392,12 +1393,12 @@ void Infocenter::Reset()
CharacterManager()->ReleaseAllActors();
GameState()->SetCurrentAct(LegoGameState::e_act1);
GameState()->m_previousArea = LegoGameState::e_undefined;
GameState()->m_unk0x42c = LegoGameState::e_undefined;
GameState()->m_savedPreviousArea = LegoGameState::e_undefined;
InitializeBitmaps();
m_selectedCharacter = e_pepper;
m_selectedCharacter = LegoActor::c_pepper;
GameState()->SetActor(e_pepper);
GameState()->SetActor(LegoActor::c_pepper);
HelicopterState* state = (HelicopterState*) GameState()->GetState("HelicopterState");
@@ -1441,10 +1442,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;

View File

@@ -529,7 +529,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;
}

View File

@@ -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 = "";
@@ -127,7 +127,7 @@ MxResult LegoAct2::Create(MxDSAction& p_dsAction)
}
m_gameState = state;
m_gameState->m_unk0x08 = 0;
m_gameState->m_state = 0;
switch (GameState()->GetLoadedAct()) {
case LegoGameState::e_act2:
@@ -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 (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;
}
@@ -294,12 +294,12 @@ MxLong LegoAct2::Notify(MxParam& p_param)
result = 1;
break;
}
case c_notificationType22:
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);
@@ -647,7 +648,7 @@ MxLong LegoAct2::HandlePathStruct(LegoPathStructNotificationParam& p_param)
local2world[3][1] += 1.5;
local2world2[3][1] -= 0.1;
m_bricks[m_nextBrick - 1].FUN_1007a670(local2world, local2world2, boundary);
m_bricks[m_nextBrick - 1].Place(local2world, local2world2, boundary);
}
return 0;
@@ -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;
@@ -671,10 +672,10 @@ MxResult LegoAct2::FUN_100516b0()
local2world[3][1] += 1.3;
local2world2[3][1] -= 0.1;
brick.FUN_1007a670(local2world, local2world2, boundary);
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;
@@ -933,98 +934,98 @@ MxResult LegoAct2::BadEnding()
LegoPathActor* actor = m_unk0x1138;
actor->SetActorState(LegoPathActor::c_disabled);
m_gameState->SetUnknown0x08(104);
m_gameState->SetState(LegoAct2State::c_badEnding);
m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
MxTrace("Bad End of Act2\n");
m_unk0x10c4 = 14;
m_state = LegoAct2::e_allPiecesCollected;
return SUCCESS;
}
// FUNCTION: LEGO1 0x10051fa0
// FUNCTION: BETA10 0x10013fd3
void LegoAct2::FUN_10051fa0(MxS32 p_param1)
void LegoAct2::CheckBricksterDestroying(MxS32 p_pathData)
{
MxU8 randN = rand() / (RAND_MAX / 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;
}
@@ -1032,44 +1033,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;
@@ -1077,30 +1078,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);
@@ -1188,7 +1189,7 @@ MxResult LegoAct2::FUN_10052560(
}
if (result == SUCCESS) {
m_unk0x1140 = p_objectId;
m_currentAction = p_objectId;
}
}
}
@@ -1198,7 +1199,7 @@ MxResult LegoAct2::FUN_10052560(
// FUNCTION: LEGO1 0x10052800
// FUNCTION: BETA10 0x10014aa8
MxResult LegoAct2::FUN_10052800()
MxResult LegoAct2::InitializeShooting()
{
LegoPathActor* actor = m_unk0x1138;
LegoLocomotionAnimPresenter* ap;
@@ -1222,6 +1223,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;
}

View File

@@ -46,17 +46,17 @@ RegistrationBook::RegistrationBook() : m_registerDialogueTimer(0x80000000), m_un
{
memset(m_alphabet, 0, sizeof(m_alphabet));
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;
@@ -152,9 +152,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;
@@ -186,37 +186,37 @@ MxLong RegistrationBook::HandleKeyPress(MxU8 p_key)
BackgroundAudioManager()->RaiseVolume();
}
}
else if (key != VK_BACK && m_unk0x280.m_cursorPos < 7) {
m_name[0][m_unk0x280.m_cursorPos] = m_alphabet[key - 'A']->Clone();
else if (key != VK_BACK && m_newName.m_cursorPos < 7) {
m_name[0][m_newName.m_cursorPos] = m_alphabet[key - 'A']->Clone();
if (m_name[0][m_unk0x280.m_cursorPos] != NULL) {
if (m_name[0][m_newName.m_cursorPos] != NULL) {
m_alphabet[key - 'A']->GetAction()->SetUnknown24(m_alphabet[key - 'A']->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] = key - 'A';
m_unk0x280.m_cursorPos++;
m_newName.m_letters[m_newName.m_cursorPos] = key - 'A';
m_newName.m_cursorPos++;
}
}
else {
if (key == VK_BACK && m_unk0x280.m_cursorPos > 0) {
m_unk0x280.m_cursorPos--;
if (key == VK_BACK && 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;
}
}
@@ -266,7 +266,7 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa
}
}
FUN_100775c0(i);
LoadSave(i);
}
}
@@ -275,56 +275,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);
}
@@ -341,7 +342,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");
@@ -353,7 +354,7 @@ void RegistrationBook::FUN_100778c0()
LegoPathStructNotificationParam(c_notificationPathStruct, NULL, 0, CopterScript::c_Helicopter_Actor)
);
m_unk0x2b8++;
m_vehiclesToPosition++;
}
if (act1state->m_jetskiPlane.IsPresent()) {
@@ -363,7 +364,7 @@ void RegistrationBook::FUN_100778c0()
LegoPathStructNotificationParam(c_notificationPathStruct, NULL, 0, JetskiScript::c_Jetski_Actor)
);
m_unk0x2b8++;
m_vehiclesToPosition++;
}
if (act1state->m_dunebuggyPlane.IsPresent()) {
@@ -373,7 +374,7 @@ void RegistrationBook::FUN_100778c0()
LegoPathStructNotificationParam(c_notificationPathStruct, NULL, 0, DunecarScript::c_DuneBugy_Actor)
);
m_unk0x2b8++;
m_vehiclesToPosition++;
}
if (act1state->m_racecarPlane.IsPresent()) {
@@ -383,10 +384,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);
@@ -593,10 +594,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);
}

View File

@@ -9,12 +9,6 @@
// LIBRARY: LEGO1 0x10086260
// ??3@YAXPAX@Z
// LIBRARY: LEGO1 0x1008a090
// _malloc
// LIBRARY: LEGO1 0x1008a100
// _calloc
// LIBRARY: LEGO1 0x1008a1c0
// _free
@@ -937,8 +931,31 @@
// GLOBAL: LEGO1 0x100db6e0
// GUID_SysKeyboard
// Cannot be handled right now due to anonymous pointer in struct
// GLOBAL: LEGO1 0x100dd1c0
// IID_IDirect3DRM2
// LIBRARY: LEGO1 0x1008c960
// ?_query_new_handler@@YAP6AHI@ZXZ
// LIBRARY: LEGO1 0x1008c970
// ?_query_new_mode@@YAHXZ
// GLOBAL: LEGO1 0x100fd8ec
// __newmode
// Cannot be handled right now due to anonymous pointer in struct.
// We can annotate it on the original side, but we have no symbol on the recomp side.
// We would need a way of annotating "the pointer at c_dfDIKeyboard+0x14 has orig address 0x10097f80".
// // GLOBAL: LEGO1 0x10098f80
// c_dfDIKeyboard
/// Globals from libraries without symbols
// STRING: LEGO1 0x100dabb0
static const char* ___crtLCMapStringA_str = "\0";
// STRING: LEGO1 0x100dabb4
static const wchar_t *___crtLCMapStringA_wstr = L"\0";
#endif

312
LEGO1/library_smartheap.h Normal file
View File

@@ -0,0 +1,312 @@
#if 0
// LIBRARY: LEGO1 0x100861d0
// ?shi_New@@YAPAXKIPAU_SHI_Pool@@@Z
// LIBRARY: LEGO1 0x10086270
// _MemInitDefaultPool@0
// LIBRARY: LEGO1 0x100862e0
// _shi_call_new_handler_msc
// LIBRARY: LEGO1 0x10086310
// _MemPoolShrink@4
// LIBRARY: LEGO1 0x10086440
// _MemPoolPreAllocate@12
// LIBRARY: LEGO1 0x100865c0
// @_shi_initPageHeaders@4
// LIBRARY: LEGO1 0x10086830
// @shi_allocPageHeader@4
// LIBRARY: LEGO1 0x10086860
// @shi_freePageHeader@8
// LIBRARY: LEGO1 0x10086a10
// @_shi_deletePage@8
// LIBRARY: LEGO1 0x10086af0
// @_shi_allocExternal@12
// LIBRARY: LEGO1 0x10086d10
// @_shi_initPageVariable@8
// LIBRARY: LEGO1 0x10086dc0
// _MemAllocPtr@12
// LIBRARY: LEGO1 0x10087020
// @_shi_allocVar@12
// LIBRARY: LEGO1 0x100871b0
// @_shi_allocBlock@12
// LIBRARY: LEGO1 0x10087380
// _MemFreePtr@4
// LIBRARY: LEGO1 0x10087430
// @_shi_freeVar@4
// LIBRARY: LEGO1 0x10087520
// _MemReAllocPtr@12
// LIBRARY: LEGO1 0x10087670
// @_shi_resizeAny@16
// LIBRARY: LEGO1 0x10087910
// @_shi_resizeVar@8
// LIBRARY: LEGO1 0x10087ae0
// _MemSizePtr@4
// LIBRARY: LEGO1 0x10087b90
// @shi_findAllocAddress@4
// LIBRARY: LEGO1 0x10087bd0
// @_shi_sysAlloc@8
// LIBRARY: LEGO1 0x10087c60
// @_shi_sysFree@4
// LIBRARY: LEGO1 0x10087cc0
// @_shi_sysRealloc@12
// LIBRARY: LEGO1 0x10087d70
// @_shi_sysResize@12
// LIBRARY: LEGO1 0x10087e50
// @_shi_sysSize@4
// LIBRARY: LEGO1 0x10087e90
// @_shi_sysAllocNear@4
// LIBRARY: LEGO1 0x10087eb0
// @_shi_sysFreeNear@4
// LIBRARY: LEGO1 0x10087ed0
// @_shi_sysValidatePtr@12
// LIBRARY: LEGO1 0x10087fd0
// @_shi_sysValidateFunction@4
// LIBRARY: LEGO1 0x100885c0
// @_shi_sysAllocPool@12
// LIBRARY: LEGO1 0x100887e0
// @_shi_sysResizePool@16
// LIBRARY: LEGO1 0x10088950
// @_shi_sysFreePage@4
// LIBRARY: LEGO1 0x10088a70
// @_shi_sysSizePage@4
// LIBRARY: LEGO1 0x10088aa0
// @_shi_sysSizePool@8
// LIBRARY: LEGO1 0x10088ac0
// @_shi_registerShared@16
// LIBRARY: LEGO1 0x10088cc0
// @_shi_unregisterShared@8
// LIBRARY: LEGO1 0x10088de0
// @_shi_getNextPool@4
// LIBRARY: LEGO1 0x10088df0
// @shi_delNextPool@4
// LIBRARY: LEGO1 0x10088ff0
// @shi_createAndEnterMutexShr@12
// LIBRARY: LEGO1 0x100890e0
// @shi_termPoolMutexShr@4
// LIBRARY: LEGO1 0x10089100
// @shi_enterPoolMutexShr@4
// LIBRARY: LEGO1 0x10089120
// @shi_leavePoolMutexShr@4
// LIBRARY: LEGO1 0x10089140
// __shi_enterCriticalSection@0
// LIBRARY: LEGO1 0x10089160
// __shi_leaveCriticalSection@0
// LIBRARY: LEGO1 0x10089180
// __shi_createAndEnterMutex
// LIBRARY: LEGO1 0x100891b0
// _shi_enterPoolMutexSafely
// LIBRARY: LEGO1 0x10089290
// _shi_enterPoolInitMutexReader
// LIBRARY: LEGO1 0x10089320
// _shi_leavePoolInitMutexReader
// LIBRARY: LEGO1 0x10089350
// _shi_enterPoolInitMutexWriter
// LIBRARY: LEGO1 0x10089420
// _shi_leavePoolInitMutexWriter
// LIBRARY: LEGO1 0x10089440
// _shi_isNT
// LIBRARY: LEGO1 0x10089470
// _MemPoolInit@4
// LIBRARY: LEGO1 0x100897e0
// _MemPoolSetPageSize@8
// LIBRARY: LEGO1 0x100898f0
// _MemPoolSetBlockSizeFS@8
// LIBRARY: LEGO1 0x100899d0
// @_shi_poolFree@8
// LIBRARY: LEGO1 0x10089b80
// @_shi_invokeErrorHandler1@8
// LIBRARY: LEGO1 0x10089ea0
// _MemErrorUnwind@0
// LIBRARY: LEGO1 0x10089ef0
// _MemDefaultErrorHandler@4
// LIBRARY: LEGO1 0x10089f70
// @_shi_taskRemovePool@4
// LIBRARY: LEGO1 0x1008a010
// @_shi_getCurrentThreadContext@8
// LIBRARY: LEGO1 0x1008a070
// @_shi_deleteThreadContext@8
// LIBRARY: LEGO1 0x1008a090
// _malloc
// LIBRARY: LEGO1 0x1008a100
// _calloc
// LIBRARY: LEGO1 0x1008a160
// _realloc
// LIBRARY: LEGO1 0x1008a1d0
// __expand
// LIBRARY: LEGO1 0x1008a210
// __heapadd
// LIBRARY: LEGO1 0x1008a220
// __heapwalk
// LIBRARY: LEGO1 0x1008a2b0
// __heapused
// LIBRARY: LEGO1 0x1008a2e0
// __heapmin
// LIBRARY: LEGO1 0x1008a300
// __msize
// LIBRARY: LEGO1 0x1008a310
// __heapchk
// LIBRARY: LEGO1 0x1008a340
// __heapset
// LIBRARY: LEGO1 0x1008a350
// @_shi_sysReportError@16
// LIBRARY: LEGO1 0x1008a3d0
// _MemPoolSize@4
// LIBRARY: LEGO1 0x1008a460
// _MemPoolWalk@8
// LIBRARY: LEGO1 0x1008a500
// @_shi_walkPool@16
// LIBRARY: LEGO1 0x1008a800
// @shi_isBlockInUseSmall@8
// LIBRARY: LEGO1 0x1008aac0
// @_shi_isBlockInUseFS@12
// LIBRARY: LEGO1 0x1008ab40
// _MemPoolCheck@4
// LIBRARY: LEGO1 0x1008ade0
// _MemCheckPtr@8
// GLOBAL: LEGO1 0x100da970
// _szLibName
// GLOBAL: LEGO1 0x100fc528
// ?_new_handler@@3P6AXXZA
// GLOBAL: LEGO1 0x100fc530
// _MemDefaultPool
// GLOBAL: LEGO1 0x100fc54c
// __shi_compactPoolFn
// GLOBAL: LEGO1 0x100fc550
// __shi_compactPageFn
// GLOBAL: LEGO1 0x100fc554
// _MemDefaultPoolFlags
// GLOBAL: LEGO1 0x100fc55c
// __shi_mutexGlobalInit
// GLOBAL: LEGO1 0x100fc560
// __shi_mutexMovInit
// GLOBAL: LEGO1 0x100fc564
// __shi_mutexMovLockCount
// GLOBAL: LEGO1 0x100fc568
// _shi_initPoolReaders
// GLOBAL: LEGO1 0x100fc56c
// _shi_eventInitPool
// GLOBAL: LEGO1 0x100fc570
// _shi_mutexMovShr
// GLOBAL: LEGO1 0x100fc598
// _shi_deferFreePools
// GLOBAL: LEGO1 0x100fc5a8
// __shi_poolTerminating
// GLOBAL: LEGO1 0x100fc5ac
// _MemDefaultPoolBlockSizeFS
// GLOBAL: LEGO1 0x100fc5b0
// _MemDefaultPoolPageSize
// GLOBAL: LEGO1 0x100fc5b4
// _SmartHeap_malloc
// GLOBAL: LEGO1 0x100fc7e0
// __shi_TaskRecord
// GLOBAL: LEGO1 0x10109368
// ?_pnhHeap@@3P6AHI@ZA
// GLOBAL: LEGO1 0x101095a0
// __shi_mutexMov
// GLOBAL: LEGO1 0x101095c0
// _shi_mutexPoolSynch
// GLOBAL: LEGO1 0x101095e0
// __shi_mutexGlobal
#endif

View File

@@ -22,11 +22,11 @@ public:
}
// 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

View File

@@ -14,10 +14,10 @@ public:
// 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 @@ public:
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

View File

@@ -29,7 +29,7 @@ enum NotificationId {
c_notificationPathStruct = 19, // 100d6230
c_notificationType20 = 20,
c_notificationNewPresenter = 21,
c_notificationType22 = 22,
c_notificationAct2Brick = 22,
c_notificationType23 = 23,
c_notificationTransitioned = 24
};

View File

@@ -43,7 +43,7 @@ public:
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; }

View File

@@ -11,7 +11,7 @@
DECOMP_SIZE_ASSERT(MxSoundManager, 0x3c);
// GLOBAL LEGO1 0x10101420
// GLOBAL: LEGO1 0x10101420
MxS32 g_volumeAttenuation[100] = {-6643, -5643, -5058, -4643, -4321, -4058, -3836, -3643, -3473, -3321, -3184, -3058,
-2943, -2836, -2736, -2643, -2556, -2473, -2395, -2321, -2251, -2184, -2120, -2058,
-2000, -1943, -1888, -1836, -1785, -1736, -1689, -1643, -1599, -1556, -1514, -1473,

View File

@@ -22,8 +22,8 @@ public:
// FUNCTION: BETA10 0x1000fc70
Matrix4(float (*p_data)[4]) { SetData(p_data); }
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

View File

@@ -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

View File

@@ -56,7 +56,7 @@ public:
// BoundingSphere::operator=
// SYNTHETIC: BETA10 0x1001fc50
// BoundingSphere::BoundingSphere
// ??0BoundingSphere@@QAE@XZ
private:
Mx3DPointFloat center; // 0x00

View File

@@ -88,8 +88,7 @@ inline Result RendererCreateDevice(
if (Succeeded(result)) {
if (rCreateData.m_pBackBuffer) {
// LEGO1 0x10101040
// GLOBAL: BETA10 0x102055f4
// annotated below
static int g_setBufferCount = 1;
if (g_setBufferCount) {
Result result2 = ResultVal(rpDevice->SetBufferCount(2));
@@ -101,6 +100,10 @@ inline Result RendererCreateDevice(
return result;
}
// GLOBAL: LEGO1 0x10101040
// GLOBAL: BETA10 0x102055f4
// ?g_setBufferCount@?3??RendererCreateDevice@@YA?AW4Result@Tgl@@PAUIDirect3DRM2@@ABUDeviceDirectDrawCreateData@3@AAPAUIDirect3DRMDevice2@@@Z@4HA
// FUNCTION: BETA10 0x1016cf40
inline Result RendererImpl::CreateDevice(const DeviceDirectDrawCreateData& rCreateData, DeviceImpl& rDevice)
{

View File

@@ -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);
}
}

View File

@@ -38,6 +38,10 @@ targets:
- 0x100fb080
# memset etc.
- 0x100f9570
name-substitutions:
# Rename matched functions named like `FUN_12345678` to `LEGO1_12345678`
# so we can distinguish them from non-matched functions
- ["FUN_([0-9a-f]{8})", "LEGO1_\\1"]
ALPHA:
filename: ALPHA.DLL
source-root: LEGO1