mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-04-27 14:53:47 -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))
|
||||
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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -41,8 +41,11 @@ public:
|
|||
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
|
||||
|
|
|
@ -40,7 +40,10 @@ public:
|
|||
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]; }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -96,8 +96,12 @@ protected:
|
|||
// 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
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "mxwavepresenter.h"
|
||||
|
||||
// VTABLE: LEGO1 0x100d4718
|
||||
// VTABLE: BETA10 0x101bb6f0
|
||||
// SIZE 0x88
|
||||
class LegoCacheSound : public MxCore {
|
||||
public:
|
||||
|
@ -50,12 +51,13 @@ public:
|
|||
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;
|
||||
|
|
|
@ -164,7 +164,9 @@ public:
|
|||
// 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
|
||||
|
@ -198,6 +200,7 @@ public:
|
|||
void SwitchArea(Area p_area);
|
||||
void Init();
|
||||
|
||||
// FUNCTION: BETA10 0x10083ff5
|
||||
MxU8 GetActorId() { return m_actorId; }
|
||||
|
||||
// FUNCTION: BETA10 0x1004a2d0
|
||||
|
@ -207,7 +210,6 @@ public:
|
|||
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; }
|
||||
|
|
|
@ -172,7 +172,9 @@ public:
|
|||
// 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; }
|
||||
|
|
|
@ -82,6 +82,8 @@ public:
|
|||
|
||||
virtual void FUN_100136f0(float p_worldSpeed);
|
||||
|
||||
static void InitSoundIndices();
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10013e30
|
||||
// LegoJetski::`scalar deleting destructor'
|
||||
};
|
||||
|
@ -146,8 +148,7 @@ public:
|
|||
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'
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
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'
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -71,6 +71,7 @@ MxLong IslePathActor::Notify(MxParam& p_param)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001a350
|
||||
// FUNCTION: BETA10 0x100365ad
|
||||
void IslePathActor::Enter()
|
||||
{
|
||||
m_roi->SetVisibility(FALSE);
|
||||
|
|
|
@ -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
|
||||
|
@ -79,6 +82,7 @@ void Jetski::Exit()
|
|||
// FUNCTION: BETA10 0x10037621
|
||||
MxLong Jetski::HandleClick()
|
||||
{
|
||||
#ifndef BETA10
|
||||
if (!FUN_1003ef60()) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -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);
|
||||
|
|
|
@ -9,18 +9,21 @@
|
|||
DECOMP_SIZE_ASSERT(LegoCacheSound, 0x88)
|
||||
|
||||
// FUNCTION: LEGO1 0x100064d0
|
||||
// FUNCTION: BETA10 0x10066340
|
||||
LegoCacheSound::LegoCacheSound()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10006630
|
||||
// FUNCTION: BETA10 0x100663f3
|
||||
LegoCacheSound::~LegoCacheSound()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100066d0
|
||||
// FUNCTION: BETA10 0x10066498
|
||||
void LegoCacheSound::Init()
|
||||
{
|
||||
SDL_zero(m_buffer);
|
||||
|
@ -28,10 +31,10 @@ void LegoCacheSound::Init()
|
|||
m_data = NULL;
|
||||
m_unk0x58 = FALSE;
|
||||
memset(&m_wfx, 0, sizeof(m_wfx));
|
||||
m_unk0x6a = FALSE;
|
||||
m_unk0x70 = FALSE;
|
||||
m_looping = TRUE;
|
||||
m_unk0x6a = FALSE;
|
||||
m_volume = 79;
|
||||
m_unk0x70 = FALSE;
|
||||
m_muted = FALSE;
|
||||
}
|
||||
|
||||
|
@ -83,7 +86,7 @@ MxResult LegoCacheSound::Create(
|
|||
return FAILURE;
|
||||
}
|
||||
|
||||
m_unk0x48 = FUN_10006d80(p_mediaSrcPath);
|
||||
m_unk0x48 = GetBaseFilename(p_mediaSrcPath);
|
||||
m_wfx = p_pwfx;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
@ -92,6 +95,9 @@ MxResult LegoCacheSound::Create(
|
|||
// FUNCTION: BETA10 0x100667a0
|
||||
void LegoCacheSound::CopyData(MxU8* p_data, MxU32 p_dataSize)
|
||||
{
|
||||
assert(p_data);
|
||||
assert(p_dataSize);
|
||||
|
||||
delete[] m_data;
|
||||
m_dataSize = p_dataSize;
|
||||
m_data = new MxU8[m_dataSize];
|
||||
|
@ -99,6 +105,7 @@ void LegoCacheSound::CopyData(MxU8* p_data, MxU32 p_dataSize)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10006920
|
||||
// FUNCTION: BETA10 0x1006685b
|
||||
void LegoCacheSound::Destroy()
|
||||
{
|
||||
ma_sound_uninit(&m_cacheSound);
|
||||
|
@ -113,13 +120,16 @@ void LegoCacheSound::Destroy()
|
|||
LegoCacheSound* LegoCacheSound::Clone()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
delete pnew;
|
||||
return NULL;
|
||||
else {
|
||||
delete pnew;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10006a30
|
||||
|
@ -160,6 +170,7 @@ MxResult LegoCacheSound::Play(const char* p_name, MxBool p_looping)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10006b80
|
||||
// FUNCTION: BETA10 0x10066ca3
|
||||
void LegoCacheSound::Stop()
|
||||
{
|
||||
ma_sound_stop(&m_cacheSound);
|
||||
|
@ -174,6 +185,7 @@ void LegoCacheSound::Stop()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10006be0
|
||||
// FUNCTION: BETA10 0x10066d23
|
||||
void LegoCacheSound::FUN_10006be0()
|
||||
{
|
||||
if (!m_looping) {
|
||||
|
@ -197,14 +209,16 @@ void LegoCacheSound::FUN_10006be0()
|
|||
}
|
||||
}
|
||||
|
||||
if (m_unk0x74.GetLength() != 0 && !m_muted) {
|
||||
if (!m_sound.UpdatePosition(&m_cacheSound)) {
|
||||
if (m_unk0x6a) {
|
||||
return;
|
||||
}
|
||||
if (m_unk0x74.GetLength() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ma_sound_stop(&m_cacheSound);
|
||||
m_unk0x6a = TRUE;
|
||||
if (!m_muted) {
|
||||
if (!m_sound.UpdatePosition(&m_cacheSound)) {
|
||||
if (!m_unk0x6a) {
|
||||
ma_sound_stop(&m_cacheSound);
|
||||
m_unk0x6a = TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_unk0x6a) {
|
||||
ma_sound_start(&m_cacheSound);
|
||||
|
@ -214,12 +228,14 @@ void LegoCacheSound::FUN_10006be0()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10006cb0
|
||||
// FUNCTION: BETA10 0x10066e85
|
||||
void LegoCacheSound::SetDistance(MxS32 p_min, MxS32 p_max)
|
||||
{
|
||||
m_sound.SetDistance(p_min, p_max);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10006cd0
|
||||
// FUNCTION: BETA10 0x10066eb0
|
||||
void LegoCacheSound::FUN_10006cd0(undefined4, undefined4)
|
||||
{
|
||||
}
|
||||
|
@ -258,33 +274,33 @@ void LegoCacheSound::MuteStop(MxBool p_muted)
|
|||
|
||||
// FUNCTION: LEGO1 0x10006d80
|
||||
// FUNCTION: BETA10 0x100670e7
|
||||
MxString LegoCacheSound::FUN_10006d80(const MxString& p_str)
|
||||
MxString LegoCacheSound::GetBaseFilename(MxString& p_path)
|
||||
{
|
||||
// TODO: Clean up code
|
||||
char* str = p_str.GetData();
|
||||
MxU32 length = strlen(str);
|
||||
// Get the base filename from the given path
|
||||
// e.g. "Z:\Lego\Audio\test.wav" --> "test"
|
||||
char* str = p_path.GetData();
|
||||
|
||||
char* local28 = str + length;
|
||||
char* local14 = local28;
|
||||
char* pVar1 = local28;
|
||||
// Start at the end of the string and work backwards.
|
||||
char* p = str + strlen(str);
|
||||
char* end = p;
|
||||
|
||||
do {
|
||||
local14 = pVar1;
|
||||
pVar1 = local14 + -1;
|
||||
while (str != p--) {
|
||||
// If the file has an extension, we want to exclude it from the output.
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (*pVar1 == '.') {
|
||||
local28 = pVar1;
|
||||
}
|
||||
} while (*pVar1 != '\\');
|
||||
|
||||
local14 = pVar1;
|
||||
|
||||
MxString local24;
|
||||
local14++;
|
||||
*local28 = '\0';
|
||||
return local24 = local14;
|
||||
MxString output;
|
||||
// Increment by one to shift p to the start of the filename.
|
||||
char* x = ++p;
|
||||
// If end points to the dot in filename, change it to a null terminator.
|
||||
x[end - p] = '\0';
|
||||
return output = x;
|
||||
}
|
||||
|
|
|
@ -212,8 +212,11 @@ MxTransitionManager* TransitionManager()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10015910
|
||||
// FUNCTION: BETA10 0x100e4f4c
|
||||
void PlayMusic(JukeboxScript::Script p_objectId)
|
||||
{
|
||||
assert(LegoOmni::GetInstance());
|
||||
|
||||
MxDSAction action;
|
||||
action.SetAtomId(*g_jukeboxScript);
|
||||
action.SetObjectId(p_objectId);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
DECOMP_SIZE_ASSERT(LegoControlManager, 0x60)
|
||||
DECOMP_SIZE_ASSERT(LegoControlManagerNotificationParam, 0x2c)
|
||||
DECOMP_SIZE_ASSERT(LegoEventNotificationParam, 0x20)
|
||||
|
||||
// FUNCTION: LEGO1 0x10028520
|
||||
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_unk0x14c = -1;
|
||||
|
||||
LegoRaceCar::FUN_10012e00();
|
||||
LegoRaceCar::InitSoundIndices();
|
||||
|
||||
MxS32 streamId =
|
||||
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.SetRight(543);
|
||||
m_unk0x130.SetBottom(333);
|
||||
LegoRaceCar::FUN_10013670();
|
||||
LegoJetski::InitSoundIndices();
|
||||
InvokeAction(
|
||||
Extra::e_start,
|
||||
m_atomId,
|
||||
|
|
|
@ -13,6 +13,7 @@ DECOMP_SIZE_ASSERT(LegoRaceActor, 0x180)
|
|||
|
||||
// Initialized at LEGO1 0x100145a0
|
||||
// GLOBAL: LEGO1 0x10102b08
|
||||
// GLOBAL: BETA10 0x102114a8
|
||||
Mx3DPointFloat LegoRaceActor::g_unk0x10102b08 = Mx3DPointFloat(0.0, 2.0, 0.0);
|
||||
|
||||
// FUNCTION: LEGO1 0x100145d0
|
||||
|
@ -101,9 +102,9 @@ MxResult LegoRaceActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||
}
|
||||
|
||||
if (p_bool) {
|
||||
MxMatrix matr;
|
||||
LegoROI* roi = p_actor->GetROI(); // name verified by BETA10 0x100c9fcf
|
||||
assert(roi);
|
||||
MxMatrix matr;
|
||||
matr = roi->GetLocal2World();
|
||||
|
||||
Vector3(matr[3]) += g_unk0x10102b08;
|
||||
|
|
|
@ -29,7 +29,7 @@ DECOMP_SIZE_ASSERT(LegoJetski, 0x1dc)
|
|||
|
||||
// name verified by BETA10 0x100cbee6
|
||||
// GLOBAL: LEGO1 0x100f0a20
|
||||
// GLOBAL: BETA10 0x101f5e34
|
||||
// GLOBAL: BETA10 0x101f5e30
|
||||
EdgeReference g_skBMap[] = {
|
||||
{// STRING: LEGO1 0x100f0a10
|
||||
"EDG03_772",
|
||||
|
@ -83,7 +83,7 @@ const char* g_strJetSpeed = "jetSPEED";
|
|||
|
||||
// GLOBAL: LEGO1 0x100f0b18
|
||||
// GLOBAL: BETA10 0x101f5f28
|
||||
const char* g_srtsl18to29[] = {
|
||||
const char* g_playerHitStudsSounds[] = {
|
||||
"srt018sl",
|
||||
"srt019sl",
|
||||
"srt020sl",
|
||||
|
@ -100,19 +100,19 @@ const char* g_srtsl18to29[] = {
|
|||
|
||||
// GLOBAL: LEGO1 0x100f0b48
|
||||
// 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: BETA10 0x101f5f6c
|
||||
const char* g_emptySoundKeyList[] = {NULL};
|
||||
const char* g_playerHitRhodaSounds[] = {NULL};
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b60
|
||||
// GLOBAL: BETA10 0x101f5f70
|
||||
const char* g_srtrh[] = {"srt004rh", "srt005rh", "srt006rh"};
|
||||
const char* g_rhodaHitPlayerSounds[] = {"srt004rh", "srt005rh", "srt006rh"};
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b6c
|
||||
// STRING: LEGO1 0x100f08c4
|
||||
const char* g_srt001ra = "srt001ra";
|
||||
const char* g_youCantStopSound = "srt001ra";
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b70
|
||||
// STRING: LEGO1 0x100f08bc
|
||||
|
@ -120,31 +120,31 @@ const char* g_soundSkel3 = "skel3";
|
|||
|
||||
// GLOBAL: LEGO1 0x100f0b74
|
||||
// GLOBAL: BETA10 0x101f5f80
|
||||
MxU32 g_srtsl18to29Index = 0;
|
||||
MxU32 g_playerHitStudsSoundsIndex = 0;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b78
|
||||
// GLOBAL: BETA10 0x101f5f84
|
||||
MxU32 g_srtsl6to10Index = 0;
|
||||
MxU32 g_studsHitPlayerSoundsIndex = 0;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b7c
|
||||
// GLOBAL: BETA10 0x101f5f88
|
||||
MxU32 g_emptySoundKeyListIndex = 0;
|
||||
MxU32 g_playerHitRhodaSoundsIndex = 0;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b80
|
||||
// GLOBAL: BETA10 0x101f5f8c
|
||||
MxU32 g_srtrhIndex = 0;
|
||||
MxU32 g_rhodaHitPlayerSoundsIndex = 0;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b84
|
||||
// GLOBAL: BETA10 0x101f5f90
|
||||
MxLong g_timeLastSoundPlayed = 0;
|
||||
MxLong g_timeLastRaceCarSoundPlayed = 0;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b88
|
||||
// GLOBAL: BETA10 0x101f5f94
|
||||
MxS32 g_unk0x100f0b88 = 0;
|
||||
MxS32 g_timePlayerLastMoved = 0;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b8c
|
||||
// GLOBAL: BETA10 0x101f5f98
|
||||
MxBool g_unk0x100f0b8c = TRUE;
|
||||
MxBool g_playedYouCantStopSound = TRUE;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0b90
|
||||
const char* g_hitSnapSounds[] = {
|
||||
|
@ -168,9 +168,10 @@ undefined4 g_hitSnapSoundsIndex = 0;
|
|||
undefined4 g_hitValerieSoundsIndex = 0;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f0bb4
|
||||
MxLong g_unk0x100f0bb4 = 0;
|
||||
MxLong g_timeLastJetskiSoundPlayed = 0;
|
||||
|
||||
// FUNCTION: LEGO1 0x10012950
|
||||
// FUNCTION: BETA10 0x100cad10
|
||||
LegoRaceCar::LegoRaceCar()
|
||||
{
|
||||
m_userState = 0;
|
||||
|
@ -184,12 +185,14 @@ LegoRaceCar::LegoRaceCar()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10012c80
|
||||
// FUNCTION: BETA10 0x100caf67
|
||||
LegoRaceCar::~LegoRaceCar()
|
||||
{
|
||||
NotificationManager()->Unregister(this);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10012d90
|
||||
// FUNCTION: BETA10 0x100cb0bd
|
||||
MxLong LegoRaceCar::Notify(MxParam& p_param)
|
||||
{
|
||||
return LegoRaceMap::Notify(p_param);
|
||||
|
@ -203,21 +206,22 @@ Mx3DPointFloat g_unk0x10102af0 = Mx3DPointFloat(0.0f, 2.0f, 0.0f);
|
|||
// FUNCTION: LEGO1 0x10012de0
|
||||
void LegoRaceCar::FUN_10012de0()
|
||||
{
|
||||
g_unk0x100f0b8c = TRUE;
|
||||
g_timeLastSoundPlayed = 0;
|
||||
g_unk0x100f0b88 = 0;
|
||||
// Init to TRUE so we don't play "you can't stop in the middle of the race!" before the player ever moves
|
||||
g_playedYouCantStopSound = TRUE;
|
||||
g_timeLastRaceCarSoundPlayed = 0;
|
||||
g_timePlayerLastMoved = 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10012e00
|
||||
// FUNCTION: BETA10 0x100cb129
|
||||
void LegoRaceCar::FUN_10012e00()
|
||||
void LegoRaceCar::InitSoundIndices()
|
||||
{
|
||||
// Note the (likely unintentional) order of operations: `%` is executed before `/`,
|
||||
// so the division is performed at runtime.
|
||||
g_srtsl18to29Index = rand() % sizeof(g_srtsl18to29) / sizeof(g_srtsl18to29[0]);
|
||||
g_srtsl6to10Index = rand() % sizeof(g_srtsl6to10) / sizeof(g_srtsl6to10[0]);
|
||||
g_emptySoundKeyListIndex = rand() % sizeof(g_emptySoundKeyList) / sizeof(g_emptySoundKeyList[0]);
|
||||
g_srtrhIndex = rand() % sizeof(g_srtrh) / sizeof(g_srtrh[0]);
|
||||
g_playerHitStudsSoundsIndex = rand() % sizeof(g_playerHitStudsSounds) / sizeof(g_playerHitStudsSounds[0]);
|
||||
g_studsHitPlayerSoundsIndex = rand() % sizeof(g_studsHitPlayerSounds) / sizeof(g_studsHitPlayerSounds[0]);
|
||||
g_playerHitRhodaSoundsIndex = rand() % sizeof(g_playerHitRhodaSounds) / sizeof(g_playerHitRhodaSounds[0]);
|
||||
g_rhodaHitPlayerSoundsIndex = rand() % sizeof(g_rhodaHitPlayerSounds) / sizeof(g_rhodaHitPlayerSounds[0]);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10012e60
|
||||
|
@ -267,27 +271,22 @@ void LegoRaceCar::ParseAction(char* p_extra)
|
|||
MxS32 i;
|
||||
|
||||
for (i = 0; i < m_animMaps.size(); i++) {
|
||||
// It appears that the implementation in BETA10 does not use this variable
|
||||
LegoAnimActorStruct* animMap = m_animMaps[i];
|
||||
|
||||
if (animMap->m_unk0x00 == -1.0f) {
|
||||
m_skelKick1Anim = animMap;
|
||||
if (m_animMaps[i]->GetUnknown0x00() == -1.0f) {
|
||||
m_skelKick1Anim = m_animMaps[i];
|
||||
}
|
||||
else if (animMap->m_unk0x00 == -2.0f) {
|
||||
m_skelKick2Anim = animMap;
|
||||
else if (m_animMaps[i]->GetUnknown0x00() == -2.0f) {
|
||||
m_skelKick2Anim = m_animMaps[i];
|
||||
}
|
||||
}
|
||||
|
||||
assert(m_skelKick1Anim && m_skelKick2Anim);
|
||||
|
||||
// STRING: LEGO1 0x100f0bc4
|
||||
const char* edge0344 = "EDG03_44";
|
||||
m_kick1B = currentWorld->FindPathBoundary(edge0344);
|
||||
m_kick1B = currentWorld->FindPathBoundary("EDG03_44");
|
||||
assert(m_kick1B);
|
||||
|
||||
// STRING: LEGO1 0x100f0bb8
|
||||
const char* edge0354 = "EDG03_54";
|
||||
m_kick2B = currentWorld->FindPathBoundary(edge0354);
|
||||
m_kick2B = currentWorld->FindPathBoundary("EDG03_54");
|
||||
assert(m_kick2B);
|
||||
|
||||
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) {
|
||||
g_unk0x100f0b88 = p_time;
|
||||
g_unk0x100f0b8c = FALSE;
|
||||
g_timePlayerLastMoved = p_time;
|
||||
g_playedYouCantStopSound = FALSE;
|
||||
}
|
||||
|
||||
if (p_time - g_unk0x100f0b88 > 5000.0f && !g_unk0x100f0b8c) {
|
||||
SoundManager()->GetCacheSoundManager()->Play(g_srt001ra, NULL, 0);
|
||||
g_unk0x100f0b8c = TRUE;
|
||||
// If the player hasn't moved in 5 seconds, play the "you can't stop in the middle of the race!" sound once
|
||||
if (p_time - g_timePlayerLastMoved > 5000.0f && !g_playedYouCantStopSound) {
|
||||
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) {
|
||||
MxMatrix matr;
|
||||
LegoROI* roi = p_actor->GetROI(); // name verified by BETA10 0x100cbbf5
|
||||
assert(roi);
|
||||
MxMatrix matr;
|
||||
matr = roi->GetLocal2World();
|
||||
|
||||
Vector3(matr[3]) += g_unk0x10102af0;
|
||||
|
@ -482,41 +483,40 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||
MxLong time = Timer()->GetTime();
|
||||
|
||||
const char* soundKey = NULL;
|
||||
MxLong timeElapsed = time - g_timeLastSoundPlayed;
|
||||
|
||||
if (timeElapsed > 3000) {
|
||||
if (time - g_timeLastRaceCarSoundPlayed > 3000) {
|
||||
if (p_bool) {
|
||||
if (actorIsStuds) {
|
||||
soundKey = g_srtsl18to29[g_srtsl18to29Index++];
|
||||
if (g_srtsl18to29Index >= sizeOfArray(g_srtsl18to29)) {
|
||||
g_srtsl18to29Index = 0;
|
||||
soundKey = g_playerHitStudsSounds[g_playerHitStudsSoundsIndex++];
|
||||
if (g_playerHitStudsSoundsIndex >= sizeOfArray(g_playerHitStudsSounds)) {
|
||||
g_playerHitStudsSoundsIndex = 0;
|
||||
}
|
||||
}
|
||||
else if (actorIsRhoda) {
|
||||
soundKey = g_emptySoundKeyList[g_emptySoundKeyListIndex++];
|
||||
if (g_emptySoundKeyListIndex >= sizeOfArray(g_emptySoundKeyList)) {
|
||||
g_emptySoundKeyListIndex = 0;
|
||||
soundKey = g_playerHitRhodaSounds[g_playerHitRhodaSoundsIndex++];
|
||||
if (g_playerHitRhodaSoundsIndex >= sizeOfArray(g_playerHitRhodaSounds)) {
|
||||
g_playerHitRhodaSoundsIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (actorIsStuds) {
|
||||
soundKey = g_srtsl6to10[g_srtsl6to10Index++];
|
||||
if (g_srtsl6to10Index >= sizeOfArray(g_srtsl6to10)) {
|
||||
g_srtsl6to10Index = 0;
|
||||
soundKey = g_studsHitPlayerSounds[g_studsHitPlayerSoundsIndex++];
|
||||
if (g_studsHitPlayerSoundsIndex >= sizeOfArray(g_studsHitPlayerSounds)) {
|
||||
g_studsHitPlayerSoundsIndex = 0;
|
||||
}
|
||||
}
|
||||
else if (actorIsRhoda) {
|
||||
soundKey = g_srtrh[g_srtrhIndex++];
|
||||
if (g_srtrhIndex >= sizeOfArray(g_srtrh)) {
|
||||
g_srtrhIndex = 0;
|
||||
soundKey = g_rhodaHitPlayerSounds[g_rhodaHitPlayerSoundsIndex++];
|
||||
if (g_rhodaHitPlayerSoundsIndex >= sizeOfArray(g_rhodaHitPlayerSounds)) {
|
||||
g_rhodaHitPlayerSoundsIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (soundKey) {
|
||||
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
|
||||
void LegoRaceCar::FUN_10013670()
|
||||
void LegoJetski::InitSoundIndices()
|
||||
{
|
||||
g_hitSnapSoundsIndex = (rand() & 0xc) >> 2;
|
||||
|
||||
// Inlining the `rand()` causes this function to mismatch
|
||||
MxU32 uVar1 = rand();
|
||||
g_hitValerieSoundsIndex = uVar1 % 0xc >> 2;
|
||||
// See note in LegoRaceCar::InitSoundIndices
|
||||
g_hitSnapSoundsIndex = rand() % sizeof(g_hitSnapSounds) / sizeof(g_hitSnapSounds[0]);
|
||||
g_hitValerieSoundsIndex = rand() % sizeof(g_hitValerieSounds) / sizeof(g_hitValerieSounds[0]);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100136a0
|
||||
|
@ -683,8 +681,8 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||
}
|
||||
|
||||
if (p_bool) {
|
||||
LegoROI* roi = p_actor->GetROI();
|
||||
MxMatrix matr;
|
||||
LegoROI* roi = p_actor->GetROI();
|
||||
matr = roi->GetLocal2World();
|
||||
|
||||
Vector3(matr[3]) += g_unk0x10102af0;
|
||||
|
@ -699,9 +697,8 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||
MxLong time = Timer()->GetTime();
|
||||
|
||||
const char* soundKey = NULL;
|
||||
MxLong timeElapsed = time - g_unk0x100f0bb4;
|
||||
|
||||
if (timeElapsed > 3000) {
|
||||
if (time - g_timeLastJetskiSoundPlayed > 3000) {
|
||||
if (actorIsSnap) {
|
||||
soundKey = g_hitSnapSounds[g_hitSnapSoundsIndex++];
|
||||
if (g_hitSnapSoundsIndex >= sizeOfArray(g_hitSnapSounds)) {
|
||||
|
@ -717,7 +714,7 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||
|
||||
if (soundKey) {
|
||||
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()
|
||||
{
|
||||
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));
|
||||
NotificationManager()->Register(this);
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ HistoryBook::~HistoryBook()
|
|||
m_scores[scoreIndex] = NULL;
|
||||
}
|
||||
|
||||
for (MxS16 letterIndex = 0; letterIndex < (MxS16) sizeOfArray(m_names[0]); letterIndex++) {
|
||||
if (m_names[scoreIndex][letterIndex]) {
|
||||
delete m_names[scoreIndex][letterIndex]->GetAction();
|
||||
delete m_names[scoreIndex][letterIndex];
|
||||
m_names[scoreIndex][letterIndex] = NULL;
|
||||
for (MxS16 letterIndex = 0; letterIndex < (MxS16) sizeOfArray(m_name[0]); letterIndex++) {
|
||||
if (m_name[scoreIndex][letterIndex]) {
|
||||
delete m_name[scoreIndex][letterIndex]->GetAction();
|
||||
delete m_name[scoreIndex][letterIndex];
|
||||
m_name[scoreIndex][letterIndex] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,88 +89,96 @@ MxLong HistoryBook::Notify(MxParam& p_param)
|
|||
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: BETA10 0x1002b9b9
|
||||
void HistoryBook::ReadyWorld()
|
||||
{
|
||||
undefined2 dummy1 = 0x90, dummy2 = 0x79, dummy3 = 0xc8, dummy4 = 0x17, dummy5 = 0x1b;
|
||||
#ifndef BETA10
|
||||
LegoWorld::ReadyWorld();
|
||||
GameState()->GetHistory()->WriteScoreHistory();
|
||||
#endif
|
||||
GameState()->m_history.WriteScoreHistory();
|
||||
|
||||
char bitmap[] = "A_Bitmap";
|
||||
for (MxS16 i = 0; i < 26; i++) {
|
||||
m_alphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", bitmap);
|
||||
bitmap[0]++;
|
||||
MxS16 i;
|
||||
|
||||
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");
|
||||
MxU8 scoreColors[3] =
|
||||
{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++) {
|
||||
LegoGameState::ScoreItem* score = GameState()->GetHistory()->GetScore(scoreIndex);
|
||||
MxS32 scoreY;
|
||||
|
||||
MxStillPresenter** scorebox = &m_scores[scoreIndex];
|
||||
*scorebox = scoreboxMaster->Clone();
|
||||
for (i = 0, scoreY = 0x79; i < GameState()->m_history.GetCount(); i++, scoreY += 0x1b) {
|
||||
LegoGameState::ScoreItem* score = GameState()->m_history.GetScore(i);
|
||||
|
||||
m_scores[i] = scoreboxMaster->Clone();
|
||||
|
||||
MxS32 scoreX = 0x90;
|
||||
if (scoreIndex >= 10) {
|
||||
if (scoreIndex == 10) {
|
||||
if (i >= 10) {
|
||||
if (i == 10) {
|
||||
scoreY = 0x79;
|
||||
}
|
||||
|
||||
scoreX = 0x158;
|
||||
}
|
||||
|
||||
MxS32 scoreboxX = 1;
|
||||
MxS32 scoreboxRow = 5;
|
||||
MxS32 scoreState = 0;
|
||||
|
||||
for (; scoreboxRow > 0; scoreboxRow--) {
|
||||
for (MxS32 scoreState = 0, scoreboxX = 1; scoreState < 5; scoreState++, scoreboxX += 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++;
|
||||
scoreboxX += 5;
|
||||
if (color > 0) {
|
||||
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);
|
||||
(*scorebox)->SetTickleState(MxPresenter::e_repeating);
|
||||
(*scorebox)->SetPosition(scoreX + 0xa1, scoreY);
|
||||
m_scores[i]->Enable(TRUE);
|
||||
m_scores[i]->SetTickleState(MxPresenter::e_repeating);
|
||||
m_scores[i]->SetPosition(scoreX + 0xa1, scoreY);
|
||||
|
||||
for (MxS16 letterIndex = 0; letterIndex < (MxS16) sizeOfArray(m_names[0]);) {
|
||||
MxS16 letter = score->m_name.m_letters[letterIndex];
|
||||
#ifdef BETA10
|
||||
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) {
|
||||
break;
|
||||
}
|
||||
|
||||
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;
|
||||
assert(m_name[i][j]);
|
||||
m_name[i][j]->Enable(TRUE);
|
||||
m_name[i][j]->SetTickleState(MxPresenter::e_repeating);
|
||||
m_name[i][j]->SetPosition(scoreX, scoreY);
|
||||
}
|
||||
|
||||
scoreY += 0x1b;
|
||||
}
|
||||
|
||||
#ifndef BETA10
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
#endif
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10082a10
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
DECOMP_SIZE_ASSERT(RegistrationBook, 0x2d0)
|
||||
|
||||
// GLOBAL: LEGO1 0x100d9924
|
||||
// GLOBAL: BETA10 0x101bfb3c
|
||||
const char* g_infoman = "infoman";
|
||||
|
||||
// GLOBAL: LEGO1 0x100f7964
|
||||
|
@ -265,6 +266,7 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100775c0
|
||||
// STUB: BETA10 0x100f32b2
|
||||
void RegistrationBook::FUN_100775c0(MxS16 p_playerIndex)
|
||||
{
|
||||
if (m_infocenterState->HasRegistered()) {
|
||||
|
@ -385,27 +387,41 @@ void RegistrationBook::FUN_100778c0()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10077cc0
|
||||
// FUNCTION: BETA10 0x100f3671
|
||||
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();
|
||||
gameState->GetHistory()->WriteScoreHistory();
|
||||
MxS16 i;
|
||||
gameState->m_history.WriteScoreHistory();
|
||||
#endif
|
||||
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
|
||||
char letterBuffer[] = "A_Bitmap";
|
||||
for (i = 0; i < 26; i++) {
|
||||
m_alphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", letterBuffer);
|
||||
MxS16 i;
|
||||
|
||||
// We need to loop through the entire alphabet,
|
||||
// so increment the first char of the bitmap name
|
||||
letterBuffer[0]++;
|
||||
for (i = 0; i < 26; i++) {
|
||||
// TODO: This might be an inline function.
|
||||
// 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
|
||||
char checkmarkBuffer[] = "Check0_Ctl";
|
||||
for (i = 0; i < 10; i++) {
|
||||
m_checkmark[i] = (MxControlPresenter*) Find("MxControlPresenter", checkmarkBuffer);
|
||||
assert(m_checkmark[i]);
|
||||
|
||||
// Just like in the prior letter loop,
|
||||
// we need to increment the fifth char
|
||||
|
@ -425,6 +441,7 @@ void RegistrationBook::ReadyWorld()
|
|||
// Start building the player names using a two-dimensional array
|
||||
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
|
||||
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);
|
||||
|
||||
LegoROI* infoman = FindROI(g_infoman);
|
||||
|
@ -447,6 +472,7 @@ void RegistrationBook::ReadyWorld()
|
|||
}
|
||||
}
|
||||
|
||||
// FUNCTION: BETA10 0x100f3424
|
||||
inline void RegistrationBook::PlayAction(MxU32 p_objectId)
|
||||
{
|
||||
MxDSAction action;
|
||||
|
|
|
@ -702,6 +702,9 @@
|
|||
// LIBRARY: BETA10 0x100f9420
|
||||
// memcpy
|
||||
|
||||
// LIBRARY: BETA10 0x100faa00
|
||||
// memcmp
|
||||
|
||||
// LIBRARY: BETA10 0x100fb080
|
||||
// _stricmp
|
||||
|
||||
|
|
|
@ -148,9 +148,10 @@ private:
|
|||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::erase
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
// TEMPLATE: BETA10 0x10131460
|
||||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
|
||||
// >::size
|
||||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::size
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
// TEMPLATE: LEGO1 0x100afc40
|
||||
|
@ -176,9 +177,10 @@ private:
|
|||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Nil
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
// TEMPLATE: BETA10 0x10132170
|
||||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
|
||||
// >::begin
|
||||
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::begin
|
||||
// clang-format on
|
||||
|
||||
// TEMPLATE: BETA10 0x101321d0
|
||||
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::size
|
||||
|
|
|
@ -104,9 +104,9 @@ public:
|
|||
// MxPtrListCursor<MxPresenter>::MxPtrListCursor<MxPresenter>
|
||||
|
||||
// TEMPLATE: BETA10 0x1007d270
|
||||
// MxListCursor<MxPresenter>::MxListCursor<MxPresenter>
|
||||
// MxListCursor<MxPresenter *>::MxListCursor<MxPresenter *>
|
||||
|
||||
// TEMPLATE: BETA10 0x100d9420
|
||||
// MxListCursor<MxPresenter>::Prev
|
||||
// MxListCursor<MxPresenter *>::Prev
|
||||
|
||||
#endif // MXPRESENTERLIST_H
|
||||
|
|
|
@ -104,6 +104,9 @@ public:
|
|||
MxBitmap* GetBitmap() { return m_frameBitmap; }
|
||||
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 SetBit1(BOOL p_e) { m_flags.m_bit1 = p_e; }
|
||||
void SetBit2(BOOL p_e) { m_flags.m_bit2 = p_e; }
|
||||
|
|
|
@ -172,10 +172,12 @@ private:
|
|||
|
||||
// TEMPLATE: BETA10 0x1017ab10
|
||||
// map<char const *,ViewLODList *,ROINameComparator,allocator<ViewLODList *> >::erase
|
||||
// No symbol generated for this?
|
||||
// Two iterators
|
||||
|
||||
// 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
|
||||
|
||||
// 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