Merge remote-tracking branch 'isle/master'

This commit is contained in:
Christian Semmler 2025-08-10 13:16:30 -07:00
commit 0f1b8e8430
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
39 changed files with 322 additions and 236 deletions

View File

@ -293,7 +293,7 @@ void IsleDebug_Render()
ImGui::Text("Current act: %d", gameState->GetCurrentAct());
ImGui::Text("Loaded act: %d", gameState->GetLoadedAct());
ImGui::Text("Previous area: %d", gameState->m_previousArea);
ImGui::Text("Unknown 0x42c: %d", gameState->m_unk0x42c);
ImGui::Text("Saved previous area: %d", gameState->m_savedPreviousArea);
ImGui::Value("Player count", gameState->m_playerCount);
ImGui::TreePop();
}

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 @@ class Act2Brick : public LegoPathActor {
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);
@ -44,12 +51,12 @@ class Act2Brick : public LegoPathActor {
static const LegoChar* g_lodNames[];
static MxLong g_lastHitActorTime;
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
LegoCacheSound* m_whistleSound; // 0x154
undefined m_unk0x158[0x0c]; // 0x158
MxU32 m_state; // 0x164
Mx3DPointFloat m_localToWorldMovementStep; // 0x168
Mx3DPointFloat m_endLocalToWorld; // 0x17c
MxS32 m_step; // 0x190
};
#endif // ACT2BRICK_H

View File

