mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-04-07 20:24:26 -04:00
Match Jetski::HandleClick
(#1380)
* Match `Jetski::HandleClick` * Formatting * Clean up, document, add BETA10 references * Fix formatting --------- Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
parent
dad44535bd
commit
bc0344a8c4
6 changed files with 49 additions and 24 deletions
LEGO1/lego/legoomni
|
@ -35,7 +35,7 @@ public:
|
|||
|
||||
void ActivateSceneActions();
|
||||
|
||||
MxS16 GetUnknown0x160() { return m_unk0x160; }
|
||||
MxS16 GetUnknown0x160() { return m_jetskiDashboardStreamId; }
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1007e5c0
|
||||
// Jetski::`scalar deleting destructor'
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
private:
|
||||
void RemoveFromWorld();
|
||||
|
||||
MxS16 m_unk0x160; // 0x160
|
||||
MxS16 m_jetskiDashboardStreamId; // 0x160
|
||||
};
|
||||
|
||||
#endif // JETSKI_H
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
virtual MxFloat VTable0x5c() { return m_unk0x70; } // vtable+0x5c
|
||||
|
||||
// FUNCTION: LEGO1 0x10002d00
|
||||
// FUNCTION: BETA10 0x1000f4a0
|
||||
virtual MxU8 GetActorId() { return m_actorId; } // vtable+0x60
|
||||
|
||||
// FUNCTION: LEGO1 0x10002d10
|
||||
|
|
|
@ -199,6 +199,7 @@ public:
|
|||
void SwitchArea(Area p_area);
|
||||
void Init();
|
||||
|
||||
// FUNCTION: BETA10 0x10083ff5
|
||||
MxU8 GetActorId() { return m_actorId; }
|
||||
|
||||
// FUNCTION: BETA10 0x1004a2d0
|
||||
|
|
|
@ -157,27 +157,30 @@ MxLong DuneBuggy::HandlePathStruct(LegoPathStructNotificationParam& p_param)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10068290
|
||||
// FUNCTION: BETA10 0x1002765d
|
||||
MxS32 DuneBuggy::GetColorOffset(const char* p_variable)
|
||||
{
|
||||
MxS32 offset = 1;
|
||||
const char* colorName = VariableTable()->GetVariable(p_variable);
|
||||
const char* color = VariableTable()->GetVariable(p_variable);
|
||||
assert(color);
|
||||
|
||||
if (strcmpi(colorName, "lego green")) {
|
||||
if (!strcmpi(colorName, "lego red")) {
|
||||
offset = 2;
|
||||
}
|
||||
else if (!strcmpi(colorName, "lego yellow")) {
|
||||
offset = 3;
|
||||
}
|
||||
else if (!strcmpi(colorName, "lego black")) {
|
||||
offset = 4;
|
||||
}
|
||||
else if (!strcmpi(colorName, "lego blue")) {
|
||||
offset = 5;
|
||||
}
|
||||
else if (!strcmpi(colorName, "lego white")) {
|
||||
offset = 6;
|
||||
}
|
||||
if (!strcmpi(color, "lego green")) {
|
||||
offset = 1;
|
||||
}
|
||||
else if (!strcmpi(color, "lego red")) {
|
||||
offset = 2;
|
||||
}
|
||||
else if (!strcmpi(color, "lego yellow")) {
|
||||
offset = 3;
|
||||
}
|
||||
else if (!strcmpi(color, "lego black")) {
|
||||
offset = 4;
|
||||
}
|
||||
else if (!strcmpi(color, "lego blue")) {
|
||||
offset = 5;
|
||||
}
|
||||
else if (!strcmpi(color, "lego white")) {
|
||||
offset = 6;
|
||||
}
|
||||
|
||||
return offset;
|
||||
|
|
|
@ -71,6 +71,7 @@ MxLong IslePathActor::Notify(MxParam& p_param)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001a350
|
||||
// FUNCTION: BETA10 0x100365ad
|
||||
void IslePathActor::Enter()
|
||||
{
|
||||
m_roi->SetVisibility(FALSE);
|
||||
|
|
|
@ -18,12 +18,15 @@
|
|||
|
||||
DECOMP_SIZE_ASSERT(Jetski, 0x164)
|
||||
|
||||
// These two have been changed between BETA10 and LEGO1
|
||||
// GLOBAL: LEGO1 0x100f7ab8
|
||||
// STRING: LEGO1 0x100f3ce0
|
||||
// GLOBAL: BETA10 0x101e0be4
|
||||
const char* g_varJSFRNTY5 = "c_jsfrnty5";
|
||||
|
||||
// GLOBAL: LEGO1 0x100f7abc
|
||||
// STRING: LEGO1 0x100f3ca4
|
||||
// GLOBAL: BETA10 0x101e0be0
|
||||
const char* g_varJSWNSHY5 = "c_jswnshy5";
|
||||
|
||||
// FUNCTION: LEGO1 0x1007e3b0
|
||||
|
@ -77,6 +80,7 @@ void Jetski::Exit()
|
|||
// FUNCTION: BETA10 0x10037621
|
||||
MxLong Jetski::HandleClick()
|
||||
{
|
||||
#ifndef BETA10
|
||||
if (!FUN_1003ef60()) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -89,26 +93,41 @@ MxLong Jetski::HandleClick()
|
|||
if (GameState()->GetActorId() != UserActor()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO: Match
|
||||
m_unk0x160 = ((DuneBuggy::GetColorOffset(g_varJSWNSHY5) * 5 + 15) * 2);
|
||||
m_unk0x160 += DuneBuggy::GetColorOffset(g_varJSFRNTY5);
|
||||
// Selects the windshield from `IsleScript::c_JetskiDashboard11_Bitmap` (=41)
|
||||
// to `IsleScript::c_JetskiDashboard66_Bitmap` based on the user's color selection
|
||||
MxS32 colorOffset = DuneBuggy::GetColorOffset(g_varJSWNSHY5);
|
||||
m_jetskiDashboardStreamId = 10 * (colorOffset + 3);
|
||||
colorOffset = DuneBuggy::GetColorOffset(g_varJSFRNTY5);
|
||||
m_jetskiDashboardStreamId += colorOffset;
|
||||
|
||||
InvokeAction(Extra::ActionType::e_start, *g_isleScript, m_unk0x160, NULL);
|
||||
InvokeAction(Extra::ActionType::e_start, *g_isleScript, m_jetskiDashboardStreamId, NULL);
|
||||
InvokeAction(Extra::ActionType::e_start, *g_isleScript, IsleScript::c_JetskiDashboard, NULL);
|
||||
|
||||
#ifdef BETA10
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
Enter();
|
||||
ControlManager()->Register(this);
|
||||
PlayCamAnim(this, FALSE, 0x44, TRUE);
|
||||
#else
|
||||
GetCurrentAction().SetObjectId(-1);
|
||||
|
||||
AnimationManager()->FUN_1005f6d0(FALSE);
|
||||
AnimationManager()->FUN_10064670(NULL);
|
||||
Enter();
|
||||
ControlManager()->Register(this);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1007e880
|
||||
void Jetski::RemoveFromWorld()
|
||||
{
|
||||
RemoveFromCurrentWorld(*g_isleScript, m_unk0x160);
|
||||
RemoveFromCurrentWorld(*g_isleScript, m_jetskiDashboardStreamId);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_JetskiArms_Ctl);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_JetskiInfo_Ctl);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_JetskiSpeedMeter);
|
||||
|
|
Loading…
Add table
Reference in a new issue