Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from isledecomp/isle #58

Merged
merged 11 commits into from
Feb 2, 2025
17 changes: 14 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,26 @@ jobs:

- name: Upload Build Artifacts (MSVC (32-bit))
if: ${{ matrix.toolchain.name == 'MSVC (32-bit, Release)' || matrix.toolchain.name == 'MSVC (32-bit, Debug)' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@main
with:
name: msvc32-artifacts
name: msvc32-artifacts-${{ matrix.toolchain.name }}
path: |
build/isle-portable (${{ matrix.toolchain.name }}).zip

merge-artifacts:
name: 'Merge artifacts'
runs-on: ubuntu-latest
needs: build-current-toolchain
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: msvc32-artifacts
pattern: msvc32-artifacts-*

upload:
name: 'Upload artifacts'
needs: build-current-toolchain
needs: merge-artifacts
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'isledecomp/isle-portable' }}
steps:
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ add_lego1_static_library(lego1_impl
LEGO1/lego/legoomni/src/input/legoinputmanager.cpp
LEGO1/lego/legoomni/src/main/legomain.cpp
LEGO1/lego/legoomni/src/main/scripts.cpp
LEGO1/lego/legoomni/src/notify/legoeventnotificationparam.cpp
LEGO1/lego/legoomni/src/paths/legoanimactor.cpp
LEGO1/lego/legoomni/src/paths/legoextraactor.cpp
LEGO1/lego/legoomni/src/paths/legopathactor.cpp
Expand Down
7 changes: 5 additions & 2 deletions LEGO1/lego/legoomni/include/historybook.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ class HistoryBook : public LegoWorld {
private:
LegoGameState::Area m_destLocation; // 0xf8
MxStillPresenter* m_alphabet[26]; // 0xfc
MxStillPresenter* m_names[20][7]; // 0x164
MxStillPresenter* m_scores[20]; // 0x394

// variable name verified by BETA10 0x1002bd27
MxStillPresenter* m_name[20][7]; // 0x164

MxStillPresenter* m_scores[20]; // 0x394
};

#endif // HISTORYBOOK_H
3 changes: 3 additions & 0 deletions LEGO1/lego/legoomni/include/infocenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class InfocenterState : public LegoState {
MxS16 GetMaxNameLength() { return sizeOfArray(m_letters); }
MxStillPresenter* GetNameLetter(MxS32 p_index) { return m_letters[p_index]; }
void SetNameLetter(MxS32 p_index, MxStillPresenter* p_letter) { m_letters[p_index] = p_letter; }

// FUNCTION: BETA10 0x10031bd0
MxBool HasRegistered() { return m_letters[0] != NULL; }

Playlist& GetExitDialogueAct1() { return m_exitDialogueAct1; }
Playlist& GetExitDialogueAct23() { return m_exitDialogueAct23; }
Playlist& GetReturnDialogue(LegoGameState::Act p_act) { return m_returnDialogue[p_act]; }
Expand Down
4 changes: 2 additions & 2 deletions LEGO1/lego/legoomni/include/jetski.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class Jetski : public IslePathActor {

void ActivateSceneActions();

MxS16 GetUnknown0x160() { return m_unk0x160; }
MxS16 GetUnknown0x160() { return m_jetskiDashboardStreamId; }

// SYNTHETIC: LEGO1 0x1007e5c0
// Jetski::`scalar deleting destructor'

private:
void RemoveFromWorld();

MxS16 m_unk0x160; // 0x160
MxS16 m_jetskiDashboardStreamId; // 0x160
};

#endif // JETSKI_H
1 change: 1 addition & 0 deletions LEGO1/lego/legoomni/include/legoactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class LegoActor : public LegoEntity {
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
Expand Down
4 changes: 4 additions & 0 deletions LEGO1/lego/legoomni/include/legoanimactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ class LegoAnimActor : public virtual LegoPathActor {
// Vector<unsigned char *>::~Vector<unsigned char *>

// TEMPLATE: LEGO1 0x1001c7c0
// TEMPLATE: BETA10 0x1000fb40
// vector<LegoAnimActorStruct *,allocator<LegoAnimActorStruct *> >::size

// TEMPLATE: BETA10 0x1000fb90
// vector<LegoAnimActorStruct *,allocator<LegoAnimActorStruct *> >::operator[]

// TEMPLATE: LEGO1 0x1001c7e0
// vector<LegoAnimActorStruct *,allocator<LegoAnimActorStruct *> >::_Destroy

Expand Down
4 changes: 3 additions & 1 deletion LEGO1/lego/legoomni/include/legocachsound.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "mxwavepresenter.h"

// VTABLE: LEGO1 0x100d4718
// VTABLE: BETA10 0x101bb6f0
// SIZE 0x88
class LegoCacheSound : public MxCore {
public:
Expand Down Expand Up @@ -50,12 +51,13 @@ class LegoCacheSound : public MxCore {
void MuteStop(MxBool p_mute);

// SYNTHETIC: LEGO1 0x10006610
// SYNTHETIC: BETA10 0x100675b0
// LegoCacheSound::`scalar deleting destructor'

private:
void Init();
void CopyData(MxU8* p_data, MxU32 p_dataSize);
MxString FUN_10006d80(const MxString& p_str);
MxString GetBaseFilename(MxString& p_path);

// [library:audio] WAVE_FORMAT_PCM (audio in .SI files only used this format)
static const MxU32 g_supportedFormatTag = 1;
Expand Down
6 changes: 4 additions & 2 deletions LEGO1/lego/legoomni/include/legogamestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ class LegoGameState {
// FUNCTION: BETA10 0x1002c2b0
MxS16 GetCount() { return m_count; }

ScoreItem* GetScore(MxS16 p_index) { return p_index >= m_count ? NULL : &m_scores[p_index]; }
// TODO: Not yet correct
// FUNCTION: BETA10 0x1002c540
ScoreItem* GetScore(MxS32 p_index) { return p_index >= m_count ? NULL : &m_scores[p_index]; }

MxS16 m_count; // 0x00
ScoreItem m_scores[20]; // 0x02
Expand Down Expand Up @@ -198,6 +200,7 @@ class LegoGameState {
void SwitchArea(Area p_area);
void Init();

// FUNCTION: BETA10 0x10083ff5
MxU8 GetActorId() { return m_actorId; }

// FUNCTION: BETA10 0x1004a2d0
Expand All @@ -207,7 +210,6 @@ class LegoGameState {
Act GetLoadedAct() { return m_loadedAct; }
Area GetPreviousArea() { return m_previousArea; }
Area GetUnknown0x42c() { return m_unk0x42c; }
History* GetHistory() { return &m_history; }

void SetDirty(MxBool p_isDirty) { m_isDirty = p_isDirty; }
void SetPreviousArea(Area p_previousArea) { m_previousArea = p_previousArea; }
Expand Down
2 changes: 2 additions & 0 deletions LEGO1/lego/legoomni/include/legomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ class LegoOmni : public MxOmni {
// FUNCTION: BETA10 0x100e52b0
LegoGameState* GetGameState() { return m_gameState; }

// FUNCTION: BETA10 0x100e5280
MxBackgroundAudioManager* GetBackgroundAudioManager() { return m_bkgAudioManager; }

MxTransitionManager* GetTransitionManager() { return m_transitionManager; }
MxDSAction& GetCurrentAction() { return m_action; }
LegoCharacterManager* GetCharacterManager() { return m_characterManager; }
Expand Down
5 changes: 3 additions & 2 deletions LEGO1/lego/legoomni/include/legoracers.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ class LegoJetski : public LegoJetskiRaceActor, public LegoRaceMap {

virtual void FUN_100136f0(float p_worldSpeed);

static void InitSoundIndices();

// SYNTHETIC: LEGO1 0x10013e30
// LegoJetski::`scalar deleting destructor'
};
Expand Down Expand Up @@ -146,8 +148,7 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
virtual MxU32 HandleSkeletonKicks(float p_param1);

static void FUN_10012de0();
static void FUN_10012e00();
static void FUN_10013670();
static void InitSoundIndices();

// SYNTHETIC: LEGO1 0x10014240
// LegoRaceCar::`scalar deleting destructor'
Expand Down
2 changes: 1 addition & 1 deletion LEGO1/lego/legoomni/include/registrationbook.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class RegistrationBook : public LegoWorld {
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68

inline void PlayAction(MxU32 p_objectId);
inline static void PlayAction(MxU32 p_objectId);

// SYNTHETIC: LEGO1 0x10076f30
// RegistrationBook::`scalar deleting destructor'
Expand Down
37 changes: 20 additions & 17 deletions LEGO1/lego/legoomni/src/actors/dunebuggy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,27 +160,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 (SDL_strcasecmp(colorName, "lego green")) {
if (!SDL_strcasecmp(colorName, "lego red")) {
offset = 2;
}
else if (!SDL_strcasecmp(colorName, "lego yellow")) {
offset = 3;
}
else if (!SDL_strcasecmp(colorName, "lego black")) {
offset = 4;
}
else if (!SDL_strcasecmp(colorName, "lego blue")) {
offset = 5;
}
else if (!SDL_strcasecmp(colorName, "lego white")) {
offset = 6;
}
if (!SDL_strcasecmp(color, "lego green")) {
offset = 1;
}
else if (!SDL_strcasecmp(color, "lego red")) {
offset = 2;
}
else if (!SDL_strcasecmp(color, "lego yellow")) {
offset = 3;
}
else if (!SDL_strcasecmp(color, "lego black")) {
offset = 4;
}
else if (!SDL_strcasecmp(color, "lego blue")) {
offset = 5;
}
else if (!SDL_strcasecmp(color, "lego white")) {
offset = 6;
}

return offset;
Expand Down
1 change: 1 addition & 0 deletions LEGO1/lego/legoomni/src/actors/islepathactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ MxLong IslePathActor::Notify(MxParam& p_param)
}

// FUNCTION: LEGO1 0x1001a350
// FUNCTION: BETA10 0x100365ad
void IslePathActor::Enter()
{
m_roi->SetVisibility(FALSE);
Expand Down
29 changes: 24 additions & 5 deletions LEGO1/lego/legoomni/src/actors/jetski.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,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
Expand Down Expand Up @@ -79,6 +82,7 @@ void Jetski::Exit()
// FUNCTION: BETA10 0x10037621
MxLong Jetski::HandleClick()
{
#ifndef BETA10
if (!FUN_1003ef60()) {
return 1;
}
Expand All @@ -91,26 +95,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);
Expand Down
Loading