mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-05-22 11:00:41 -04:00
Merge pull request #58 from foxtacles/mergeisle
Merge from isledecomp/isle
This commit is contained in:
commit
82527d75d6
31 changed files with 324 additions and 252 deletions
.github/workflows
CMakeLists.txtLEGO1
lego/legoomni
include
historybook.hinfocenter.hjetski.hlegoactor.hlegoanimactor.hlegocachsound.hlegogamestate.hlegomain.hlegoracers.hregistrationbook.h
src
omni/include
viewmanager
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
|
@ -80,15 +80,26 @@ jobs:
|
||||||
|
|
||||||
- name: Upload Build Artifacts (MSVC (32-bit))
|
- name: Upload Build Artifacts (MSVC (32-bit))
|
||||||
if: ${{ matrix.toolchain.name == 'MSVC (32-bit, Release)' || matrix.toolchain.name == 'MSVC (32-bit, Debug)' }}
|
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:
|
with:
|
||||||
name: msvc32-artifacts
|
name: msvc32-artifacts-${{ matrix.toolchain.name }}
|
||||||
path: |
|
path: |
|
||||||
build/isle-portable (${{ matrix.toolchain.name }}).zip
|
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:
|
upload:
|
||||||
name: 'Upload artifacts'
|
name: 'Upload artifacts'
|
||||||
needs: build-current-toolchain
|
needs: merge-artifacts
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'isledecomp/isle-portable' }}
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'isledecomp/isle-portable' }}
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -373,7 +373,6 @@ add_lego1_static_library(lego1_impl
|
||||||
LEGO1/lego/legoomni/src/input/legoinputmanager.cpp
|
LEGO1/lego/legoomni/src/input/legoinputmanager.cpp
|
||||||
LEGO1/lego/legoomni/src/main/legomain.cpp
|
LEGO1/lego/legoomni/src/main/legomain.cpp
|
||||||
LEGO1/lego/legoomni/src/main/scripts.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/legoanimactor.cpp
|
||||||
LEGO1/lego/legoomni/src/paths/legoextraactor.cpp
|
LEGO1/lego/legoomni/src/paths/legoextraactor.cpp
|
||||||
LEGO1/lego/legoomni/src/paths/legopathactor.cpp
|
LEGO1/lego/legoomni/src/paths/legopathactor.cpp
|
||||||
|
|
|
@ -41,8 +41,11 @@ public:
|
||||||
private:
|
private:
|
||||||
LegoGameState::Area m_destLocation; // 0xf8
|
LegoGameState::Area m_destLocation; // 0xf8
|
||||||
MxStillPresenter* m_alphabet[26]; // 0xfc
|
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
|
#endif // HISTORYBOOK_H
|
||||||
|
|
|
@ -40,7 +40,10 @@ public:
|
||||||
MxS16 GetMaxNameLength() { return sizeOfArray(m_letters); }
|
MxS16 GetMaxNameLength() { return sizeOfArray(m_letters); }
|
||||||
MxStillPresenter* GetNameLetter(MxS32 p_index) { return m_letters[p_index]; }
|
MxStillPresenter* GetNameLetter(MxS32 p_index) { return m_letters[p_index]; }
|
||||||
void SetNameLetter(MxS32 p_index, MxStillPresenter* p_letter) { m_letters[p_index] = p_letter; }
|
void SetNameLetter(MxS32 p_index, MxStillPresenter* p_letter) { m_letters[p_index] = p_letter; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10031bd0
|
||||||
MxBool HasRegistered() { return m_letters[0] != NULL; }
|
MxBool HasRegistered() { return m_letters[0] != NULL; }
|
||||||
|
|
||||||
Playlist& GetExitDialogueAct1() { return m_exitDialogueAct1; }
|
Playlist& GetExitDialogueAct1() { return m_exitDialogueAct1; }
|
||||||
Playlist& GetExitDialogueAct23() { return m_exitDialogueAct23; }
|
Playlist& GetExitDialogueAct23() { return m_exitDialogueAct23; }
|
||||||
Playlist& GetReturnDialogue(LegoGameState::Act p_act) { return m_returnDialogue[p_act]; }
|
Playlist& GetReturnDialogue(LegoGameState::Act p_act) { return m_returnDialogue[p_act]; }
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
|
|
||||||
void ActivateSceneActions();
|
void ActivateSceneActions();
|
||||||
|
|
||||||
MxS16 GetUnknown0x160() { return m_unk0x160; }
|
MxS16 GetUnknown0x160() { return m_jetskiDashboardStreamId; }
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1007e5c0
|
// SYNTHETIC: LEGO1 0x1007e5c0
|
||||||
// Jetski::`scalar deleting destructor'
|
// Jetski::`scalar deleting destructor'
|
||||||
|
@ -43,7 +43,7 @@ public:
|
||||||
private:
|
private:
|
||||||
void RemoveFromWorld();
|
void RemoveFromWorld();
|
||||||
|
|
||||||
MxS16 m_unk0x160; // 0x160
|
MxS16 m_jetskiDashboardStreamId; // 0x160
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // JETSKI_H
|
#endif // JETSKI_H
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
virtual MxFloat VTable0x5c() { return m_unk0x70; } // vtable+0x5c
|
virtual MxFloat VTable0x5c() { return m_unk0x70; } // vtable+0x5c
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d00
|
// FUNCTION: LEGO1 0x10002d00
|
||||||
|
// FUNCTION: BETA10 0x1000f4a0
|
||||||
virtual MxU8 GetActorId() { return m_actorId; } // vtable+0x60
|
virtual MxU8 GetActorId() { return m_actorId; } // vtable+0x60
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d10
|
// FUNCTION: LEGO1 0x10002d10
|
||||||
|
|
|
@ -96,8 +96,12 @@ protected:
|
||||||
// Vector<unsigned char *>::~Vector<unsigned char *>
|
// Vector<unsigned char *>::~Vector<unsigned char *>
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x1001c7c0
|
// TEMPLATE: LEGO1 0x1001c7c0
|
||||||
|
// TEMPLATE: BETA10 0x1000fb40
|
||||||
// vector<LegoAnimActorStruct *,allocator<LegoAnimActorStruct *> >::size
|
// vector<LegoAnimActorStruct *,allocator<LegoAnimActorStruct *> >::size
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x1000fb90
|
||||||
|
// vector<LegoAnimActorStruct *,allocator<LegoAnimActorStruct *> >::operator[]
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x1001c7e0
|
// TEMPLATE: LEGO1 0x1001c7e0
|
||||||
// vector<LegoAnimActorStruct *,allocator<LegoAnimActorStruct *> >::_Destroy
|
// vector<LegoAnimActorStruct *,allocator<LegoAnimActorStruct *> >::_Destroy
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "mxwavepresenter.h"
|
#include "mxwavepresenter.h"
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d4718
|
// VTABLE: LEGO1 0x100d4718
|
||||||
|
// VTABLE: BETA10 0x101bb6f0
|
||||||
// SIZE 0x88
|
// SIZE 0x88
|
||||||
class LegoCacheSound : public MxCore {
|
class LegoCacheSound : public MxCore {
|
||||||
public:
|
public:
|
||||||
|
@ -50,12 +51,13 @@ public:
|
||||||
void MuteStop(MxBool p_mute);
|
void MuteStop(MxBool p_mute);
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10006610
|
// SYNTHETIC: LEGO1 0x10006610
|
||||||
|
// SYNTHETIC: BETA10 0x100675b0
|
||||||
// LegoCacheSound::`scalar deleting destructor'
|
// LegoCacheSound::`scalar deleting destructor'
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void CopyData(MxU8* p_data, MxU32 p_dataSize);
|
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)
|
// [library:audio] WAVE_FORMAT_PCM (audio in .SI files only used this format)
|
||||||
static const MxU32 g_supportedFormatTag = 1;
|
static const MxU32 g_supportedFormatTag = 1;
|
||||||
|
|
|
@ -164,7 +164,9 @@ public:
|
||||||
// FUNCTION: BETA10 0x1002c2b0
|
// FUNCTION: BETA10 0x1002c2b0
|
||||||
MxS16 GetCount() { return m_count; }
|
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
|
MxS16 m_count; // 0x00
|
||||||
ScoreItem m_scores[20]; // 0x02
|
ScoreItem m_scores[20]; // 0x02
|
||||||
|
@ -198,6 +200,7 @@ public:
|
||||||
void SwitchArea(Area p_area);
|
void SwitchArea(Area p_area);
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10083ff5
|
||||||
MxU8 GetActorId() { return m_actorId; }
|
MxU8 GetActorId() { return m_actorId; }
|
||||||
|
|
||||||
// FUNCTION: BETA10 0x1004a2d0
|
// FUNCTION: BETA10 0x1004a2d0
|
||||||
|
@ -207,7 +210,6 @@ public:
|
||||||
Act GetLoadedAct() { return m_loadedAct; }
|
Act GetLoadedAct() { return m_loadedAct; }
|
||||||
Area GetPreviousArea() { return m_previousArea; }
|
Area GetPreviousArea() { return m_previousArea; }
|
||||||
Area GetUnknown0x42c() { return m_unk0x42c; }
|
Area GetUnknown0x42c() { return m_unk0x42c; }
|
||||||
History* GetHistory() { return &m_history; }
|
|
||||||
|
|
||||||
void SetDirty(MxBool p_isDirty) { m_isDirty = p_isDirty; }
|
void SetDirty(MxBool p_isDirty) { m_isDirty = p_isDirty; }
|
||||||
void SetPreviousArea(Area p_previousArea) { m_previousArea = p_previousArea; }
|
void SetPreviousArea(Area p_previousArea) { m_previousArea = p_previousArea; }
|
||||||
|
|
|
@ -172,7 +172,9 @@ public:
|
||||||
// FUNCTION: BETA10 0x100e52b0
|
// FUNCTION: BETA10 0x100e52b0
|
||||||
LegoGameState* GetGameState() { return m_gameState; }
|
LegoGameState* GetGameState() { return m_gameState; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x100e5280
|
||||||
MxBackgroundAudioManager* GetBackgroundAudioManager() { return m_bkgAudioManager; }
|
MxBackgroundAudioManager* GetBackgroundAudioManager() { return m_bkgAudioManager; }
|
||||||
|
|
||||||
MxTransitionManager* GetTransitionManager() { return m_transitionManager; }
|
MxTransitionManager* GetTransitionManager() { return m_transitionManager; }
|
||||||
MxDSAction& GetCurrentAction() { return m_action; }
|
MxDSAction& GetCurrentAction() { return m_action; }
|
||||||
LegoCharacterManager* GetCharacterManager() { return m_characterManager; }
|
LegoCharacterManager* GetCharacterManager() { return m_characterManager; }
|
||||||
|
|
|
@ -82,6 +82,8 @@ public:
|
||||||
|
|
||||||
virtual void FUN_100136f0(float p_worldSpeed);
|
virtual void FUN_100136f0(float p_worldSpeed);
|
||||||
|
|
||||||
|
static void InitSoundIndices();
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10013e30
|
// SYNTHETIC: LEGO1 0x10013e30
|
||||||
// LegoJetski::`scalar deleting destructor'
|
// LegoJetski::`scalar deleting destructor'
|
||||||
};
|
};
|
||||||
|
@ -146,8 +148,7 @@ public:
|
||||||
virtual MxU32 HandleSkeletonKicks(float p_param1);
|
virtual MxU32 HandleSkeletonKicks(float p_param1);
|
||||||
|
|
||||||
static void FUN_10012de0();
|
static void FUN_10012de0();
|
||||||
static void FUN_10012e00();
|
static void InitSoundIndices();
|
||||||
static void FUN_10013670();
|
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10014240
|
// SYNTHETIC: LEGO1 0x10014240
|
||||||
// LegoRaceCar::`scalar deleting destructor'
|
// LegoRaceCar::`scalar deleting destructor'
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
MxBool Escape() override; // vtable+0x64
|
MxBool Escape() override; // vtable+0x64
|
||||||
void Enable(MxBool p_enable) override; // vtable+0x68
|
void Enable(MxBool p_enable) override; // vtable+0x68
|
||||||
|
|
||||||
inline void PlayAction(MxU32 p_objectId);
|
inline static void PlayAction(MxU32 p_objectId);
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10076f30
|
// SYNTHETIC: LEGO1 0x10076f30
|
||||||
// RegistrationBook::`scalar deleting destructor'
|
// RegistrationBook::`scalar deleting destructor'
|
||||||
|
|
|
@ -160,27 +160,30 @@ MxLong DuneBuggy::HandlePathStruct(LegoPathStructNotificationParam& p_param)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10068290
|
// FUNCTION: LEGO1 0x10068290
|
||||||
|
// FUNCTION: BETA10 0x1002765d
|
||||||
MxS32 DuneBuggy::GetColorOffset(const char* p_variable)
|
MxS32 DuneBuggy::GetColorOffset(const char* p_variable)
|
||||||
{
|
{
|
||||||
MxS32 offset = 1;
|
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(color, "lego green")) {
|
||||||
if (!SDL_strcasecmp(colorName, "lego red")) {
|
offset = 1;
|
||||||
offset = 2;
|
}
|
||||||
}
|
else if (!SDL_strcasecmp(color, "lego red")) {
|
||||||
else if (!SDL_strcasecmp(colorName, "lego yellow")) {
|
offset = 2;
|
||||||
offset = 3;
|
}
|
||||||
}
|
else if (!SDL_strcasecmp(color, "lego yellow")) {
|
||||||
else if (!SDL_strcasecmp(colorName, "lego black")) {
|
offset = 3;
|
||||||
offset = 4;
|
}
|
||||||
}
|
else if (!SDL_strcasecmp(color, "lego black")) {
|
||||||
else if (!SDL_strcasecmp(colorName, "lego blue")) {
|
offset = 4;
|
||||||
offset = 5;
|
}
|
||||||
}
|
else if (!SDL_strcasecmp(color, "lego blue")) {
|
||||||
else if (!SDL_strcasecmp(colorName, "lego white")) {
|
offset = 5;
|
||||||
offset = 6;
|
}
|
||||||
}
|
else if (!SDL_strcasecmp(color, "lego white")) {
|
||||||
|
offset = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
return offset;
|
return offset;
|
||||||
|
|
|
@ -71,6 +71,7 @@ MxLong IslePathActor::Notify(MxParam& p_param)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1001a350
|
// FUNCTION: LEGO1 0x1001a350
|
||||||
|
// FUNCTION: BETA10 0x100365ad
|
||||||
void IslePathActor::Enter()
|
void IslePathActor::Enter()
|
||||||
{
|
{
|
||||||
m_roi->SetVisibility(FALSE);
|
m_roi->SetVisibility(FALSE);
|
||||||
|
|
|
@ -20,12 +20,15 @@
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(Jetski, 0x164)
|
DECOMP_SIZE_ASSERT(Jetski, 0x164)
|
||||||
|
|
||||||
|
// These two have been changed between BETA10 and LEGO1
|
||||||
// GLOBAL: LEGO1 0x100f7ab8
|
// GLOBAL: LEGO1 0x100f7ab8
|
||||||
// STRING: LEGO1 0x100f3ce0
|
// STRING: LEGO1 0x100f3ce0
|
||||||
|
// GLOBAL: BETA10 0x101e0be4
|
||||||
const char* g_varJSFRNTY5 = "c_jsfrnty5";
|
const char* g_varJSFRNTY5 = "c_jsfrnty5";
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f7abc
|
// GLOBAL: LEGO1 0x100f7abc
|
||||||
// STRING: LEGO1 0x100f3ca4
|
// STRING: LEGO1 0x100f3ca4
|
||||||
|
// GLOBAL: BETA10 0x101e0be0
|
||||||
const char* g_varJSWNSHY5 = "c_jswnshy5";
|
const char* g_varJSWNSHY5 = "c_jswnshy5";
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1007e3b0
|
// FUNCTION: LEGO1 0x1007e3b0
|
||||||
|
@ -79,6 +82,7 @@ void Jetski::Exit()
|
||||||
// FUNCTION: BETA10 0x10037621
|
// FUNCTION: BETA10 0x10037621
|
||||||
MxLong Jetski::HandleClick()
|
MxLong Jetski::HandleClick()
|
||||||
{
|
{
|
||||||
|
#ifndef BETA10
|
||||||
if (!FUN_1003ef60()) {
|
if (!FUN_1003ef60()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -91,26 +95,41 @@ MxLong Jetski::HandleClick()
|
||||||
if (GameState()->GetActorId() != UserActor()->GetActorId()) {
|
if (GameState()->GetActorId() != UserActor()->GetActorId()) {
|
||||||
((IslePathActor*) UserActor())->Exit();
|
((IslePathActor*) UserActor())->Exit();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO: Match
|
// Selects the windshield from `IsleScript::c_JetskiDashboard11_Bitmap` (=41)
|
||||||
m_unk0x160 = ((DuneBuggy::GetColorOffset(g_varJSWNSHY5) * 5 + 15) * 2);
|
// to `IsleScript::c_JetskiDashboard66_Bitmap` based on the user's color selection
|
||||||
m_unk0x160 += DuneBuggy::GetColorOffset(g_varJSFRNTY5);
|
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);
|
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);
|
GetCurrentAction().SetObjectId(-1);
|
||||||
|
|
||||||
AnimationManager()->FUN_1005f6d0(FALSE);
|
AnimationManager()->FUN_1005f6d0(FALSE);
|
||||||
AnimationManager()->FUN_10064670(NULL);
|
AnimationManager()->FUN_10064670(NULL);
|
||||||
Enter();
|
Enter();
|
||||||
ControlManager()->Register(this);
|
ControlManager()->Register(this);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1007e880
|
// FUNCTION: LEGO1 0x1007e880
|
||||||
void Jetski::RemoveFromWorld()
|
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_JetskiArms_Ctl);
|
||||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_JetskiInfo_Ctl);
|
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_JetskiInfo_Ctl);
|
||||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_JetskiSpeedMeter);
|
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_JetskiSpeedMeter);
|
||||||
|
|
|
@ -9,18 +9,21 @@
|
||||||
DECOMP_SIZE_ASSERT(LegoCacheSound, 0x88)
|
DECOMP_SIZE_ASSERT(LegoCacheSound, 0x88)
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100064d0
|
// FUNCTION: LEGO1 0x100064d0
|
||||||
|
// FUNCTION: BETA10 0x10066340
|
||||||
LegoCacheSound::LegoCacheSound()
|
LegoCacheSound::LegoCacheSound()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006630
|
// FUNCTION: LEGO1 0x10006630
|
||||||
|
// FUNCTION: BETA10 0x100663f3
|
||||||
LegoCacheSound::~LegoCacheSound()
|
LegoCacheSound::~LegoCacheSound()
|
||||||
{
|
{
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100066d0
|
// FUNCTION: LEGO1 0x100066d0
|
||||||
|
// FUNCTION: BETA10 0x10066498
|
||||||
void LegoCacheSound::Init()
|
void LegoCacheSound::Init()
|
||||||
{
|
{
|
||||||
SDL_zero(m_buffer);
|
SDL_zero(m_buffer);
|
||||||
|
@ -28,10 +31,10 @@ void LegoCacheSound::Init()
|
||||||
m_data = NULL;
|
m_data = NULL;
|
||||||
m_unk0x58 = FALSE;
|
m_unk0x58 = FALSE;
|
||||||
memset(&m_wfx, 0, sizeof(m_wfx));
|
memset(&m_wfx, 0, sizeof(m_wfx));
|
||||||
m_unk0x6a = FALSE;
|
|
||||||
m_unk0x70 = FALSE;
|
|
||||||
m_looping = TRUE;
|
m_looping = TRUE;
|
||||||
|
m_unk0x6a = FALSE;
|
||||||
m_volume = 79;
|
m_volume = 79;
|
||||||
|
m_unk0x70 = FALSE;
|
||||||
m_muted = FALSE;
|
m_muted = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +86,7 @@ MxResult LegoCacheSound::Create(
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_unk0x48 = FUN_10006d80(p_mediaSrcPath);
|
m_unk0x48 = GetBaseFilename(p_mediaSrcPath);
|
||||||
m_wfx = p_pwfx;
|
m_wfx = p_pwfx;
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -92,6 +95,9 @@ MxResult LegoCacheSound::Create(
|
||||||
// FUNCTION: BETA10 0x100667a0
|
// FUNCTION: BETA10 0x100667a0
|
||||||
void LegoCacheSound::CopyData(MxU8* p_data, MxU32 p_dataSize)
|
void LegoCacheSound::CopyData(MxU8* p_data, MxU32 p_dataSize)
|
||||||
{
|
{
|
||||||
|
assert(p_data);
|
||||||
|
assert(p_dataSize);
|
||||||
|
|
||||||
delete[] m_data;
|
delete[] m_data;
|
||||||
m_dataSize = p_dataSize;
|
m_dataSize = p_dataSize;
|
||||||
m_data = new MxU8[m_dataSize];
|
m_data = new MxU8[m_dataSize];
|
||||||
|
@ -99,6 +105,7 @@ void LegoCacheSound::CopyData(MxU8* p_data, MxU32 p_dataSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006920
|
// FUNCTION: LEGO1 0x10006920
|
||||||
|
// FUNCTION: BETA10 0x1006685b
|
||||||
void LegoCacheSound::Destroy()
|
void LegoCacheSound::Destroy()
|
||||||
{
|
{
|
||||||
ma_sound_uninit(&m_cacheSound);
|
ma_sound_uninit(&m_cacheSound);
|
||||||
|
@ -113,13 +120,16 @@ void LegoCacheSound::Destroy()
|
||||||
LegoCacheSound* LegoCacheSound::Clone()
|
LegoCacheSound* LegoCacheSound::Clone()
|
||||||
{
|
{
|
||||||
LegoCacheSound* pnew = new LegoCacheSound();
|
LegoCacheSound* pnew = new LegoCacheSound();
|
||||||
|
assert(pnew);
|
||||||
|
|
||||||
if (pnew->Create(m_wfx, m_unk0x48, m_volume, m_data, m_dataSize) == SUCCESS) {
|
MxResult result = pnew->Create(m_wfx, m_unk0x48, m_volume, m_data, m_dataSize);
|
||||||
|
if (result == SUCCESS) {
|
||||||
return pnew;
|
return pnew;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
delete pnew;
|
delete pnew;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006a30
|
// FUNCTION: LEGO1 0x10006a30
|
||||||
|
@ -160,6 +170,7 @@ MxResult LegoCacheSound::Play(const char* p_name, MxBool p_looping)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006b80
|
// FUNCTION: LEGO1 0x10006b80
|
||||||
|
// FUNCTION: BETA10 0x10066ca3
|
||||||
void LegoCacheSound::Stop()
|
void LegoCacheSound::Stop()
|
||||||
{
|
{
|
||||||
ma_sound_stop(&m_cacheSound);
|
ma_sound_stop(&m_cacheSound);
|
||||||
|
@ -174,6 +185,7 @@ void LegoCacheSound::Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006be0
|
// FUNCTION: LEGO1 0x10006be0
|
||||||
|
// FUNCTION: BETA10 0x10066d23
|
||||||
void LegoCacheSound::FUN_10006be0()
|
void LegoCacheSound::FUN_10006be0()
|
||||||
{
|
{
|
||||||
if (!m_looping) {
|
if (!m_looping) {
|
||||||
|
@ -197,14 +209,16 @@ void LegoCacheSound::FUN_10006be0()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_unk0x74.GetLength() != 0 && !m_muted) {
|
if (m_unk0x74.GetLength() == 0) {
|
||||||
if (!m_sound.UpdatePosition(&m_cacheSound)) {
|
return;
|
||||||
if (m_unk0x6a) {
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ma_sound_stop(&m_cacheSound);
|
if (!m_muted) {
|
||||||
m_unk0x6a = TRUE;
|
if (!m_sound.UpdatePosition(&m_cacheSound)) {
|
||||||
|
if (!m_unk0x6a) {
|
||||||
|
ma_sound_stop(&m_cacheSound);
|
||||||
|
m_unk0x6a = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (m_unk0x6a) {
|
else if (m_unk0x6a) {
|
||||||
ma_sound_start(&m_cacheSound);
|
ma_sound_start(&m_cacheSound);
|
||||||
|
@ -214,12 +228,14 @@ void LegoCacheSound::FUN_10006be0()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006cb0
|
// FUNCTION: LEGO1 0x10006cb0
|
||||||
|
// FUNCTION: BETA10 0x10066e85
|
||||||
void LegoCacheSound::SetDistance(MxS32 p_min, MxS32 p_max)
|
void LegoCacheSound::SetDistance(MxS32 p_min, MxS32 p_max)
|
||||||
{
|
{
|
||||||
m_sound.SetDistance(p_min, p_max);
|
m_sound.SetDistance(p_min, p_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006cd0
|
// FUNCTION: LEGO1 0x10006cd0
|
||||||
|
// FUNCTION: BETA10 0x10066eb0
|
||||||
void LegoCacheSound::FUN_10006cd0(undefined4, undefined4)
|
void LegoCacheSound::FUN_10006cd0(undefined4, undefined4)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -258,33 +274,33 @@ void LegoCacheSound::MuteStop(MxBool p_muted)
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006d80
|
// FUNCTION: LEGO1 0x10006d80
|
||||||
// FUNCTION: BETA10 0x100670e7
|
// FUNCTION: BETA10 0x100670e7
|
||||||
MxString LegoCacheSound::FUN_10006d80(const MxString& p_str)
|
MxString LegoCacheSound::GetBaseFilename(MxString& p_path)
|
||||||
{
|
{
|
||||||
// TODO: Clean up code
|
// Get the base filename from the given path
|
||||||
char* str = p_str.GetData();
|
// e.g. "Z:\Lego\Audio\test.wav" --> "test"
|
||||||
MxU32 length = strlen(str);
|
char* str = p_path.GetData();
|
||||||
|
|
||||||
char* local28 = str + length;
|
// Start at the end of the string and work backwards.
|
||||||
char* local14 = local28;
|
char* p = str + strlen(str);
|
||||||
char* pVar1 = local28;
|
char* end = p;
|
||||||
|
|
||||||
do {
|
while (str != p--) {
|
||||||
local14 = pVar1;
|
// If the file has an extension, we want to exclude it from the output.
|
||||||
pVar1 = local14 + -1;
|
// Set this as our new end position.
|
||||||
|
if (*p == '.') {
|
||||||
|
end = p;
|
||||||
|
}
|
||||||
|
|
||||||
if (str == local14) {
|
// Stop if we hit a directory or drive letter.
|
||||||
|
if (*p == '\\') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (*pVar1 == '.') {
|
MxString output;
|
||||||
local28 = pVar1;
|
// Increment by one to shift p to the start of the filename.
|
||||||
}
|
char* x = ++p;
|
||||||
} while (*pVar1 != '\\');
|
// If end points to the dot in filename, change it to a null terminator.
|
||||||
|
x[end - p] = '\0';
|
||||||
local14 = pVar1;
|
return output = x;
|
||||||
|
|
||||||
MxString local24;
|
|
||||||
local14++;
|
|
||||||
*local28 = '\0';
|
|
||||||
return local24 = local14;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,8 +212,11 @@ MxTransitionManager* TransitionManager()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10015910
|
// FUNCTION: LEGO1 0x10015910
|
||||||
|
// FUNCTION: BETA10 0x100e4f4c
|
||||||
void PlayMusic(JukeboxScript::Script p_objectId)
|
void PlayMusic(JukeboxScript::Script p_objectId)
|
||||||
{
|
{
|
||||||
|
assert(LegoOmni::GetInstance());
|
||||||
|
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
action.SetAtomId(*g_jukeboxScript);
|
action.SetAtomId(*g_jukeboxScript);
|
||||||
action.SetObjectId(p_objectId);
|
action.SetObjectId(p_objectId);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(LegoControlManager, 0x60)
|
DECOMP_SIZE_ASSERT(LegoControlManager, 0x60)
|
||||||
DECOMP_SIZE_ASSERT(LegoControlManagerNotificationParam, 0x2c)
|
DECOMP_SIZE_ASSERT(LegoControlManagerNotificationParam, 0x2c)
|
||||||
|
DECOMP_SIZE_ASSERT(LegoEventNotificationParam, 0x20)
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10028520
|
// FUNCTION: LEGO1 0x10028520
|
||||||
LegoControlManager::LegoControlManager()
|
LegoControlManager::LegoControlManager()
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include "legoeventnotificationparam.h"
|
|
||||||
|
|
||||||
#include "decomp.h"
|
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(LegoEventNotificationParam, 0x20)
|
|
|
@ -102,7 +102,7 @@ MxResult CarRace::Create(MxDSAction& p_dsAction)
|
||||||
m_unk0x148 = -1;
|
m_unk0x148 = -1;
|
||||||
m_unk0x14c = -1;
|
m_unk0x14c = -1;
|
||||||
|
|
||||||
LegoRaceCar::FUN_10012e00();
|
LegoRaceCar::InitSoundIndices();
|
||||||
|
|
||||||
MxS32 streamId =
|
MxS32 streamId =
|
||||||
DuneBuggy::GetColorOffset(g_strCRCEDGEY0) + (DuneBuggy::GetColorOffset(g_strCRCFRNTY6) * 5 + 15) * 2;
|
DuneBuggy::GetColorOffset(g_strCRCEDGEY0) + (DuneBuggy::GetColorOffset(g_strCRCFRNTY6) * 5 + 15) * 2;
|
||||||
|
|
|
@ -65,7 +65,7 @@ MxResult JetskiRace::Create(MxDSAction& p_dsAction)
|
||||||
m_unk0x130.SetTop(317);
|
m_unk0x130.SetTop(317);
|
||||||
m_unk0x130.SetRight(543);
|
m_unk0x130.SetRight(543);
|
||||||
m_unk0x130.SetBottom(333);
|
m_unk0x130.SetBottom(333);
|
||||||
LegoRaceCar::FUN_10013670();
|
LegoJetski::InitSoundIndices();
|
||||||
InvokeAction(
|
InvokeAction(
|
||||||
Extra::e_start,
|
Extra::e_start,
|
||||||
m_atomId,
|
m_atomId,
|
||||||
|
|
|
@ -13,6 +13,7 @@ DECOMP_SIZE_ASSERT(LegoRaceActor, 0x180)
|
||||||
|
|
||||||
// Initialized at LEGO1 0x100145a0
|
// Initialized at LEGO1 0x100145a0
|
||||||
// GLOBAL: LEGO1 0x10102b08
|
// GLOBAL: LEGO1 0x10102b08
|
||||||
|
// GLOBAL: BETA10 0x102114a8
|
||||||
Mx3DPointFloat LegoRaceActor::g_unk0x10102b08 = Mx3DPointFloat(0.0, 2.0, 0.0);
|
Mx3DPointFloat LegoRaceActor::g_unk0x10102b08 = Mx3DPointFloat(0.0, 2.0, 0.0);
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100145d0
|
// FUNCTION: LEGO1 0x100145d0
|
||||||
|
@ -101,9 +102,9 @@ MxResult LegoRaceActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_bool) {
|
if (p_bool) {
|
||||||
|
MxMatrix matr;
|
||||||
LegoROI* roi = p_actor->GetROI(); // name verified by BETA10 0x100c9fcf
|
LegoROI* roi = p_actor->GetROI(); // name verified by BETA10 0x100c9fcf
|
||||||
assert(roi);
|
assert(roi);
|
||||||
MxMatrix matr;
|
|
||||||
matr = roi->GetLocal2World();
|
matr = roi->GetLocal2World();
|
||||||
|
|
||||||
Vector3(matr[3]) += g_unk0x10102b08;
|
Vector3(matr[3]) += g_unk0x10102b08;
|
||||||
|
|
|
@ -29,7 +29,7 @@ DECOMP_SIZE_ASSERT(LegoJetski, 0x1dc)
|
||||||
|
|
||||||
// name verified by BETA10 0x100cbee6
|
// name verified by BETA10 0x100cbee6
|
||||||
// GLOBAL: LEGO1 0x100f0a20
|
// GLOBAL: LEGO1 0x100f0a20
|
||||||
// GLOBAL: BETA10 0x101f5e34
|
// GLOBAL: BETA10 0x101f5e30
|
||||||
EdgeReference g_skBMap[] = {
|
EdgeReference g_skBMap[] = {
|
||||||
{// STRING: LEGO1 0x100f0a10
|
{// STRING: LEGO1 0x100f0a10
|
||||||
"EDG03_772",
|
"EDG03_772",
|
||||||
|
@ -83,7 +83,7 @@ const char* g_strJetSpeed = "jetSPEED";
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b18
|
// GLOBAL: LEGO1 0x100f0b18
|
||||||
// GLOBAL: BETA10 0x101f5f28
|
// GLOBAL: BETA10 0x101f5f28
|
||||||
const char* g_srtsl18to29[] = {
|
const char* g_playerHitStudsSounds[] = {
|
||||||
"srt018sl",
|
"srt018sl",
|
||||||
"srt019sl",
|
"srt019sl",
|
||||||
"srt020sl",
|
"srt020sl",
|
||||||
|
@ -100,19 +100,19 @@ const char* g_srtsl18to29[] = {
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b48
|
// GLOBAL: LEGO1 0x100f0b48
|
||||||
// GLOBAL: BETA10 0x101f5f58
|
// GLOBAL: BETA10 0x101f5f58
|
||||||
const char* g_srtsl6to10[] = {"srt006sl", "srt007sl", "srt008sl", "srt009sl", "srt010sl"};
|
const char* g_studsHitPlayerSounds[] = {"srt006sl", "srt007sl", "srt008sl", "srt009sl", "srt010sl"};
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b5c
|
// GLOBAL: LEGO1 0x100f0b5c
|
||||||
// GLOBAL: BETA10 0x101f5f6c
|
// GLOBAL: BETA10 0x101f5f6c
|
||||||
const char* g_emptySoundKeyList[] = {NULL};
|
const char* g_playerHitRhodaSounds[] = {NULL};
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b60
|
// GLOBAL: LEGO1 0x100f0b60
|
||||||
// GLOBAL: BETA10 0x101f5f70
|
// GLOBAL: BETA10 0x101f5f70
|
||||||
const char* g_srtrh[] = {"srt004rh", "srt005rh", "srt006rh"};
|
const char* g_rhodaHitPlayerSounds[] = {"srt004rh", "srt005rh", "srt006rh"};
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b6c
|
// GLOBAL: LEGO1 0x100f0b6c
|
||||||
// STRING: LEGO1 0x100f08c4
|
// STRING: LEGO1 0x100f08c4
|
||||||
const char* g_srt001ra = "srt001ra";
|
const char* g_youCantStopSound = "srt001ra";
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b70
|
// GLOBAL: LEGO1 0x100f0b70
|
||||||
// STRING: LEGO1 0x100f08bc
|
// STRING: LEGO1 0x100f08bc
|
||||||
|
@ -120,31 +120,31 @@ const char* g_soundSkel3 = "skel3";
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b74
|
// GLOBAL: LEGO1 0x100f0b74
|
||||||
// GLOBAL: BETA10 0x101f5f80
|
// GLOBAL: BETA10 0x101f5f80
|
||||||
MxU32 g_srtsl18to29Index = 0;
|
MxU32 g_playerHitStudsSoundsIndex = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b78
|
// GLOBAL: LEGO1 0x100f0b78
|
||||||
// GLOBAL: BETA10 0x101f5f84
|
// GLOBAL: BETA10 0x101f5f84
|
||||||
MxU32 g_srtsl6to10Index = 0;
|
MxU32 g_studsHitPlayerSoundsIndex = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b7c
|
// GLOBAL: LEGO1 0x100f0b7c
|
||||||
// GLOBAL: BETA10 0x101f5f88
|
// GLOBAL: BETA10 0x101f5f88
|
||||||
MxU32 g_emptySoundKeyListIndex = 0;
|
MxU32 g_playerHitRhodaSoundsIndex = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b80
|
// GLOBAL: LEGO1 0x100f0b80
|
||||||
// GLOBAL: BETA10 0x101f5f8c
|
// GLOBAL: BETA10 0x101f5f8c
|
||||||
MxU32 g_srtrhIndex = 0;
|
MxU32 g_rhodaHitPlayerSoundsIndex = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b84
|
// GLOBAL: LEGO1 0x100f0b84
|
||||||
// GLOBAL: BETA10 0x101f5f90
|
// GLOBAL: BETA10 0x101f5f90
|
||||||
MxLong g_timeLastSoundPlayed = 0;
|
MxLong g_timeLastRaceCarSoundPlayed = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b88
|
// GLOBAL: LEGO1 0x100f0b88
|
||||||
// GLOBAL: BETA10 0x101f5f94
|
// GLOBAL: BETA10 0x101f5f94
|
||||||
MxS32 g_unk0x100f0b88 = 0;
|
MxS32 g_timePlayerLastMoved = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b8c
|
// GLOBAL: LEGO1 0x100f0b8c
|
||||||
// GLOBAL: BETA10 0x101f5f98
|
// GLOBAL: BETA10 0x101f5f98
|
||||||
MxBool g_unk0x100f0b8c = TRUE;
|
MxBool g_playedYouCantStopSound = TRUE;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0b90
|
// GLOBAL: LEGO1 0x100f0b90
|
||||||
const char* g_hitSnapSounds[] = {
|
const char* g_hitSnapSounds[] = {
|
||||||
|
@ -168,9 +168,10 @@ undefined4 g_hitSnapSoundsIndex = 0;
|
||||||
undefined4 g_hitValerieSoundsIndex = 0;
|
undefined4 g_hitValerieSoundsIndex = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f0bb4
|
// GLOBAL: LEGO1 0x100f0bb4
|
||||||
MxLong g_unk0x100f0bb4 = 0;
|
MxLong g_timeLastJetskiSoundPlayed = 0;
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10012950
|
// FUNCTION: LEGO1 0x10012950
|
||||||
|
// FUNCTION: BETA10 0x100cad10
|
||||||
LegoRaceCar::LegoRaceCar()
|
LegoRaceCar::LegoRaceCar()
|
||||||
{
|
{
|
||||||
m_userState = 0;
|
m_userState = 0;
|
||||||
|
@ -184,12 +185,14 @@ LegoRaceCar::LegoRaceCar()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10012c80
|
// FUNCTION: LEGO1 0x10012c80
|
||||||
|
// FUNCTION: BETA10 0x100caf67
|
||||||
LegoRaceCar::~LegoRaceCar()
|
LegoRaceCar::~LegoRaceCar()
|
||||||
{
|
{
|
||||||
NotificationManager()->Unregister(this);
|
NotificationManager()->Unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10012d90
|
// FUNCTION: LEGO1 0x10012d90
|
||||||
|
// FUNCTION: BETA10 0x100cb0bd
|
||||||
MxLong LegoRaceCar::Notify(MxParam& p_param)
|
MxLong LegoRaceCar::Notify(MxParam& p_param)
|
||||||
{
|
{
|
||||||
return LegoRaceMap::Notify(p_param);
|
return LegoRaceMap::Notify(p_param);
|
||||||
|
@ -203,21 +206,22 @@ Mx3DPointFloat g_unk0x10102af0 = Mx3DPointFloat(0.0f, 2.0f, 0.0f);
|
||||||
// FUNCTION: LEGO1 0x10012de0
|
// FUNCTION: LEGO1 0x10012de0
|
||||||
void LegoRaceCar::FUN_10012de0()
|
void LegoRaceCar::FUN_10012de0()
|
||||||
{
|
{
|
||||||
g_unk0x100f0b8c = TRUE;
|
// Init to TRUE so we don't play "you can't stop in the middle of the race!" before the player ever moves
|
||||||
g_timeLastSoundPlayed = 0;
|
g_playedYouCantStopSound = TRUE;
|
||||||
g_unk0x100f0b88 = 0;
|
g_timeLastRaceCarSoundPlayed = 0;
|
||||||
|
g_timePlayerLastMoved = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10012e00
|
// FUNCTION: LEGO1 0x10012e00
|
||||||
// FUNCTION: BETA10 0x100cb129
|
// FUNCTION: BETA10 0x100cb129
|
||||||
void LegoRaceCar::FUN_10012e00()
|
void LegoRaceCar::InitSoundIndices()
|
||||||
{
|
{
|
||||||
// Note the (likely unintentional) order of operations: `%` is executed before `/`,
|
// Note the (likely unintentional) order of operations: `%` is executed before `/`,
|
||||||
// so the division is performed at runtime.
|
// so the division is performed at runtime.
|
||||||
g_srtsl18to29Index = rand() % sizeof(g_srtsl18to29) / sizeof(g_srtsl18to29[0]);
|
g_playerHitStudsSoundsIndex = rand() % sizeof(g_playerHitStudsSounds) / sizeof(g_playerHitStudsSounds[0]);
|
||||||
g_srtsl6to10Index = rand() % sizeof(g_srtsl6to10) / sizeof(g_srtsl6to10[0]);
|
g_studsHitPlayerSoundsIndex = rand() % sizeof(g_studsHitPlayerSounds) / sizeof(g_studsHitPlayerSounds[0]);
|
||||||
g_emptySoundKeyListIndex = rand() % sizeof(g_emptySoundKeyList) / sizeof(g_emptySoundKeyList[0]);
|
g_playerHitRhodaSoundsIndex = rand() % sizeof(g_playerHitRhodaSounds) / sizeof(g_playerHitRhodaSounds[0]);
|
||||||
g_srtrhIndex = rand() % sizeof(g_srtrh) / sizeof(g_srtrh[0]);
|
g_rhodaHitPlayerSoundsIndex = rand() % sizeof(g_rhodaHitPlayerSounds) / sizeof(g_rhodaHitPlayerSounds[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10012e60
|
// FUNCTION: LEGO1 0x10012e60
|
||||||
|
@ -267,27 +271,22 @@ void LegoRaceCar::ParseAction(char* p_extra)
|
||||||
MxS32 i;
|
MxS32 i;
|
||||||
|
|
||||||
for (i = 0; i < m_animMaps.size(); i++) {
|
for (i = 0; i < m_animMaps.size(); i++) {
|
||||||
// It appears that the implementation in BETA10 does not use this variable
|
if (m_animMaps[i]->GetUnknown0x00() == -1.0f) {
|
||||||
LegoAnimActorStruct* animMap = m_animMaps[i];
|
m_skelKick1Anim = m_animMaps[i];
|
||||||
|
|
||||||
if (animMap->m_unk0x00 == -1.0f) {
|
|
||||||
m_skelKick1Anim = animMap;
|
|
||||||
}
|
}
|
||||||
else if (animMap->m_unk0x00 == -2.0f) {
|
else if (m_animMaps[i]->GetUnknown0x00() == -2.0f) {
|
||||||
m_skelKick2Anim = animMap;
|
m_skelKick2Anim = m_animMaps[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(m_skelKick1Anim && m_skelKick2Anim);
|
assert(m_skelKick1Anim && m_skelKick2Anim);
|
||||||
|
|
||||||
// STRING: LEGO1 0x100f0bc4
|
// STRING: LEGO1 0x100f0bc4
|
||||||
const char* edge0344 = "EDG03_44";
|
m_kick1B = currentWorld->FindPathBoundary("EDG03_44");
|
||||||
m_kick1B = currentWorld->FindPathBoundary(edge0344);
|
|
||||||
assert(m_kick1B);
|
assert(m_kick1B);
|
||||||
|
|
||||||
// STRING: LEGO1 0x100f0bb8
|
// STRING: LEGO1 0x100f0bb8
|
||||||
const char* edge0354 = "EDG03_54";
|
m_kick2B = currentWorld->FindPathBoundary("EDG03_54");
|
||||||
m_kick2B = currentWorld->FindPathBoundary(edge0354);
|
|
||||||
assert(m_kick2B);
|
assert(m_kick2B);
|
||||||
|
|
||||||
for (i = 0; i < sizeOfArray(g_skBMap); i++) {
|
for (i = 0; i < sizeOfArray(g_skBMap); i++) {
|
||||||
|
@ -442,14 +441,16 @@ void LegoRaceCar::Animate(float p_time)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the player is moving forwards or backwards
|
||||||
if (absoluteSpeed != 0.0f) {
|
if (absoluteSpeed != 0.0f) {
|
||||||
g_unk0x100f0b88 = p_time;
|
g_timePlayerLastMoved = p_time;
|
||||||
g_unk0x100f0b8c = FALSE;
|
g_playedYouCantStopSound = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_time - g_unk0x100f0b88 > 5000.0f && !g_unk0x100f0b8c) {
|
// If the player hasn't moved in 5 seconds, play the "you can't stop in the middle of the race!" sound once
|
||||||
SoundManager()->GetCacheSoundManager()->Play(g_srt001ra, NULL, 0);
|
if (p_time - g_timePlayerLastMoved > 5000.0f && !g_playedYouCantStopSound) {
|
||||||
g_unk0x100f0b8c = TRUE;
|
SoundManager()->GetCacheSoundManager()->Play(g_youCantStopSound, NULL, 0);
|
||||||
|
g_playedYouCantStopSound = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,9 +466,9 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_bool) {
|
if (p_bool) {
|
||||||
|
MxMatrix matr;
|
||||||
LegoROI* roi = p_actor->GetROI(); // name verified by BETA10 0x100cbbf5
|
LegoROI* roi = p_actor->GetROI(); // name verified by BETA10 0x100cbbf5
|
||||||
assert(roi);
|
assert(roi);
|
||||||
MxMatrix matr;
|
|
||||||
matr = roi->GetLocal2World();
|
matr = roi->GetLocal2World();
|
||||||
|
|
||||||
Vector3(matr[3]) += g_unk0x10102af0;
|
Vector3(matr[3]) += g_unk0x10102af0;
|
||||||
|
@ -482,41 +483,40 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
||||||
MxLong time = Timer()->GetTime();
|
MxLong time = Timer()->GetTime();
|
||||||
|
|
||||||
const char* soundKey = NULL;
|
const char* soundKey = NULL;
|
||||||
MxLong timeElapsed = time - g_timeLastSoundPlayed;
|
|
||||||
|
|
||||||
if (timeElapsed > 3000) {
|
if (time - g_timeLastRaceCarSoundPlayed > 3000) {
|
||||||
if (p_bool) {
|
if (p_bool) {
|
||||||
if (actorIsStuds) {
|
if (actorIsStuds) {
|
||||||
soundKey = g_srtsl18to29[g_srtsl18to29Index++];
|
soundKey = g_playerHitStudsSounds[g_playerHitStudsSoundsIndex++];
|
||||||
if (g_srtsl18to29Index >= sizeOfArray(g_srtsl18to29)) {
|
if (g_playerHitStudsSoundsIndex >= sizeOfArray(g_playerHitStudsSounds)) {
|
||||||
g_srtsl18to29Index = 0;
|
g_playerHitStudsSoundsIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (actorIsRhoda) {
|
else if (actorIsRhoda) {
|
||||||
soundKey = g_emptySoundKeyList[g_emptySoundKeyListIndex++];
|
soundKey = g_playerHitRhodaSounds[g_playerHitRhodaSoundsIndex++];
|
||||||
if (g_emptySoundKeyListIndex >= sizeOfArray(g_emptySoundKeyList)) {
|
if (g_playerHitRhodaSoundsIndex >= sizeOfArray(g_playerHitRhodaSounds)) {
|
||||||
g_emptySoundKeyListIndex = 0;
|
g_playerHitRhodaSoundsIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (actorIsStuds) {
|
if (actorIsStuds) {
|
||||||
soundKey = g_srtsl6to10[g_srtsl6to10Index++];
|
soundKey = g_studsHitPlayerSounds[g_studsHitPlayerSoundsIndex++];
|
||||||
if (g_srtsl6to10Index >= sizeOfArray(g_srtsl6to10)) {
|
if (g_studsHitPlayerSoundsIndex >= sizeOfArray(g_studsHitPlayerSounds)) {
|
||||||
g_srtsl6to10Index = 0;
|
g_studsHitPlayerSoundsIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (actorIsRhoda) {
|
else if (actorIsRhoda) {
|
||||||
soundKey = g_srtrh[g_srtrhIndex++];
|
soundKey = g_rhodaHitPlayerSounds[g_rhodaHitPlayerSoundsIndex++];
|
||||||
if (g_srtrhIndex >= sizeOfArray(g_srtrh)) {
|
if (g_rhodaHitPlayerSoundsIndex >= sizeOfArray(g_rhodaHitPlayerSounds)) {
|
||||||
g_srtrhIndex = 0;
|
g_rhodaHitPlayerSoundsIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soundKey) {
|
if (soundKey) {
|
||||||
SoundManager()->GetCacheSoundManager()->Play(soundKey, NULL, FALSE);
|
SoundManager()->GetCacheSoundManager()->Play(soundKey, NULL, FALSE);
|
||||||
g_timeLastSoundPlayed = g_unk0x100f3308 = time;
|
g_timeLastRaceCarSoundPlayed = g_unk0x100f3308 = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,13 +570,11 @@ MxResult LegoRaceCar::VTable0x9c()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10013670
|
// FUNCTION: LEGO1 0x10013670
|
||||||
void LegoRaceCar::FUN_10013670()
|
void LegoJetski::InitSoundIndices()
|
||||||
{
|
{
|
||||||
g_hitSnapSoundsIndex = (rand() & 0xc) >> 2;
|
// See note in LegoRaceCar::InitSoundIndices
|
||||||
|
g_hitSnapSoundsIndex = rand() % sizeof(g_hitSnapSounds) / sizeof(g_hitSnapSounds[0]);
|
||||||
// Inlining the `rand()` causes this function to mismatch
|
g_hitValerieSoundsIndex = rand() % sizeof(g_hitValerieSounds) / sizeof(g_hitValerieSounds[0]);
|
||||||
MxU32 uVar1 = rand();
|
|
||||||
g_hitValerieSoundsIndex = uVar1 % 0xc >> 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100136a0
|
// FUNCTION: LEGO1 0x100136a0
|
||||||
|
@ -683,8 +681,8 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_bool) {
|
if (p_bool) {
|
||||||
LegoROI* roi = p_actor->GetROI();
|
|
||||||
MxMatrix matr;
|
MxMatrix matr;
|
||||||
|
LegoROI* roi = p_actor->GetROI();
|
||||||
matr = roi->GetLocal2World();
|
matr = roi->GetLocal2World();
|
||||||
|
|
||||||
Vector3(matr[3]) += g_unk0x10102af0;
|
Vector3(matr[3]) += g_unk0x10102af0;
|
||||||
|
@ -699,9 +697,8 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
||||||
MxLong time = Timer()->GetTime();
|
MxLong time = Timer()->GetTime();
|
||||||
|
|
||||||
const char* soundKey = NULL;
|
const char* soundKey = NULL;
|
||||||
MxLong timeElapsed = time - g_unk0x100f0bb4;
|
|
||||||
|
|
||||||
if (timeElapsed > 3000) {
|
if (time - g_timeLastJetskiSoundPlayed > 3000) {
|
||||||
if (actorIsSnap) {
|
if (actorIsSnap) {
|
||||||
soundKey = g_hitSnapSounds[g_hitSnapSoundsIndex++];
|
soundKey = g_hitSnapSounds[g_hitSnapSoundsIndex++];
|
||||||
if (g_hitSnapSoundsIndex >= sizeOfArray(g_hitSnapSounds)) {
|
if (g_hitSnapSoundsIndex >= sizeOfArray(g_hitSnapSounds)) {
|
||||||
|
@ -717,7 +714,7 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
||||||
|
|
||||||
if (soundKey) {
|
if (soundKey) {
|
||||||
SoundManager()->GetCacheSoundManager()->Play(soundKey, NULL, FALSE);
|
SoundManager()->GetCacheSoundManager()->Play(soundKey, NULL, FALSE);
|
||||||
g_timeLastSoundPlayed = g_unk0x100f3308 = time;
|
g_timeLastJetskiSoundPlayed = g_unk0x100f3308 = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ DECOMP_SIZE_ASSERT(HistoryBook, 0x3e4)
|
||||||
HistoryBook::HistoryBook()
|
HistoryBook::HistoryBook()
|
||||||
{
|
{
|
||||||
memset(m_alphabet, 0, sizeof(m_alphabet));
|
memset(m_alphabet, 0, sizeof(m_alphabet));
|
||||||
memset(m_names, 0, sizeof(m_names));
|
memset(m_name, 0, sizeof(m_name));
|
||||||
memset(m_scores, 0, sizeof(m_scores));
|
memset(m_scores, 0, sizeof(m_scores));
|
||||||
NotificationManager()->Register(this);
|
NotificationManager()->Register(this);
|
||||||
}
|
}
|
||||||
|
@ -32,11 +32,11 @@ HistoryBook::~HistoryBook()
|
||||||
m_scores[scoreIndex] = NULL;
|
m_scores[scoreIndex] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MxS16 letterIndex = 0; letterIndex < (MxS16) sizeOfArray(m_names[0]); letterIndex++) {
|
for (MxS16 letterIndex = 0; letterIndex < (MxS16) sizeOfArray(m_name[0]); letterIndex++) {
|
||||||
if (m_names[scoreIndex][letterIndex]) {
|
if (m_name[scoreIndex][letterIndex]) {
|
||||||
delete m_names[scoreIndex][letterIndex]->GetAction();
|
delete m_name[scoreIndex][letterIndex]->GetAction();
|
||||||
delete m_names[scoreIndex][letterIndex];
|
delete m_name[scoreIndex][letterIndex];
|
||||||
m_names[scoreIndex][letterIndex] = NULL;
|
m_name[scoreIndex][letterIndex] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,88 +89,96 @@ MxLong HistoryBook::Notify(MxParam& p_param)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void SetColor(MxStillPresenter* p_presenter, MxU8 p_color, MxU8* p_colors, MxS32 p_x, MxS32 p_y)
|
|
||||||
{
|
|
||||||
if (p_color) {
|
|
||||||
for (MxS32 lax = 0; lax < 4; lax++) {
|
|
||||||
if (p_presenter->GetAlphaMask() != NULL) {
|
|
||||||
memset(NULL, p_colors[p_color - 1], 4);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
memset(p_presenter->GetBitmap()->GetStart(p_x, p_y + lax), p_colors[p_color - 1], 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100826f0
|
// FUNCTION: LEGO1 0x100826f0
|
||||||
|
// FUNCTION: BETA10 0x1002b9b9
|
||||||
void HistoryBook::ReadyWorld()
|
void HistoryBook::ReadyWorld()
|
||||||
{
|
{
|
||||||
|
undefined2 dummy1 = 0x90, dummy2 = 0x79, dummy3 = 0xc8, dummy4 = 0x17, dummy5 = 0x1b;
|
||||||
|
#ifndef BETA10
|
||||||
LegoWorld::ReadyWorld();
|
LegoWorld::ReadyWorld();
|
||||||
GameState()->GetHistory()->WriteScoreHistory();
|
#endif
|
||||||
|
GameState()->m_history.WriteScoreHistory();
|
||||||
|
|
||||||
char bitmap[] = "A_Bitmap";
|
char bitmap[] = "A_Bitmap";
|
||||||
for (MxS16 i = 0; i < 26; i++) {
|
MxS16 i;
|
||||||
m_alphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", bitmap);
|
|
||||||
bitmap[0]++;
|
for (i = 0; i < 26; i++) {
|
||||||
|
// TODO: This might be an inline function.
|
||||||
|
// See also `RegistrationBook::ReadyWorld()`.
|
||||||
|
if (i < 26) {
|
||||||
|
m_alphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", bitmap);
|
||||||
|
assert(m_alphabet[i]);
|
||||||
|
bitmap[0]++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MxStillPresenter* scoreboxMaster = (MxStillPresenter*) Find("MxStillPresenter", "ScoreBox");
|
MxStillPresenter* scoreboxMaster = (MxStillPresenter*) Find("MxStillPresenter", "ScoreBox");
|
||||||
MxU8 scoreColors[3] =
|
MxU8 scoreColors[3] =
|
||||||
{0x76, 0x4c, 0x38}; // yellow - #FFB900, blue - #00548C, red - #CB1220, background - #CECECE, border - #74818B
|
{0x76, 0x4c, 0x38}; // yellow - #FFB900, blue - #00548C, red - #CB1220, background - #CECECE, border - #74818B
|
||||||
MxS32 scoreY = 0x79;
|
|
||||||
|
|
||||||
for (MxS16 scoreIndex = 0; scoreIndex < GameState()->GetHistory()->m_count; scoreIndex++) {
|
MxS32 scoreY;
|
||||||
LegoGameState::ScoreItem* score = GameState()->GetHistory()->GetScore(scoreIndex);
|
|
||||||
|
|
||||||
MxStillPresenter** scorebox = &m_scores[scoreIndex];
|
for (i = 0, scoreY = 0x79; i < GameState()->m_history.GetCount(); i++, scoreY += 0x1b) {
|
||||||
*scorebox = scoreboxMaster->Clone();
|
LegoGameState::ScoreItem* score = GameState()->m_history.GetScore(i);
|
||||||
|
|
||||||
|
m_scores[i] = scoreboxMaster->Clone();
|
||||||
|
|
||||||
MxS32 scoreX = 0x90;
|
MxS32 scoreX = 0x90;
|
||||||
if (scoreIndex >= 10) {
|
if (i >= 10) {
|
||||||
if (scoreIndex == 10) {
|
if (i == 10) {
|
||||||
scoreY = 0x79;
|
scoreY = 0x79;
|
||||||
}
|
}
|
||||||
|
|
||||||
scoreX = 0x158;
|
scoreX = 0x158;
|
||||||
}
|
}
|
||||||
|
|
||||||
MxS32 scoreboxX = 1;
|
for (MxS32 scoreState = 0, scoreboxX = 1; scoreState < 5; scoreState++, scoreboxX += 5) {
|
||||||
MxS32 scoreboxRow = 5;
|
|
||||||
MxS32 scoreState = 0;
|
|
||||||
|
|
||||||
for (; scoreboxRow > 0; scoreboxRow--) {
|
|
||||||
for (MxS32 scoreBoxColumn = 0, scoreboxY = 1; scoreBoxColumn < 5; scoreBoxColumn++, scoreboxY += 5) {
|
for (MxS32 scoreBoxColumn = 0, scoreboxY = 1; scoreBoxColumn < 5; scoreBoxColumn++, scoreboxY += 5) {
|
||||||
SetColor(*scorebox, score->m_scores[scoreState][scoreBoxColumn], scoreColors, scoreboxX, scoreboxY);
|
MxU8 color = score->m_scores[scoreState][scoreBoxColumn];
|
||||||
}
|
|
||||||
|
|
||||||
scoreState++;
|
if (color > 0) {
|
||||||
scoreboxX += 5;
|
for (MxS32 lax = 0; lax < 4; lax++) {
|
||||||
|
#ifdef BETA10
|
||||||
|
memset(m_scores[i]->GetBitmapStart(scoreboxX, scoreboxY + lax), scoreColors[color - 1], 4);
|
||||||
|
#else
|
||||||
|
if (m_scores[i]->GetAlphaMask() != NULL) {
|
||||||
|
memset(NULL, scoreColors[color - 1], 4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
memset(
|
||||||
|
m_scores[i]->GetBitmap()->GetStart(scoreboxX, lax + scoreboxY),
|
||||||
|
scoreColors[color - 1],
|
||||||
|
4
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(*scorebox)->Enable(TRUE);
|
m_scores[i]->Enable(TRUE);
|
||||||
(*scorebox)->SetTickleState(MxPresenter::e_repeating);
|
m_scores[i]->SetTickleState(MxPresenter::e_repeating);
|
||||||
(*scorebox)->SetPosition(scoreX + 0xa1, scoreY);
|
m_scores[i]->SetPosition(scoreX + 0xa1, scoreY);
|
||||||
|
|
||||||
for (MxS16 letterIndex = 0; letterIndex < (MxS16) sizeOfArray(m_names[0]);) {
|
#ifdef BETA10
|
||||||
MxS16 letter = score->m_name.m_letters[letterIndex];
|
for (MxS16 j = 0; score->m_name.m_letters[j] != -1; j++, scoreX += 0x17)
|
||||||
|
#else
|
||||||
|
for (MxS16 j = 0; j < (MxS16) sizeOfArray(m_name[0]) && score->m_name.m_letters[j] != -1; j++, scoreX += 0x17)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
m_name[i][j] = m_alphabet[score->m_name.m_letters[j]]->Clone();
|
||||||
|
|
||||||
if (letter == -1) {
|
assert(m_name[i][j]);
|
||||||
break;
|
m_name[i][j]->Enable(TRUE);
|
||||||
}
|
m_name[i][j]->SetTickleState(MxPresenter::e_repeating);
|
||||||
|
m_name[i][j]->SetPosition(scoreX, scoreY);
|
||||||
MxS16 nameIndex = letterIndex++;
|
|
||||||
m_names[scoreIndex][nameIndex] = m_alphabet[letter]->Clone();
|
|
||||||
m_names[scoreIndex][nameIndex]->Enable(TRUE);
|
|
||||||
m_names[scoreIndex][nameIndex]->SetTickleState(MxPresenter::e_repeating);
|
|
||||||
m_names[scoreIndex][nameIndex]->SetPosition(scoreX, scoreY);
|
|
||||||
scoreX += 0x17;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scoreY += 0x1b;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef BETA10
|
||||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10082a10
|
// FUNCTION: LEGO1 0x10082a10
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
DECOMP_SIZE_ASSERT(RegistrationBook, 0x2d0)
|
DECOMP_SIZE_ASSERT(RegistrationBook, 0x2d0)
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100d9924
|
// GLOBAL: LEGO1 0x100d9924
|
||||||
|
// GLOBAL: BETA10 0x101bfb3c
|
||||||
const char* g_infoman = "infoman";
|
const char* g_infoman = "infoman";
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f7964
|
// GLOBAL: LEGO1 0x100f7964
|
||||||
|
@ -265,6 +266,7 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100775c0
|
// FUNCTION: LEGO1 0x100775c0
|
||||||
|
// STUB: BETA10 0x100f32b2
|
||||||
void RegistrationBook::FUN_100775c0(MxS16 p_playerIndex)
|
void RegistrationBook::FUN_100775c0(MxS16 p_playerIndex)
|
||||||
{
|
{
|
||||||
if (m_infocenterState->HasRegistered()) {
|
if (m_infocenterState->HasRegistered()) {
|
||||||
|
@ -385,27 +387,41 @@ void RegistrationBook::FUN_100778c0()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10077cc0
|
// FUNCTION: LEGO1 0x10077cc0
|
||||||
|
// FUNCTION: BETA10 0x100f3671
|
||||||
void RegistrationBook::ReadyWorld()
|
void RegistrationBook::ReadyWorld()
|
||||||
{
|
{
|
||||||
|
// This function is very fragile and appears to oscillate between two versions on small changes.
|
||||||
|
// This even happens for commenting out `assert()` calls, which shouldn't affect release builds at all.
|
||||||
|
// See https://github.com/isledecomp/isle/pull/1375 for a version that had 100 %.
|
||||||
|
|
||||||
|
#ifndef BETA10
|
||||||
LegoGameState* gameState = GameState();
|
LegoGameState* gameState = GameState();
|
||||||
gameState->GetHistory()->WriteScoreHistory();
|
gameState->m_history.WriteScoreHistory();
|
||||||
MxS16 i;
|
#endif
|
||||||
|
|
||||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||||
|
|
||||||
char letterBuffer[] = "A_Bitmap";
|
char letterBuffer[] = "A_Bitmap";
|
||||||
for (i = 0; i < 26; i++) {
|
MxS16 i;
|
||||||
m_alphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", letterBuffer);
|
|
||||||
|
|
||||||
// We need to loop through the entire alphabet,
|
for (i = 0; i < 26; i++) {
|
||||||
// so increment the first char of the bitmap name
|
// TODO: This might be an inline function.
|
||||||
letterBuffer[0]++;
|
// See also `HistoryBook::ReadyWorld()`.
|
||||||
|
if (i < 26) {
|
||||||
|
m_alphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", letterBuffer);
|
||||||
|
assert(m_alphabet[i]);
|
||||||
|
|
||||||
|
// We need to loop through the entire alphabet,
|
||||||
|
// so increment the first char of the bitmap name
|
||||||
|
letterBuffer[0]++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we have to do the checkmarks
|
// Now we have to do the checkmarks
|
||||||
char checkmarkBuffer[] = "Check0_Ctl";
|
char checkmarkBuffer[] = "Check0_Ctl";
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
m_checkmark[i] = (MxControlPresenter*) Find("MxControlPresenter", checkmarkBuffer);
|
m_checkmark[i] = (MxControlPresenter*) Find("MxControlPresenter", checkmarkBuffer);
|
||||||
|
assert(m_checkmark[i]);
|
||||||
|
|
||||||
// Just like in the prior letter loop,
|
// Just like in the prior letter loop,
|
||||||
// we need to increment the fifth char
|
// we need to increment the fifth char
|
||||||
|
@ -425,6 +441,7 @@ void RegistrationBook::ReadyWorld()
|
||||||
// Start building the player names using a two-dimensional array
|
// Start building the player names using a two-dimensional array
|
||||||
m_name[i][j] = m_alphabet[players[i - 1].m_letters[j]]->Clone();
|
m_name[i][j] = m_alphabet[players[i - 1].m_letters[j]]->Clone();
|
||||||
|
|
||||||
|
assert(m_name[i][j]);
|
||||||
// Enable the presenter to actually show the letter in the grid
|
// Enable the presenter to actually show the letter in the grid
|
||||||
m_name[i][j]->Enable(TRUE);
|
m_name[i][j]->Enable(TRUE);
|
||||||
|
|
||||||
|
@ -434,7 +451,15 @@ void RegistrationBook::ReadyWorld()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_infocenterState->HasRegistered()) {
|
#ifdef BETA10
|
||||||
|
InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
|
||||||
|
assert(infocenterState);
|
||||||
|
|
||||||
|
if (infocenterState->HasRegistered())
|
||||||
|
#else
|
||||||
|
if (m_infocenterState->HasRegistered())
|
||||||
|
#endif
|
||||||
|
{
|
||||||
PlayAction(RegbookScript::c_iic008in_PlayWav);
|
PlayAction(RegbookScript::c_iic008in_PlayWav);
|
||||||
|
|
||||||
LegoROI* infoman = FindROI(g_infoman);
|
LegoROI* infoman = FindROI(g_infoman);
|
||||||
|
@ -447,6 +472,7 @@ void RegistrationBook::ReadyWorld()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x100f3424
|
||||||
inline void RegistrationBook::PlayAction(MxU32 p_objectId)
|
inline void RegistrationBook::PlayAction(MxU32 p_objectId)
|
||||||
{
|
{
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
|
|
|
@ -702,6 +702,9 @@
|
||||||
// LIBRARY: BETA10 0x100f9420
|
// LIBRARY: BETA10 0x100f9420
|
||||||
// memcpy
|
// memcpy
|
||||||
|
|
||||||
|
// LIBRARY: BETA10 0x100faa00
|
||||||
|
// memcmp
|
||||||
|
|
||||||
// LIBRARY: BETA10 0x100fb080
|
// LIBRARY: BETA10 0x100fb080
|
||||||
// _stricmp
|
// _stricmp
|
||||||
|
|
||||||
|
|
|
@ -148,9 +148,10 @@ private:
|
||||||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::erase
|
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::erase
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
// TEMPLATE: BETA10 0x10131460
|
// TEMPLATE: BETA10 0x10131460
|
||||||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
|
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::size
|
||||||
// >::size
|
// clang-format on
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// TEMPLATE: LEGO1 0x100afc40
|
// TEMPLATE: LEGO1 0x100afc40
|
||||||
|
@ -176,9 +177,10 @@ private:
|
||||||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Nil
|
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Nil
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
// TEMPLATE: BETA10 0x10132170
|
// TEMPLATE: BETA10 0x10132170
|
||||||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
|
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::begin
|
||||||
// >::begin
|
// clang-format on
|
||||||
|
|
||||||
// TEMPLATE: BETA10 0x101321d0
|
// TEMPLATE: BETA10 0x101321d0
|
||||||
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::size
|
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::size
|
||||||
|
|
|
@ -104,9 +104,9 @@ public:
|
||||||
// MxPtrListCursor<MxPresenter>::MxPtrListCursor<MxPresenter>
|
// MxPtrListCursor<MxPresenter>::MxPtrListCursor<MxPresenter>
|
||||||
|
|
||||||
// TEMPLATE: BETA10 0x1007d270
|
// TEMPLATE: BETA10 0x1007d270
|
||||||
// MxListCursor<MxPresenter>::MxListCursor<MxPresenter>
|
// MxListCursor<MxPresenter *>::MxListCursor<MxPresenter *>
|
||||||
|
|
||||||
// TEMPLATE: BETA10 0x100d9420
|
// TEMPLATE: BETA10 0x100d9420
|
||||||
// MxListCursor<MxPresenter>::Prev
|
// MxListCursor<MxPresenter *>::Prev
|
||||||
|
|
||||||
#endif // MXPRESENTERLIST_H
|
#endif // MXPRESENTERLIST_H
|
||||||
|
|
|
@ -104,6 +104,9 @@ public:
|
||||||
MxBitmap* GetBitmap() { return m_frameBitmap; }
|
MxBitmap* GetBitmap() { return m_frameBitmap; }
|
||||||
AlphaMask* GetAlphaMask() { return m_alpha; }
|
AlphaMask* GetAlphaMask() { return m_alpha; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x1002c2e0
|
||||||
|
MxU8* GetBitmapStart(MxS32 p_left, MxS32 p_top) { return m_frameBitmap->GetStart(p_left, p_top); }
|
||||||
|
|
||||||
void SetBit0(BOOL p_e) { m_flags.m_bit0 = p_e; }
|
void SetBit0(BOOL p_e) { m_flags.m_bit0 = p_e; }
|
||||||
void SetBit1(BOOL p_e) { m_flags.m_bit1 = p_e; }
|
void SetBit1(BOOL p_e) { m_flags.m_bit1 = p_e; }
|
||||||
void SetBit2(BOOL p_e) { m_flags.m_bit2 = p_e; }
|
void SetBit2(BOOL p_e) { m_flags.m_bit2 = p_e; }
|
||||||
|
|
|
@ -172,10 +172,12 @@ private:
|
||||||
|
|
||||||
// TEMPLATE: BETA10 0x1017ab10
|
// TEMPLATE: BETA10 0x1017ab10
|
||||||
// map<char const *,ViewLODList *,ROINameComparator,allocator<ViewLODList *> >::erase
|
// map<char const *,ViewLODList *,ROINameComparator,allocator<ViewLODList *> >::erase
|
||||||
|
// No symbol generated for this?
|
||||||
// Two iterators
|
// Two iterators
|
||||||
|
|
||||||
// TEMPLATE: BETA10 0x1017a040
|
// TEMPLATE: BETA10 0x1017a040
|
||||||
// map<char const *,ViewLODList *,ROINameComparator,allocator<ViewLODList *> >::erase
|
// ?erase@?$map@PBDPAVViewLODList@@UROINameComparator@@V?$allocator@PAVViewLODList@@@@@@QAE?AViterator@?$_Tree@PBDU?$pair@QBDPAVViewLODList@@@@U_Kfn@?$map@PBDPAVViewLODList@@UROINameComparator@@V?$allocator@PAVViewLODList@@@@@@UROINameComparator@@V?$allocato
|
||||||
|
// aka map<char const *,ViewLODList *,ROINameComparator,allocator<ViewLODList *> >::erase
|
||||||
// One iterator
|
// One iterator
|
||||||
|
|
||||||
// TEMPLATE: BETA10 0x10178f80
|
// TEMPLATE: BETA10 0x10178f80
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
targets:
|
|
||||||
ISLE:
|
|
||||||
filename: ISLE.EXE
|
|
||||||
source-root: .
|
|
||||||
hash:
|
|
||||||
sha256: 5cf57c284973fce9d14f5677a2e4435fd989c5e938970764d00c8932ed5128ca
|
|
||||||
LEGO1:
|
|
||||||
filename: LEGO1.DLL
|
|
||||||
source-root: LEGO1
|
|
||||||
hash:
|
|
||||||
sha256: 14645225bbe81212e9bc1919cd8a692b81b8622abb6561280d99b0fc4151ce17
|
|
||||||
CONFIG:
|
|
||||||
filename: CONFIG.EXE
|
|
||||||
source-root: .
|
|
||||||
hash:
|
|
||||||
sha256: 864766d024d78330fed5e1f6efb2faf815f1b1c3405713a9718059dc9a54e52c
|
|
||||||
BETA10:
|
|
||||||
filename: BETA10.DLL
|
|
||||||
source-root: LEGO1
|
|
||||||
hash:
|
|
||||||
sha256: d91435a40fa31f405fba33b03bd3bd40dcd4ca36ccf8ef6162c6c5ca0d7190e7
|
|
||||||
ghidra:
|
|
||||||
ignore-types:
|
|
||||||
# these classes have been changed by hand to account for changes between LEGO1 and BETA10
|
|
||||||
- Act2Actor
|
|
||||||
- Act2Brick
|
|
||||||
- LegoAct2
|
|
||||||
- LegoCarBuild
|
|
||||||
- LegoCarBuildAnimPresenter
|
|
||||||
- LegoRace
|
|
||||||
- LegoWorld
|
|
||||||
ignore-functions:
|
|
||||||
# strcpy, strlen, ... (arguments are imported incorrectly)
|
|
||||||
- 0x100f8ad0
|
|
||||||
- 0x100fa200
|
|
||||||
- 0x100f9780
|
|
Loading…
Add table
Add a link
Reference in a new issue