2023-04-27 22:19:39 -04:00
|
|
|
#ifndef LEGOGAMESTATE_H
|
|
|
|
#define LEGOGAMESTATE_H
|
|
|
|
|
2023-09-29 16:38:08 -04:00
|
|
|
#include "decomp.h"
|
2024-01-24 12:12:57 -05:00
|
|
|
#include "lego/sources/misc/legostorage.h"
|
2023-09-29 16:38:08 -04:00
|
|
|
#include "legobackgroundcolor.h"
|
|
|
|
#include "legofullscreenmovie.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "mxtypes.h"
|
2024-01-24 12:12:57 -05:00
|
|
|
#include "mxvariabletable.h"
|
2023-07-02 04:05:49 -04:00
|
|
|
|
2023-10-12 12:18:24 -04:00
|
|
|
class LegoState;
|
|
|
|
class MxVariable;
|
|
|
|
class MxString;
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
struct ColorStringStruct {
|
|
|
|
const char* m_targetName;
|
|
|
|
const char* m_colorName;
|
2023-10-12 12:18:24 -04:00
|
|
|
};
|
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
// SIZE 0x430
|
2023-10-24 19:38:27 -04:00
|
|
|
class LegoGameState {
|
2023-04-27 22:19:39 -04:00
|
|
|
public:
|
2024-01-24 21:16:29 -05:00
|
|
|
LegoGameState();
|
|
|
|
~LegoGameState();
|
|
|
|
MxResult Load(MxULong);
|
|
|
|
MxResult Save(MxULong);
|
|
|
|
void SerializePlayersInfo(MxS16);
|
|
|
|
void SerializeScoreHistory(MxS16 p_flags);
|
|
|
|
void SetSavePath(char*);
|
2023-07-03 13:25:37 -04:00
|
|
|
|
2024-01-06 12:56:15 -05:00
|
|
|
LegoState* GetState(const char* p_stateName);
|
|
|
|
LegoState* CreateState(const char* p_stateName);
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
void GetFileSavePath(MxString* p_outPath, MxULong p_slotn);
|
2024-01-31 07:34:36 -05:00
|
|
|
void StopArea(MxU32 p_area = 0);
|
|
|
|
void SwitchArea(MxU32 p_area);
|
2023-10-23 07:16:21 -04:00
|
|
|
|
2024-01-29 16:17:17 -05:00
|
|
|
inline MxU8 GetUnknownC() { return m_unk0x0c; }
|
2023-12-13 05:48:14 -05:00
|
|
|
inline MxU32 GetUnknown10() { return m_unk0x10; }
|
2023-12-15 18:11:34 -05:00
|
|
|
inline MxS32 GetCurrentAct() { return m_currentAct; }
|
2024-01-31 07:34:36 -05:00
|
|
|
inline MxU32 GetCurrentArea() { return m_currentArea; }
|
2024-01-31 09:47:15 -05:00
|
|
|
inline MxU32 GetPreviousArea() { return m_previousArea; }
|
2024-01-31 07:34:36 -05:00
|
|
|
|
2023-12-15 18:11:34 -05:00
|
|
|
inline void SetDirty(MxBool p_dirty) { m_isDirty = p_dirty; }
|
2024-01-31 07:34:36 -05:00
|
|
|
inline void SetCurrentArea(MxU32 p_currentArea) { m_currentArea = p_currentArea; }
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2023-11-06 04:00:24 -05:00
|
|
|
void SetSomeEnumState(undefined4 p_state);
|
2023-12-15 17:01:09 -05:00
|
|
|
void FUN_1003ceb0();
|
2024-01-17 11:53:53 -05:00
|
|
|
void FUN_10039780(MxU8);
|
2023-12-15 17:01:09 -05:00
|
|
|
|
|
|
|
struct ScoreStruct {
|
|
|
|
void WriteScoreHistory();
|
2024-01-24 12:12:57 -05:00
|
|
|
void FUN_1003ccf0(LegoFile&);
|
2023-12-15 17:01:09 -05:00
|
|
|
|
|
|
|
MxU16 m_unk0x00;
|
|
|
|
undefined m_unk0x02[0x2c][20];
|
|
|
|
};
|
2023-11-06 04:00:24 -05:00
|
|
|
|
2023-10-12 12:18:24 -04:00
|
|
|
private:
|
2023-10-24 19:38:27 -04:00
|
|
|
void RegisterState(LegoState* p_state);
|
2024-01-24 12:12:57 -05:00
|
|
|
MxResult WriteVariable(LegoStorage* p_stream, MxVariableTable* p_from, const char* p_variableName);
|
|
|
|
MxResult WriteEndOfVariables(LegoStorage* p_stream);
|
|
|
|
MxS32 ReadVariable(LegoStorage* p_stream, MxVariableTable* p_to);
|
2023-11-01 11:12:03 -04:00
|
|
|
void SetROIHandlerFunction();
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2024-01-29 16:17:17 -05:00
|
|
|
char* m_savePath; // 0x00
|
|
|
|
MxS16 m_stateCount; // 0x04
|
|
|
|
LegoState** m_stateArray; // 0x08
|
|
|
|
MxU8 m_unk0x0c; // 0x0c
|
2023-12-14 11:50:29 -05:00
|
|
|
MxU32 m_unk0x10; // 0x10
|
2023-12-15 18:11:34 -05:00
|
|
|
MxS32 m_currentAct; // 0x14
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoBackgroundColor* m_backgroundColor; // 0x18
|
|
|
|
LegoBackgroundColor* m_tempBackgroundColor; // 0x1c
|
|
|
|
LegoFullScreenMovie* m_fullScreenMovie; // 0x20
|
2023-12-13 05:48:14 -05:00
|
|
|
MxU16 m_unk0x24; // 0x24
|
2023-12-15 17:01:09 -05:00
|
|
|
undefined m_unk0x28[128]; // 0x28
|
|
|
|
ScoreStruct m_unk0xa6; // 0xa6
|
2023-12-15 18:11:34 -05:00
|
|
|
undefined m_unk0x41a[8]; // 0x41a - might be part of the structure at 0xa6
|
|
|
|
MxBool m_isDirty; // 0x420
|
2024-01-31 07:34:36 -05:00
|
|
|
MxU32 m_currentArea; // 0x424
|
|
|
|
MxU32 m_previousArea; // 0x428
|
2023-12-14 11:50:29 -05:00
|
|
|
undefined4 m_unk0x42c; // 0x42c
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
MxBool ROIHandlerFunction(char* p_input, char* p_output, MxU32 p_copyLen);
|
2023-11-01 11:12:03 -04:00
|
|
|
|
2023-04-27 22:19:39 -04:00
|
|
|
#endif // LEGOGAMESTATE_H
|