mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-11 18:51:16 +00:00
Merge c2629ced7c into 923b450008
This commit is contained in:
commit
280874b4ae
@ -12,7 +12,7 @@ class Act3;
|
|||||||
// SIZE 0x0c
|
// SIZE 0x0c
|
||||||
class HelicopterState : public LegoState {
|
class HelicopterState : public LegoState {
|
||||||
public:
|
public:
|
||||||
HelicopterState() : m_unk0x08(0) {}
|
HelicopterState() : m_status(0) {}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1000e0b0
|
// FUNCTION: LEGO1 0x1000e0b0
|
||||||
MxBool IsSerializable() override { return FALSE; } // vtable+0x14
|
MxBool IsSerializable() override { return FALSE; } // vtable+0x14
|
||||||
@ -20,7 +20,7 @@ class HelicopterState : public LegoState {
|
|||||||
// FUNCTION: LEGO1 0x1000e0c0
|
// FUNCTION: LEGO1 0x1000e0c0
|
||||||
MxBool Reset() override
|
MxBool Reset() override
|
||||||
{
|
{
|
||||||
m_unk0x08 = 0;
|
m_status = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} // vtable+0x18
|
} // vtable+0x18
|
||||||
|
|
||||||
@ -41,7 +41,14 @@ class HelicopterState : public LegoState {
|
|||||||
// SYNTHETIC: LEGO1 0x1000e190
|
// SYNTHETIC: LEGO1 0x1000e190
|
||||||
// HelicopterState::`scalar deleting destructor'
|
// HelicopterState::`scalar deleting destructor'
|
||||||
|
|
||||||
MxU32 m_unk0x08; // 0x08
|
// Status of the helicopter:
|
||||||
|
// 0: Landed
|
||||||
|
// 1: Taking off
|
||||||
|
// 2: In the air
|
||||||
|
// 3: Landing
|
||||||
|
// 4: Good ending
|
||||||
|
// 5: Bad ending
|
||||||
|
MxU32 m_status; // 0x08
|
||||||
};
|
};
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d40f8
|
// VTABLE: LEGO1 0x100d40f8
|
||||||
@ -76,8 +83,8 @@ class Helicopter : public IslePathActor {
|
|||||||
void Exit() override; // vtable+0xe4
|
void Exit() override; // vtable+0xe4
|
||||||
|
|
||||||
void CreateState();
|
void CreateState();
|
||||||
void FUN_10004640(const Matrix4& p_matrix);
|
void StartGoodEndingCamera(const Matrix4& p_matrix);
|
||||||
void FUN_10004670(const Matrix4& p_matrix);
|
void StartBadEndingCamera(const Matrix4& p_matrix);
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10003210
|
// SYNTHETIC: LEGO1 0x10003210
|
||||||
// Helicopter::`scalar deleting destructor'
|
// Helicopter::`scalar deleting destructor'
|
||||||
@ -86,14 +93,14 @@ class Helicopter : public IslePathActor {
|
|||||||
friend class Act3;
|
friend class Act3;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void FUN_100042a0(const Matrix4& p_matrix);
|
void SetupCameraTransition(const Matrix4& p_matrix);
|
||||||
|
|
||||||
MxMatrix m_unk0x160; // 0x160
|
MxMatrix m_cameraTransitionStartMatrix; // 0x160
|
||||||
MxMatrix m_unk0x1a8; // 0x1a8
|
MxMatrix m_cameraTransitionEndMatrix; // 0x1a8
|
||||||
float m_unk0x1f0; // 0x1f0
|
float m_cameraTransitionTime; // 0x1f0
|
||||||
MxQuaternionTransformer m_unk0x1f4; // 0x1f4
|
MxQuaternionTransformer m_cameraTransitionInterpolator; // 0x1f4
|
||||||
HelicopterState* m_state; // 0x228
|
HelicopterState* m_state; // 0x228
|
||||||
MxAtomId m_script; // 0x22c
|
MxAtomId m_script; // 0x22c
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HELICOPTER_H
|
#endif // HELICOPTER_H
|
||||||
|
|||||||
@ -102,7 +102,7 @@ void Helicopter::Exit()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_state->m_unk0x08 = 0;
|
m_state->m_status = 0;
|
||||||
RemoveFromCurrentWorld(m_script, IsleScript::c_HelicopterDashboard_Bitmap);
|
RemoveFromCurrentWorld(m_script, IsleScript::c_HelicopterDashboard_Bitmap);
|
||||||
RemoveFromCurrentWorld(m_script, IsleScript::c_HelicopterArms_Ctl);
|
RemoveFromCurrentWorld(m_script, IsleScript::c_HelicopterArms_Ctl);
|
||||||
RemoveFromCurrentWorld(m_script, IsleScript::c_Helicopter_TakeOff_Ctl);
|
RemoveFromCurrentWorld(m_script, IsleScript::c_Helicopter_TakeOff_Ctl);
|
||||||
@ -198,7 +198,7 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
|||||||
((Act3*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
|
((Act3*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
|
||||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
else if (m_state->m_unk0x08 != 0) {
|
else if (m_state->m_status != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,9 +213,9 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
|||||||
|
|
||||||
Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
|
Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
|
||||||
assert(act1State);
|
assert(act1State);
|
||||||
if (m_state->m_unk0x08 == 0) {
|
if (m_state->m_status == 0) {
|
||||||
act1State->m_state = Act1State::e_helicopter;
|
act1State->m_state = Act1State::e_helicopter;
|
||||||
m_state->m_unk0x08 = 1;
|
m_state->m_status = 1;
|
||||||
m_world->RemoveActor(this);
|
m_world->RemoveActor(this);
|
||||||
InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterTakeOff_Anim, NULL);
|
InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterTakeOff_Anim, NULL);
|
||||||
SetActorState(c_initial);
|
SetActorState(c_initial);
|
||||||
@ -229,8 +229,8 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_state->m_unk0x08 == 2) {
|
if (m_state->m_status == 2) {
|
||||||
m_state->m_unk0x08 = 3;
|
m_state->m_status = 3;
|
||||||
m_world->RemoveActor(this);
|
m_world->RemoveActor(this);
|
||||||
InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterLand_Anim, NULL);
|
InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterLand_Anim, NULL);
|
||||||
SetActorState(c_disabled);
|
SetActorState(c_disabled);
|
||||||
@ -261,11 +261,11 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
|||||||
lookat *= 3.0f;
|
lookat *= 3.0f;
|
||||||
location += lookat;
|
location += lookat;
|
||||||
|
|
||||||
Mx3DPointFloat v68, va4, up;
|
Mx3DPointFloat cameraUp, right, up;
|
||||||
Mx3DPointFloat v90(0, 1, 0);
|
Mx3DPointFloat worldUp(0, 1, 0);
|
||||||
v68 = m_world->GetCameraController()->GetWorldUp();
|
cameraUp = m_world->GetCameraController()->GetWorldUp();
|
||||||
va4.EqualsCross(v68, direction);
|
right.EqualsCross(cameraUp, direction);
|
||||||
up.EqualsCross(va4, v90);
|
up.EqualsCross(right, worldUp);
|
||||||
|
|
||||||
if (isPizza) {
|
if (isPizza) {
|
||||||
if (((Act3*) m_world)->ShootPizza(m_pathController, location, direction, up) != SUCCESS) {
|
if (((Act3*) m_world)->ShootPizza(m_pathController, location, direction, up) != SUCCESS) {
|
||||||
@ -313,7 +313,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
|
|||||||
{
|
{
|
||||||
MxLong result = 0;
|
MxLong result = 0;
|
||||||
|
|
||||||
switch (m_state->m_unk0x08) {
|
switch (m_state->m_status) {
|
||||||
case 1: {
|
case 1: {
|
||||||
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
||||||
Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
|
Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
|
||||||
@ -333,7 +333,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_state->m_unk0x08 = 2;
|
m_state->m_status = 2;
|
||||||
|
|
||||||
MxMatrix matrix;
|
MxMatrix matrix;
|
||||||
matrix.SetIdentity();
|
matrix.SetIdentity();
|
||||||
@ -374,7 +374,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_state->m_unk0x08 = 0;
|
m_state->m_status = 0;
|
||||||
result = 1;
|
result = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -402,34 +402,34 @@ void Helicopter::VTable0x74(Matrix4& p_transform)
|
|||||||
// FUNCTION: LEGO1 0x10003ee0
|
// FUNCTION: LEGO1 0x10003ee0
|
||||||
void Helicopter::Animate(float p_time)
|
void Helicopter::Animate(float p_time)
|
||||||
{
|
{
|
||||||
if (m_state->m_unk0x08 == 4 || m_state->m_unk0x08 == 5) {
|
if (m_state->m_status == 4 || m_state->m_status == 5) {
|
||||||
float f = m_unk0x1f0 - p_time + 3000.0f;
|
float remainingTime = m_cameraTransitionTime - p_time + 3000.0f;
|
||||||
if (f >= 0) {
|
if (remainingTime >= 0) {
|
||||||
float f2 = f / -3000.0f + 1;
|
float interpolationFactor = remainingTime / -3000.0f + 1;
|
||||||
if (f2 < 0) {
|
if (interpolationFactor < 0) {
|
||||||
f2 = 0;
|
interpolationFactor = 0;
|
||||||
}
|
}
|
||||||
if (f2 > 1.0f) {
|
if (interpolationFactor > 1.0f) {
|
||||||
f2 = 1.0f;
|
interpolationFactor = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
MxMatrix mat;
|
MxMatrix transform;
|
||||||
Vector3 v1(m_unk0x160[3]);
|
Vector3 startPosition(m_cameraTransitionStartMatrix[3]);
|
||||||
Vector3 v2(mat[3]);
|
Vector3 interpolatedPosition(transform[3]);
|
||||||
Vector3 v3(m_unk0x1a8[3]);
|
Vector3 endPosition(m_cameraTransitionEndMatrix[3]);
|
||||||
|
|
||||||
mat.SetIdentity();
|
transform.SetIdentity();
|
||||||
m_unk0x1f4.InterpolateToMatrix(mat, f2);
|
m_cameraTransitionInterpolator.InterpolateToMatrix(transform, interpolationFactor);
|
||||||
|
|
||||||
v2 = v3;
|
interpolatedPosition = endPosition;
|
||||||
v2 -= v1;
|
interpolatedPosition -= startPosition;
|
||||||
v2 *= f2;
|
interpolatedPosition *= interpolationFactor;
|
||||||
v2 += v1;
|
interpolatedPosition += startPosition;
|
||||||
|
|
||||||
m_world->GetCameraController()->TransformPointOfView(mat, 0);
|
m_world->GetCameraController()->TransformPointOfView(transform, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (m_state->m_unk0x08 == 4) {
|
if (m_state->m_status == 4) {
|
||||||
((Act3*) m_world)->FUN_10073400();
|
((Act3*) m_world)->FUN_10073400();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -445,63 +445,63 @@ void Helicopter::Animate(float p_time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100042a0
|
// FUNCTION: LEGO1 0x100042a0
|
||||||
void Helicopter::FUN_100042a0(const Matrix4& p_matrix)
|
void Helicopter::SetupCameraTransition(const Matrix4& p_matrix)
|
||||||
{
|
{
|
||||||
MxMatrix local48;
|
MxMatrix startMatrix;
|
||||||
MxMatrix local90;
|
MxMatrix endMatrix;
|
||||||
|
|
||||||
Vector3 vec1(local48[3]); // local98 // esp+0x30
|
Vector3 startPos(startMatrix[3]); // local98 // esp+0x30
|
||||||
Vector3 vec2(local90[3]); // localac // esp+0x1c
|
Vector3 endPos(endMatrix[3]); // localac // esp+0x1c
|
||||||
Vector3 vec3(m_unk0x1a8[0]); // locala8 // esp+0x20
|
Vector3 endMatrixX(m_cameraTransitionEndMatrix[0]); // locala8 // esp+0x20
|
||||||
Vector3 vec4(m_unk0x1a8[1]); // localb8 // esp+0x10
|
Vector3 endMatrixY(m_cameraTransitionEndMatrix[1]); // localb8 // esp+0x10
|
||||||
Vector3 vec5(m_unk0x1a8[2]); // EDI
|
Vector3 endMatrixZ(m_cameraTransitionEndMatrix[2]); // EDI
|
||||||
|
|
||||||
// the typecast makes this function match for unknown reasons
|
// the typecast makes this function match for unknown reasons
|
||||||
Vector3 vec6((const float*) m_unk0x1a8[3]); // locala0 // esp+0x28
|
Vector3 endMatrixPos((const float*) m_cameraTransitionEndMatrix[3]); // locala0 // esp+0x28
|
||||||
|
|
||||||
m_world->GetCameraController()->GetPointOfView(local48);
|
m_world->GetCameraController()->GetPointOfView(startMatrix);
|
||||||
m_unk0x1a8.SetIdentity();
|
m_cameraTransitionEndMatrix.SetIdentity();
|
||||||
local90 = p_matrix;
|
endMatrix = p_matrix;
|
||||||
|
|
||||||
vec2[1] += 20.0f;
|
endPos[1] += 20.0f;
|
||||||
vec4 = vec2;
|
endMatrixY = endPos;
|
||||||
vec4 -= vec1;
|
endMatrixY -= startPos;
|
||||||
vec4.Unitize();
|
endMatrixY.Unitize();
|
||||||
|
|
||||||
vec5[0] = vec5[2] = 0.0f;
|
endMatrixZ[0] = endMatrixZ[2] = 0.0f;
|
||||||
vec5[1] = -1.0f;
|
endMatrixZ[1] = -1.0f;
|
||||||
|
|
||||||
vec3.EqualsCross(vec4, vec5);
|
endMatrixX.EqualsCross(endMatrixY, endMatrixZ);
|
||||||
vec3.Unitize();
|
endMatrixX.Unitize();
|
||||||
vec4.EqualsCross(vec5, vec3);
|
endMatrixY.EqualsCross(endMatrixZ, endMatrixX);
|
||||||
vec6 = vec2;
|
endMatrixPos = endPos;
|
||||||
|
|
||||||
local90 = m_unk0x1a8;
|
endMatrix = m_cameraTransitionEndMatrix;
|
||||||
m_unk0x160 = local48;
|
m_cameraTransitionStartMatrix = startMatrix;
|
||||||
|
|
||||||
vec1.Clear();
|
startPos.Clear();
|
||||||
vec2.Clear();
|
endPos.Clear();
|
||||||
|
|
||||||
m_unk0x1f0 = Timer()->GetTime();
|
m_cameraTransitionTime = Timer()->GetTime();
|
||||||
|
|
||||||
m_unk0x1f4.SetStartEnd(local48, local90);
|
m_cameraTransitionInterpolator.SetStartEnd(startMatrix, endMatrix);
|
||||||
m_unk0x1f4.NormalizeDirection();
|
m_cameraTransitionInterpolator.NormalizeDirection();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10004640
|
// FUNCTION: LEGO1 0x10004640
|
||||||
void Helicopter::FUN_10004640(const Matrix4& p_matrix)
|
void Helicopter::StartGoodEndingCamera(const Matrix4& p_matrix)
|
||||||
{
|
{
|
||||||
if (m_state->m_unk0x08 != 4 && m_state->m_unk0x08 != 5) {
|
if (m_state->m_status != 4 && m_state->m_status != 5) {
|
||||||
m_state->m_unk0x08 = 4;
|
m_state->m_status = 4;
|
||||||
FUN_100042a0(p_matrix);
|
SetupCameraTransition(p_matrix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10004670
|
// FUNCTION: LEGO1 0x10004670
|
||||||
void Helicopter::FUN_10004670(const Matrix4& p_matrix)
|
void Helicopter::StartBadEndingCamera(const Matrix4& p_matrix)
|
||||||
{
|
{
|
||||||
if (m_state->m_unk0x08 != 4 && m_state->m_unk0x08 != 5) {
|
if (m_state->m_status != 4 && m_state->m_status != 5) {
|
||||||
m_state->m_unk0x08 = 5;
|
m_state->m_status = 5;
|
||||||
FUN_100042a0(p_matrix);
|
SetupCameraTransition(p_matrix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -650,7 +650,7 @@ MxLong Act3::Notify(MxParam& p_param)
|
|||||||
m_state->m_state = Act3State::e_initial;
|
m_state->m_state = Act3State::e_initial;
|
||||||
Disable(TRUE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
Disable(TRUE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||||
m_copter->HandleClick();
|
m_copter->HandleClick();
|
||||||
m_copter->m_state->m_unk0x08 = 1;
|
m_copter->m_state->m_status = 1;
|
||||||
m_copter->HandleEndAnim((LegoEndAnimNotificationParam&) param);
|
m_copter->HandleEndAnim((LegoEndAnimNotificationParam&) param);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -783,15 +783,15 @@ void Act3::GoodEnding(const Matrix4& p_destination)
|
|||||||
|
|
||||||
#ifndef BETA10
|
#ifndef BETA10
|
||||||
m_unk0x4220.Clear();
|
m_unk0x4220.Clear();
|
||||||
m_copter->FUN_10004640(p_destination);
|
m_copter->StartGoodEndingCamera(p_destination);
|
||||||
|
|
||||||
DebugPrintf("In Good Ending...");
|
DebugPrintf("In Good Ending...");
|
||||||
DebugCopter(
|
DebugCopter(
|
||||||
m_copter->GetROI()->GetLocal2World(),
|
m_copter->GetROI()->GetLocal2World(),
|
||||||
p_destination,
|
p_destination,
|
||||||
m_copter->m_unk0x160,
|
m_copter->m_cameraTransitionStartMatrix,
|
||||||
m_copter->m_unk0x1a8,
|
m_copter->m_cameraTransitionEndMatrix,
|
||||||
m_copter->m_unk0x1f4
|
m_copter->m_cameraTransitionInterpolator
|
||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
m_state->m_state = Act3State::e_goodEnding;
|
m_state->m_state = Act3State::e_goodEnding;
|
||||||
@ -866,15 +866,15 @@ void Act3::BadEnding(const Matrix4& p_destination)
|
|||||||
m_brickster->SetActorState(LegoPathActor::c_disabled);
|
m_brickster->SetActorState(LegoPathActor::c_disabled);
|
||||||
|
|
||||||
m_unk0x4220.Clear();
|
m_unk0x4220.Clear();
|
||||||
m_copter->FUN_10004670(p_destination);
|
m_copter->StartBadEndingCamera(p_destination);
|
||||||
|
|
||||||
DebugPrintf("In Bad Ending...");
|
DebugPrintf("In Bad Ending...");
|
||||||
DebugCopter(
|
DebugCopter(
|
||||||
m_copter->GetROI()->GetLocal2World(),
|
m_copter->GetROI()->GetLocal2World(),
|
||||||
p_destination,
|
p_destination,
|
||||||
m_copter->m_unk0x160,
|
m_copter->m_cameraTransitionStartMatrix,
|
||||||
m_copter->m_unk0x1a8,
|
m_copter->m_cameraTransitionEndMatrix,
|
||||||
m_copter->m_unk0x1f4
|
m_copter->m_cameraTransitionInterpolator
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user