@ -18,14 +18,20 @@ class MxQuaternionTransformer;
// SIZE 0x0c
struct Act3ListElement {
MxU32 m_objectId; // 0x00
undefined4 m_unk0x04; // 0x04
MxBool m_hasStarted; // 0x08
enum InsertMode {
e_replaceAction = 1,
e_queueAction = 2,
e_onlyIfEmpty = 3
};
MxU32 m_objectId; // 0x00
InsertMode m_insertMode; // 0x04
MxBool m_hasStarted; // 0x08
Act3ListElement() {}
Act3ListElement(MxU32 p_objectId, undefined4 p_unk0x04, MxBool p_hasStarted)
: m_objectId(p_objectId), m_unk0x04(p_unk0x04), m_hasStarted(p_hasStarted)
Act3ListElement(MxU32 p_objectId, InsertMode p_insertMode, MxBool p_hasStarted)
: m_objectId(p_objectId), m_insertMode(p_insertMode), m_hasStarted(p_hasStarted)
{
}
@ -36,21 +42,15 @@ struct Act3ListElement {
// SIZE 0x10
class Act3List : private list<Act3ListElement> {
public:
enum InsertMode {
e_replaceAction = 1,
e_queueAction = 2,
e_onlyIfEmpty = 3
};
Act3List() { m_cleared = FALSE; }
Act3List() { m_unk0x0c = 0; }
void Insert(MxS32 p_objectId, InsertMode p_option);
void Insert(MxS32 p_objectId, Act3ListElement::InsertMode p_option);
void DeleteActionWrapper();
void Clear();
void RemoveByObjectIdOrFirst(MxU32 p_objectId);
private:
undefined4 m_unk0x0c; // 0x0c
MxU32 m_cleared; // 0x0c
};
// VTABLE: LEGO1 0x100d4fc8
@ -58,7 +58,14 @@ class Act3List : private list<Act3ListElement> {
// SIZE 0x0c
class Act3State : public LegoState {
public:
Act3State() { m_unk0x08 = 0; }
enum {
e_initial = 0,
e_ready = 1,
e_goodEnding = 2,
e_badEnding = 3,
};
Act3State() { m_state = Act3State::e_initial; }
// FUNCTION: LEGO1 0x1000e2f0
MxBool IsSerializable() override { return FALSE; }
@ -80,11 +87,11 @@ class Act3State : public LegoState {
// SYNTHETIC: LEGO1 0x1000e3c0
// Act3State::`scalar deleting destructor'
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
};
// VTABLE: LEGO1 0x100d9628

View File

@ -75,11 +75,11 @@ class Act1State : public LegoState {
MxU32 GetState() { return m_state; }
ElevatorFloor GetElevatorFloor() { return (ElevatorFloor) m_elevFloor; }
MxU8 GetUnknown21() { return m_unk0x021; }
MxBool IsSpawnInInfocenter() { return m_spawnInInfocenter; }
void SetState(MxU32 p_state) { m_state = p_state; }
void SetElevatorFloor(ElevatorFloor p_elevFloor) { m_elevFloor = p_elevFloor; }
void SetUnknown21(MxU8 p_unk0x21) { m_unk0x021 = p_unk0x21; }
void SetSpawnInInfocenter(MxBool p_spawnInInfocenter) { m_spawnInInfocenter = p_spawnInInfocenter; }
// SYNTHETIC: LEGO1 0x10033960
// Act1State::`scalar deleting destructor'
@ -90,11 +90,11 @@ class Act1State : public LegoState {
IsleScript::Script m_currentCptClickDialogue; // 0x014
MxU32 m_state; // 0x018
MxS16 m_elevFloor; // 0x01c
MxBool m_unk0x01e; // 0x01e
MxBool m_unk0x01f; // 0x01f
MxBool m_playingFloor2Animation; // 0x01e
MxBool m_switchedToArea; // 0x01f
MxBool m_planeActive; // 0x020
undefined m_unk0x021; // 0x021
MxBool m_unk0x022; // 0x022
MxBool m_spawnInInfocenter; // 0x021
MxBool m_playedExitExplanation; // 0x022
undefined m_unk0x023; // 0x023
LegoNamedPlane m_motocyclePlane; // 0x024
LegoNamedPlane m_bikePlane; // 0x070

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,14 +47,14 @@ class LegoAct2State : public LegoState {
// 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
MxBool m_enabled; // 0x0c
MxU32 m_state; // 0x08
MxBool m_enabled; // 0x0c
};
// VTABLE: LEGO1 0x100d82e0

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 @@ class LegoAnimActor : public virtual LegoPathActor {
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

@ -13,6 +13,7 @@
class LegoCacheSound : public MxCore {
public:
LegoCacheSound();
LegoCacheSound(LegoCacheSound& p_sound);
~LegoCacheSound() override; // vtable+0x00
// FUNCTION: LEGO1 0x10006580
@ -49,6 +50,8 @@ class LegoCacheSound : public MxCore {
void SetDistance(MxS32 p_min, MxS32 p_max);
void MuteSilence(MxBool p_muted);
void MuteStop(MxBool p_mute);
LegoCacheSound& operator=(LegoCacheSound& p_sound);
void CopyFrom(LegoCacheSound& p_sound);
// SYNTHETIC: LEGO1 0x10006610
// SYNTHETIC: BETA10 0x100675b0

View File

@ -76,9 +76,9 @@ class LegoEntity : public MxEntity {
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

@ -179,7 +179,7 @@ class LegoGameState {
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; }
@ -269,7 +269,7 @@ class LegoGameState {
MxBool m_isDirty; // 0x420
Area m_currentArea; // 0x424
Area m_previousArea; // 0x428
Area m_unk0x42c; // 0x42c
Area m_savedPreviousArea; // 0x42c
static const InternationalCharacter g_intCharacters[8];
};

View File

@ -72,7 +72,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

@ -48,6 +48,7 @@ class MxBackgroundAudioManager : public MxCore {
virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS);
void Init();
void Update(MxS32 p_targetVolume, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
void Stop();
void LowerVolume();
void RaiseVolume();

View File

@ -15,7 +15,7 @@ class RaceSkel : public LegoAnimActor {
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

@ -57,39 +57,39 @@ MxBool g_unk0x100f0f28 = FALSE;
// GLOBAL: LEGO1 0x100f0f30
// GLOBAL: BETA10 0x101dbe48
MxS32 g_unk0x100f0f30[] = {2, 23, 32, 66, 71, 72, 73, -1};
MxS32 g_stage0Plants[] = {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_stage1Plants[] = {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_stage2Plants[] = {12, 19, 24, 48, 60, -1};
// GLOBAL: LEGO1 0x100f0fa8
// GLOBAL: BETA10 0x101dbec0
MxS32 g_unk0x100f0fa8[] = {8, 15, 46, -1};
MxS32 g_stage3Plants[] = {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_stage4Plants[] = {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_stage5Plants[] = {3, 40, 53, 55, -1};
// GLOBAL: LEGO1 0x100f1000
// GLOBAL: BETA10 0x101dbf18
MxS32 g_unk0x100f1000[] = {22, 33, 41, 45, 67, -1};
MxS32 g_stage6Plants[] = {22, 33, 41, 45, 67, -1};
// GLOBAL: LEGO1 0x100f1018
// GLOBAL: BETA10 0x101dbf30
MxS32 g_unk0x100f1018[] = {13, 30, 31, 62, -1};
MxS32 g_stage7Plants[] = {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_stage8Plants[] = {1, 27, 37, 44, 47, 54, 61, 64, -1};
// --- End of indices into g_plantInfo ---
@ -144,7 +144,7 @@ void Act2Actor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
void Act2Actor::FUN_10018980()
{
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];
}
}
@ -727,9 +727,9 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
*p_param = 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_stage0Plants[i] != -1; i++) {
if (plantInfo[g_stage0Plants[i]].m_counter) {
result = plantInfo[g_stage0Plants[i]].m_entity;
break;
}
}
@ -741,9 +741,9 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
*p_param = 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_stage1Plants[i] != -1; i++) {
if (plantInfo[g_stage1Plants[i]].m_counter) {
result = plantInfo[g_stage1Plants[i]].m_entity;
break;
}
}
@ -759,9 +759,9 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
*p_param = 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_stage2Plants[i] != -1; i++) {
if (plantInfo[g_stage2Plants[i]].m_counter) {
result = plantInfo[g_stage2Plants[i]].m_entity;
break;
}
}
@ -781,9 +781,9 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
*p_param = 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_stage3Plants[i] != -1; i++) {
if (plantInfo[g_stage3Plants[i]].m_counter) {
result = plantInfo[g_stage3Plants[i]].m_entity;
break;
}
}
@ -799,9 +799,9 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
*p_param = 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_stage4Plants[i] != -1; i++) {
if (plantInfo[g_stage4Plants[i]].m_counter) {
result = plantInfo[g_stage4Plants[i]].m_entity;
break;
}
}
@ -813,9 +813,9 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
*p_param = 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_stage5Plants[i] != -1; i++) {
if (plantInfo[g_stage5Plants[i]].m_counter) {
result = plantInfo[g_stage5Plants[i]].m_entity;
break;
}
}
@ -827,9 +827,9 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
*p_param = 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_stage6Plants[i] != -1; i++) {
if (plantInfo[g_stage6Plants[i]].m_counter) {
result = plantInfo[g_stage6Plants[i]].m_entity;
break;
}
}
@ -841,18 +841,18 @@ LegoEntity* Act2Actor::FUN_10019b90(MxBool* p_param)
*p_param = 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_stage7Plants[i] != -1; i++) {
if (plantInfo[g_stage7Plants[i]].m_counter) {
result = plantInfo[g_stage7Plants[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_stage8Plants[i] != -1; i++) {
if (plantInfo[g_stage8Plants[i]].m_counter) {
result = plantInfo[g_stage8Plants[i]].m_entity;
break;
}
}

View File

@ -271,7 +271,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];
}
}
@ -559,7 +559,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

@ -111,8 +111,8 @@ void Bike::ActivateSceneActions()
PlayMusic(JukeboxScript::c_InformationCenter_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x022) {
act1state->m_unk0x022 = TRUE;
if (!act1state->m_playedExitExplanation) {
act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

View File

@ -195,8 +195,8 @@ void DuneBuggy::ActivateSceneActions()
PlayMusic(JukeboxScript::c_GarageArea_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x022) {
act1state->m_unk0x022 = TRUE;
if (!act1state->m_playedExitExplanation) {
act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

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

View File

@ -165,11 +165,11 @@ void Jetski::ActivateSceneActions()
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_state) {
if (act1state->m_unk0x022) {
if (act1state->m_playedExitExplanation) {
PlayCamAnim(this, FALSE, 68, TRUE);
}
else {
act1state->m_unk0x022 = TRUE;
act1state->m_playedExitExplanation = TRUE;
LegoPathActor* user = UserActor();
if (user != NULL) {

View File

@ -153,8 +153,8 @@ void Motocycle::ActivateSceneActions()
PlayMusic(JukeboxScript::c_PoliceStation_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x022) {
act1state->m_unk0x022 = TRUE;
if (!act1state->m_playedExitExplanation) {
act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

View File

@ -151,8 +151,8 @@ void SkateBoard::ActivateSceneActions()
if (m_act1state->m_state != Act1State::e_pizza) {
PlayMusic(JukeboxScript::c_BeachBlvd_Music);
if (!m_act1state->m_unk0x022) {
m_act1state->m_unk0x022 = TRUE;
if (!m_act1state->m_playedExitExplanation) {
m_act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.2, mat[2][2] * 2.5);

View File

@ -272,6 +272,29 @@ void LegoCacheSound::MuteStop(MxBool p_muted)
}
}
// FUNCTION: BETA10 0x10066fa9
LegoCacheSound::LegoCacheSound(LegoCacheSound& p_sound)
{
CopyFrom(p_sound);
}
// FUNCTION: BETA10 0x10067062
LegoCacheSound& LegoCacheSound::operator=(LegoCacheSound& p_sound)
{
if (this == &p_sound) {
return *this;
}
CopyFrom(p_sound);
return *this;
}
// FUNCTION: BETA10 0x1006709d
void LegoCacheSound::CopyFrom(LegoCacheSound& p_sound)
{
assert(0);
}
// FUNCTION: LEGO1 0x10006d80
// FUNCTION: BETA10 0x100670e7
MxString LegoCacheSound::GetBaseFilename(MxString& p_path)

View File

@ -282,6 +282,17 @@ MxResult MxBackgroundAudioManager::PlayMusic(
return FAILURE;
}
// FUNCTION: BETA10 0x100e92ec
void MxBackgroundAudioManager::Update(MxS32 p_targetVolume, MxS32 p_speed, MxPresenter::TickleState p_tickleState)
{
assert(p_targetVolume >= 0 && p_targetVolume <= 100);
assert(p_speed > 0);
m_tickleState = p_tickleState;
m_speed = p_speed;
m_targetVolume = p_targetVolume;
}
// FUNCTION: LEGO1 0x1007f470
// FUNCTION: BETA10 0x100e9388
void MxBackgroundAudioManager::Stop()

View File

@ -167,7 +167,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;
@ -326,7 +326,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
}
}
area = m_unk0x42c;
area = m_savedPreviousArea;
storage.WriteU16(area);
SerializeScoreHistory(LegoFile::c_write);
m_isDirty = FALSE;
@ -445,10 +445,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;
@ -1205,7 +1205,7 @@ void LegoGameState::Init()
}
}
m_unk0x42c = e_undefined;
m_savedPreviousArea = e_undefined;
}
// FUNCTION: BETA10 0x10086510
@ -1584,18 +1584,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

@ -525,7 +525,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

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

@ -158,7 +158,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;
@ -185,14 +190,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

@ -870,7 +870,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
}
GameState()->SetCurrentAct(LegoGameState::e_act3);
act3State->m_unk0x08 = 2;
act3State->m_state = Act3State::e_goodEnding;
GameState()->m_currentArea = LegoGameState::e_act3script;
GameState()->SwitchArea(LegoGameState::e_infomain);
break;
@ -884,7 +884,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
}
GameState()->SetCurrentAct(LegoGameState::e_act3);
act3State->m_unk0x08 = 3;
act3State->m_state = Act3State::e_badEnding;
GameState()->m_currentArea = LegoGameState::e_act3script;
GameState()->SwitchArea(LegoGameState::e_infomain);
break;

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

@ -163,7 +163,7 @@ MxResult LegoPathActor::VTable0x88(
}
else {
m_boundary->AddActor(this);
FUN_10010c30();
TransformPointOfView();
}
m_unk0xec = m_roi->GetLocal2World();
@ -223,7 +223,7 @@ MxResult LegoPathActor::VTable0x84(
if (m_cameraFlag && m_userNavFlag) {
m_boundary->AddActor(this);
FUN_10010c30();
TransformPointOfView();
}
else {
p5.EqualsCross(*p_boundary->GetUp(), p3);
@ -393,14 +393,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();
}
}
}
@ -746,7 +746,7 @@ void LegoPathActor::VTable0xa8()
if (m_userNavFlag) {
m_roi->WrappedSetLocal2WorldWithWorldDataUpdate(m_unk0xec);
FUN_10010c30();
TransformPointOfView();
}
}

View File

@ -271,10 +271,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

@ -1438,7 +1438,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

@ -110,14 +110,14 @@ Act3Script::Script g_unk0x100d95e8[] =
{Act3Script::c_tlp053in_RunAnim, Act3Script::c_tlp064la_RunAnim, Act3Script::c_tlp068in_RunAnim};
// FUNCTION: LEGO1 0x10071d40
void Act3List::Insert(MxS32 p_objectId, InsertMode p_option)
void Act3List::Insert(MxS32 p_objectId, Act3ListElement::InsertMode p_option)
{
if (m_unk0x0c) {
if (m_cleared) {
return;
}
switch (p_option) {
case InsertMode::e_replaceAction:
case Act3ListElement::InsertMode::e_replaceAction:
if (!empty()) {
DeleteActionWrapper();
push_back(Act3ListElement(p_objectId, p_option, FALSE));
@ -127,7 +127,7 @@ void Act3List::Insert(MxS32 p_objectId, InsertMode p_option)
push_back(Act3ListElement(p_objectId, p_option, TRUE));
}
break;
case InsertMode::e_queueAction:
case Act3ListElement::InsertMode::e_queueAction:
if (empty()) {
push_back(Act3ListElement(p_objectId, p_option, TRUE));
InvokeAction(Extra::e_start, *g_act3Script, p_objectId, NULL);
@ -136,7 +136,7 @@ void Act3List::Insert(MxS32 p_objectId, InsertMode p_option)
push_back(Act3ListElement(p_objectId, p_option, FALSE));
}
break;
case InsertMode::e_onlyIfEmpty:
case Act3ListElement::InsertMode::e_onlyIfEmpty:
if (empty()) {
push_back(Act3ListElement(p_objectId, p_option, TRUE));
InvokeAction(Extra::e_start, *g_act3Script, p_objectId, NULL);
@ -154,7 +154,7 @@ void Act3List::DeleteActionWrapper()
// FUNCTION: LEGO1 0x10071fb0
void Act3List::Clear()
{
m_unk0x0c = 1;
m_cleared = TRUE;
BackgroundAudioManager()->Stop();
if (empty()) {
@ -177,7 +177,7 @@ void Act3List::Clear()
// FUNCTION: LEGO1 0x100720d0
void Act3List::RemoveByObjectIdOrFirst(MxU32 p_objectId)
{
if (m_unk0x0c) {
if (m_cleared) {
return;
}
@ -215,7 +215,7 @@ void Act3List::RemoveByObjectIdOrFirst(MxU32 p_objectId)
it++;
while (it != end()) {
if ((*it).m_unk0x04 == 1) {
if ((*it).m_insertMode == Act3ListElement::e_replaceAction) {
for (Act3List::iterator it2 = begin(); it2 != it; erase(it2++)) {
if ((*it2).m_hasStarted) {
DeleteActionWrapper();
@ -469,14 +469,14 @@ void Act3::TriggerHitSound(undefined4 p_param1)
m_bricksterDonutSound = 0;
}
m_unk0x4220.Insert(g_bricksterDonutSounds[m_bricksterDonutSound++], Act3List::e_replaceAction);
m_unk0x4220.Insert(g_bricksterDonutSounds[m_bricksterDonutSound++], Act3ListElement::e_replaceAction);
return;
}
default:
return;
}
m_unk0x4220.Insert(objectId, Act3List::e_onlyIfEmpty);
m_unk0x4220.Insert(objectId, Act3ListElement::e_onlyIfEmpty);
}
// FUNCTION: LEGO1 0x10072c30
@ -633,22 +633,22 @@ MxLong Act3::Notify(MxParam& p_param)
break;
}
case c_notificationKeyPress:
if (m_state->m_unk0x08 == 1 && ((LegoEventNotificationParam&) p_param).GetKey() == ' ') {
if (m_state->m_state == Act3State::e_ready && ((LegoEventNotificationParam&) p_param).GetKey() == ' ') {
AnimationManager()->FUN_10061010(FALSE);
return 1;
}
break;
case c_notificationButtonUp:
case c_notificationButtonDown:
if (m_state->m_unk0x08 == 1) {
if (m_state->m_state == Act3State::e_ready) {
return 1;
}
break;
case c_notificationEndAnim:
if (m_state->m_unk0x08 == 1) {
if (m_state->m_state == Act3State::e_ready) {
assert(m_copter && m_brickster && m_cop1 && m_cop2);
m_unk0x4220.RemoveByObjectIdOrFirst(0);
m_state->m_unk0x08 = 0;
m_state->m_state = Act3State::e_initial;
Disable(TRUE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
m_copter->HandleClick();
m_copter->m_state->m_unk0x08 = 1;
@ -687,7 +687,7 @@ void Act3::ReadyWorld()
AnimationManager()
->FUN_10060dc0(m_unk0x426c, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, TRUE, FALSE, FALSE, FALSE);
m_state->m_unk0x08 = 1;
m_state->m_state = Act3State::e_ready;
}
// FUNCTION: LEGO1 0x10073300
@ -759,7 +759,7 @@ void Act3::SetBrickster(Act3Brickster* p_brickster)
// FUNCTION: LEGO1 0x10073400
void Act3::FUN_10073400()
{
m_state->m_unk0x08 = 2;
m_state->m_state = Act3State::e_goodEnding;
m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
@ -767,7 +767,7 @@ void Act3::FUN_10073400()
// FUNCTION: LEGO1 0x10073430
void Act3::FUN_10073430()
{
m_state->m_unk0x08 = 3;
m_state->m_state = Act3State::e_badEnding;
m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
@ -797,7 +797,7 @@ void Act3::GoodEnding(const Matrix4& p_destination)
EmitGameEvent(e_goodEnding);
#else
m_state->m_unk0x08 = 2;
m_state->m_state = Act3State::e_goodEnding;
GameState()->SwitchArea(LegoGameState::Area::e_infomain);
#endif
}

View File

@ -220,7 +220,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);
@ -523,7 +523,7 @@ 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);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
@ -568,14 +568,14 @@ void Infocenter::ReadyWorld()
Act3State* state = (Act3State*) GameState()->GetState("Act3State");
GameState()->FindLoadedAct();
if (state && state->GetUnknown0x08() == 3) {
if (state && state->GetState() == Act3State::e_badEnding) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
}
if (state && state->GetUnknown0x08() == 2) {
if (state && state->GetState() == Act3State::e_goodEnding) {
bg->Enable(TRUE);
PlayCutscene(e_goodEndMovie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
@ -1089,7 +1089,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:
@ -1399,7 +1399,7 @@ 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;

View File

@ -244,15 +244,15 @@ void Isle::HandleElevatorEndAction()
m_act1state->m_state = Act1State::e_none;
break;
case Act1State::c_floor2:
if (m_act1state->m_unk0x01e) {
m_act1state->m_unk0x01e = FALSE;
if (m_act1state->m_playingFloor2Animation) {
m_act1state->m_playingFloor2Animation = FALSE;
m_act1state->m_state = Act1State::e_none;
InputManager()->EnableInputProcessing();
}
else {
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Floor2, NULL);
InputManager()->EnableInputProcessing();
m_act1state->m_unk0x01e = TRUE;
m_act1state->m_playingFloor2Animation = TRUE;
}
break;
case Act1State::c_floor3:
@ -268,10 +268,10 @@ void Isle::ReadyWorld()
{
LegoWorld::ReadyWorld();
if (m_act1state->GetUnknown21()) {
if (m_act1state->IsSpawnInInfocenter()) {
GameState()->SwitchArea(LegoGameState::e_infomain);
m_act1state->SetState(Act1State::e_none);
m_act1state->SetUnknown21(0);
m_act1state->SetSpawnInInfocenter(FALSE);
}
else if (GameState()->GetLoadedAct() != LegoGameState::e_act1) {
EnableAnimations(TRUE);
@ -318,7 +318,7 @@ MxLong Isle::HandleControl(LegoControlManagerNotificationParam& p_param)
break;
case Act1State::c_floor2:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Floor2, NULL);
m_act1state->m_unk0x01e = TRUE;
m_act1state->m_playingFloor2Animation = TRUE;
break;
case Act1State::c_floor3:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev3_2_Ride, NULL);
@ -907,7 +907,7 @@ MxLong Isle::HandleTransitionEnd()
m_destLocation = LegoGameState::e_undefined;
break;
case LegoGameState::e_elevride:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
VariableTable()->SetVariable("VISIBILITY", "Hide infocen");
TransitionToOverlay(
IsleScript::c_ElevRide_Background_Bitmap,
@ -961,7 +961,7 @@ MxLong Isle::HandleTransitionEnd()
);
break;
case LegoGameState::e_garadoor:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
VariableTable()->SetVariable("VISIBILITY", "Hide Gas");
TransitionToOverlay(IsleScript::c_GaraDoor_Background_Bitmap, JukeboxScript::c_JBMusic2, "LCAMZG1,90", FALSE);
break;
@ -986,7 +986,7 @@ MxLong Isle::HandleTransitionEnd()
SetIsWorldActive(TRUE);
break;
case LegoGameState::e_polidoor:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
VariableTable()->SetVariable("VISIBILITY", "Hide Policsta");
TransitionToOverlay(
IsleScript::c_PoliDoor_Background_Bitmap,
@ -996,61 +996,61 @@ MxLong Isle::HandleTransitionEnd()
);
break;
case LegoGameState::e_bike:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_BikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
if (!m_act1state->m_switchedToArea) {
m_bike->ActivateSceneActions();
}
break;
case LegoGameState::e_dunecar:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_DuneCarFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
if (!m_act1state->m_switchedToArea) {
m_dunebuggy->ActivateSceneActions();
}
break;
case LegoGameState::e_motocycle:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_MotoBikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
if (!m_act1state->m_switchedToArea) {
m_motocycle->ActivateSceneActions();
}
break;
case LegoGameState::e_copter:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_HelicopterDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
break;
case LegoGameState::e_skateboard:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_SkatePizza_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
if (!m_act1state->m_switchedToArea) {
m_skateboard->ActivateSceneActions();
}
break;
case LegoGameState::e_ambulance:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
m_act1state->m_state = Act1State::e_ambulance;
TransitionToOverlay(IsleScript::c_AmbulanceFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
if (!m_act1state->m_switchedToArea) {
m_ambulance->ActivateSceneActions();
}
break;
case LegoGameState::e_towtrack:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
m_act1state->m_state = Act1State::e_towtrack;
TransitionToOverlay(IsleScript::c_TowFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
if (!m_act1state->m_switchedToArea) {
m_towtrack->ActivateSceneActions();
}
break;
case LegoGameState::e_jetski:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(
(IsleScript::Script) m_jetski->GetJetskiDashboardStreamId(),
JukeboxScript::c_MusicTheme1,
@ -1058,7 +1058,7 @@ MxLong Isle::HandleTransitionEnd()
TRUE
);
if (!m_act1state->m_unk0x01f) {
if (!m_act1state->m_switchedToArea) {
m_jetski->ActivateSceneActions();
}
break;
@ -1078,7 +1078,7 @@ void Isle::TransitionToOverlay(
MxBool p_setCamera
)
{
if (m_act1state->m_unk0x01f) {
if (m_act1state->m_switchedToArea) {
MxPresenter* presenter = (MxPresenter*) Find(m_atomId, p_script);
if (presenter != NULL && presenter->GetCurrentTickleState() == MxPresenter::e_repeating) {
@ -1100,7 +1100,7 @@ void Isle::TransitionToOverlay(
Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
SetAppCursor(e_cursorArrow);
m_destLocation = LegoGameState::e_undefined;
m_act1state->m_unk0x01f = FALSE;
m_act1state->m_switchedToArea = FALSE;
}
else {
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
@ -1110,7 +1110,7 @@ void Isle::TransitionToOverlay(
GameState()->SwitchArea(m_destLocation);
GameState()->StopArea(LegoGameState::e_previousArea);
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_switchedToArea = TRUE;
}
}
@ -1229,9 +1229,9 @@ MxBool Isle::Escape()
break;
}
if (m_act1state->m_unk0x01e == TRUE) {
if (m_act1state->m_playingFloor2Animation == TRUE) {
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_Floor2, NULL);
m_act1state->m_unk0x01e = FALSE;
m_act1state->m_playingFloor2Animation = FALSE;
}
m_act1state->m_elevFloor = Act1State::c_floor1;
@ -1309,18 +1309,18 @@ Act1State::Act1State()
{
m_elevFloor = Act1State::c_floor1;
m_state = Act1State::e_initial;
m_unk0x01e = FALSE;
m_playingFloor2Animation = FALSE;
m_cptClickDialogue = Playlist((MxU32*) g_cptClickDialogue, sizeOfArray(g_cptClickDialogue), Playlist::e_loop);
m_unk0x01f = FALSE;
m_switchedToArea = FALSE;
m_planeActive = FALSE;
m_currentCptClickDialogue = IsleScript::c_noneIsle;
m_unk0x022 = FALSE;
m_playedExitExplanation = FALSE;
m_helicopterWindshield = NULL;
m_helicopterJetLeft = NULL;
m_helicopterJetRight = NULL;
m_helicopter = NULL;
m_jetskiFront = NULL;
m_unk0x021 = 1;
m_spawnInInfocenter = 1;
m_jetskiWindshield = NULL;
m_jetski = NULL;
m_dunebuggyFront = NULL;
@ -1419,7 +1419,7 @@ MxResult Act1State::Serialize(LegoStorage* p_storage)
}
p_storage->WriteS16(m_cptClickDialogue.m_nextIndex);
p_storage->WriteU8(m_unk0x022);
p_storage->WriteU8(m_playedExitExplanation);
}
else if (p_storage->IsReadMode()) {
if (strcmp(m_helicopterPlane.m_name.GetData(), "")) {
@ -1467,7 +1467,7 @@ MxResult Act1State::Serialize(LegoStorage* p_storage)
}
p_storage->ReadS16(m_cptClickDialogue.m_nextIndex);
p_storage->ReadU8(m_unk0x022);
p_storage->ReadU8(m_playedExitExplanation);
}
return SUCCESS;
@ -1500,7 +1500,7 @@ MxBool Act1State::Reset()
m_motocyclePlane.m_name = "";
m_bikePlane.m_name = "";
m_skateboardPlane.m_name = "";
m_unk0x022 = FALSE;
m_playedExitExplanation = FALSE;
m_helicopterPlane.m_name = "";
if (m_helicopterWindshield) {

View File

@ -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:
@ -294,7 +294,7 @@ MxLong LegoAct2::Notify(MxParam& p_param)
result = 1;
break;
}
case c_notificationType22:
case c_notificationAct2Brick:
SoundManager()->GetCacheSoundManager()->Play("28bng", NULL, FALSE);
m_unk0x10c1++;
@ -647,7 +647,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;
@ -671,7 +671,7 @@ 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;
@ -933,7 +933,7 @@ 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);

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