Implement LegoCarBuild functions, refactor BackgroundAudioManager (#1117)

* Implement LegoCarBuild functions, refactor BackgroundAudioManager

* Refactor LegoVehicleBuildState::m_animationState to enum

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz
2024-10-25 18:04:01 +02:00
committed by GitHub
parent b5fee6b240
commit c38e157fdb
17 changed files with 242 additions and 54 deletions

View File

@@ -16,6 +16,14 @@ class MxActionNotificationParam;
// SIZE 0x50
class LegoVehicleBuildState : public LegoState {
public:
enum AnimationState {
e_unknown0 = 0,
e_entering = 1,
e_unknown2 = 2,
e_cutscene = 3,
e_exiting = 6
};
LegoVehicleBuildState(const char* p_classType);
// FUNCTION: LEGO1 0x10025ff0
@@ -46,15 +54,11 @@ public:
// * LegoJetskiBuildState
MxString m_className; // 0x38
// Known States:
// * 1 == enter(ing) build screen
// * 3 == cutscene/dialogue
// * 6 == exit(ing) build screen
MxU32 m_animationState; // 0x48
undefined m_unk0x4c; // 0x4c
MxBool m_unk0x4d; // 0x4d
MxBool m_unk0x4e; // 0x4e
MxU8 m_placedPartCount; // 0x4f
AnimationState m_animationState; // 0x48
undefined m_unk0x4c; // 0x4c
MxBool m_unk0x4d; // 0x4d
MxBool m_unk0x4e; // 0x4e
MxU8 m_placedPartCount; // 0x4f
};
typedef LegoVehicleBuildState LegoRaceCarBuildState;
@@ -114,7 +118,7 @@ public:
undefined4 FUN_100246e0(MxLong p_x, MxLong p_y);
MxS32 FUN_10024850(MxLong p_x, MxLong p_y);
undefined4 FUN_10024890(LegoEventNotificationParam* p_param);
void FUN_10024c20(LegoEventNotificationParam* p_param);
undefined4 FUN_10024c20(LegoEventNotificationParam* p_param);
void FUN_10024ef0();
void FUN_10024f50();
void FUN_10024f70(MxBool p_enabled);
@@ -198,7 +202,7 @@ private:
// variable name verified by BETA10 0x1006cba7
LegoGameState::Area m_destLocation; // 0x334
undefined4 m_unk0x338; // 0x338
MxPresenter* m_unk0x338; // 0x338
MxControlPresenter* m_unk0x33c; // 0x33c
undefined4 m_unk0x340; // 0x340
undefined4 m_unk0x344; // 0x344

View File

@@ -75,7 +75,8 @@ public:
void FUN_10079a90();
MxBool StringEqualsPlatform(const LegoChar* p_string);
MxBool StringEqualsShelf(const LegoChar* p_string);
MxBool FUN_10079cf0(const LegoChar* p_string);
MxBool StringEndsOnY(const LegoChar* p_string);
MxBool StringEndsOnZero(const LegoChar* p_string);
// FUNCTION: BETA10 0x10070180
void SetUnknown0xbc(undefined2 p_unk0xbc) { m_unk0xbc = p_unk0xbc; }
@@ -117,6 +118,8 @@ private:
// name verified by BETA10 0x10070d63
LegoChar* m_mainSourceId; // 0x14c
friend class LegoCarBuild;
};
#endif // LEGOCARBUILDPRESENTER_H

View File

@@ -134,7 +134,10 @@ public:
LegoPlantManager* GetPlantManager() { return m_plantManager; }
LegoAnimationManager* GetAnimationManager() { return m_animationManager; }
LegoBuildingManager* GetBuildingManager() { return m_buildingManager; }
// FUNCTION: BETA10 0x100e52b0
LegoGameState* GetGameState() { return m_gameState; }
MxBackgroundAudioManager* GetBackgroundAudioManager() { return m_bkgAudioManager; }
MxTransitionManager* GetTransitionManager() { return m_transitionManager; }
MxDSAction& GetCurrentAction() { return m_action; }

View File

@@ -3,6 +3,7 @@
#include "mxcore.h"
#include "mxdsaction.h"
#include "mxpresenter.h"
#include "mxtypes.h"
class MxAudioPresenter;
@@ -34,7 +35,7 @@ public:
void StartAction(MxParam& p_param);
void StopAction(MxParam& p_param);
MxResult PlayMusic(MxDSAction& p_action, undefined4 p_unk0x140, undefined4 p_unk0x13c);
MxResult PlayMusic(MxDSAction& p_action, undefined4 p_unk0x140, MxPresenter::TickleState p_tickleState);
void FUN_1007ee70();
void FUN_1007ef40();
@@ -47,6 +48,7 @@ public:
void Stop();
void LowerVolume();
void RaiseVolume();
undefined4 FUN_1007f610(MxPresenter* p_unk0x138, MxS32 p_unk0x140, MxPresenter::TickleState p_tickleState);
// SYNTHETIC: LEGO1 0x1007ec00
// MxBackgroundAudioManager::`scalar deleting destructor'
@@ -60,11 +62,14 @@ private:
MxAudioPresenter* m_unk0xa0; // 0xa0
MxDSAction m_action2; // 0xa4
MxAudioPresenter* m_unk0x138; // 0x138
MxS32 m_unk0x13c; // 0x13c
MxS32 m_unk0x140; // 0x140
MxS32 m_targetVolume; // 0x144
MxS16 m_unk0x148; // 0x148
MxAtomId m_script; // 0x14c
// name is inferred from context
MxPresenter::TickleState m_tickleState; // 0x13c
MxS32 m_unk0x140; // 0x140
MxS32 m_targetVolume; // 0x144
MxS16 m_unk0x148; // 0x148
MxAtomId m_script; // 0x14c
};
#endif // MXBACKGROUNDAUDIOMANAGER_H