2024-05-04 08:06:32 -04:00
|
|
|
#ifndef LEGOMAIN_H
|
|
|
|
#define LEGOMAIN_H
|
2023-04-27 22:19:39 -04:00
|
|
|
|
2023-07-02 02:53:54 -04:00
|
|
|
#include "compat.h"
|
2023-10-07 11:30:04 -04:00
|
|
|
#include "mxdsaction.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "mxomni.h"
|
2023-04-27 22:19:39 -04:00
|
|
|
|
2023-10-07 11:30:04 -04:00
|
|
|
class Isle;
|
2023-10-09 06:33:06 -04:00
|
|
|
class LegoAnimationManager;
|
2023-10-07 11:30:04 -04:00
|
|
|
class LegoBuildingManager;
|
2024-03-09 15:07:52 -05:00
|
|
|
class LegoCharacterManager;
|
2023-10-07 11:30:04 -04:00
|
|
|
class LegoEntity;
|
|
|
|
class LegoGameState;
|
|
|
|
class LegoInputManager;
|
|
|
|
class LegoNavController;
|
2024-05-24 13:07:45 -04:00
|
|
|
class LegoPathActor;
|
2023-10-07 11:30:04 -04:00
|
|
|
class LegoPathBoundary;
|
|
|
|
class LegoPlantManager;
|
|
|
|
class LegoROI;
|
2023-06-11 21:03:54 -04:00
|
|
|
class LegoSoundManager;
|
2024-03-09 15:07:52 -05:00
|
|
|
class LegoTextureContainer;
|
2023-10-07 11:30:04 -04:00
|
|
|
class LegoVideoManager;
|
|
|
|
class LegoWorld;
|
2023-12-07 14:14:49 -05:00
|
|
|
class LegoWorldList;
|
2023-10-07 11:30:04 -04:00
|
|
|
class MxAtomId;
|
|
|
|
class MxBackgroundAudioManager;
|
2023-09-29 12:09:46 -04:00
|
|
|
class MxTransitionManager;
|
2024-01-01 19:17:38 -05:00
|
|
|
class ViewLODListManager;
|
2023-04-27 22:19:39 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d8638
|
2023-12-28 11:56:54 -05:00
|
|
|
// SIZE 0x140
|
2023-10-24 19:38:27 -04:00
|
|
|
class LegoOmni : public MxOmni {
|
2023-04-27 22:19:39 -04:00
|
|
|
public:
|
2024-01-17 15:48:48 -05:00
|
|
|
enum {
|
|
|
|
c_disableInput = 0x01,
|
|
|
|
c_disable3d = 0x02,
|
|
|
|
c_clearScreen = 0x04
|
|
|
|
};
|
|
|
|
|
2024-02-16 12:12:45 -05:00
|
|
|
// SIZE 0x1c
|
|
|
|
struct ScriptContainer {
|
|
|
|
// FUNCTION: LEGO1 0x1005ac40
|
|
|
|
ScriptContainer()
|
|
|
|
{
|
|
|
|
m_index = -1;
|
2024-04-19 11:42:28 -04:00
|
|
|
m_atomId = NULL;
|
2024-02-16 12:12:45 -05:00
|
|
|
}
|
|
|
|
|
2024-04-19 11:42:28 -04:00
|
|
|
ScriptContainer(MxS32 p_index, const char* p_key, MxAtomId* p_atomId)
|
2024-02-16 12:12:45 -05:00
|
|
|
{
|
|
|
|
m_index = p_index;
|
|
|
|
|
|
|
|
if (p_key) {
|
|
|
|
strcpy(m_key, p_key);
|
|
|
|
}
|
|
|
|
|
2024-04-19 11:42:28 -04:00
|
|
|
m_atomId = p_atomId;
|
2024-02-16 12:12:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1005ac50
|
|
|
|
ScriptContainer& operator=(const ScriptContainer& p_container)
|
|
|
|
{
|
|
|
|
m_index = p_container.m_index;
|
|
|
|
strcpy(m_key, p_container.m_key);
|
2024-04-19 11:42:28 -04:00
|
|
|
m_atomId = p_container.m_atomId;
|
2024-02-16 12:12:45 -05:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-02-16 20:10:42 -05:00
|
|
|
inline MxS32 GetIndex() { return m_index; }
|
|
|
|
inline const char* GetKey() { return m_key; }
|
|
|
|
|
2024-02-16 12:12:45 -05:00
|
|
|
MxS32 m_index; // 0x00
|
|
|
|
char m_key[20]; // 0x04
|
2024-04-19 11:42:28 -04:00
|
|
|
MxAtomId* m_atomId; // 0x18
|
2024-02-16 12:12:45 -05:00
|
|
|
};
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoOmni();
|
2024-06-09 13:39:22 -04:00
|
|
|
~LegoOmni() override;
|
2023-04-27 22:19:39 -04:00
|
|
|
|
2024-06-09 13:39:22 -04:00
|
|
|
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
2023-04-27 22:19:39 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10058aa0
|
2024-06-09 13:39:22 -04:00
|
|
|
inline const char* ClassName() const override // vtable+0x0c
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-27 15:59:42 -05:00
|
|
|
// STRING: LEGO1 0x100f671c
|
2023-10-24 19:38:27 -04:00
|
|
|
return "LegoOmni";
|
|
|
|
}
|
2023-06-25 21:34:13 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10058ab0
|
2024-06-09 13:39:22 -04:00
|
|
|
inline MxBool IsA(const char* p_name) const override // vtable+0x10
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
return !strcmp(p_name, LegoOmni::ClassName()) || MxOmni::IsA(p_name);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-06-25 21:34:13 -04:00
|
|
|
|
2024-06-09 13:39:22 -04:00
|
|
|
void Init() override; // vtable+0x14
|
|
|
|
MxResult Create(MxOmniCreateParam& p_param) override; // vtable+0x18
|
|
|
|
void Destroy() override; // vtable+0x1c
|
|
|
|
MxResult Start(MxDSAction* p_dsAction) override; // vtable+0x20
|
|
|
|
void DeleteObject(MxDSAction& p_dsAction) override; // vtable+0x24
|
|
|
|
MxBool DoesEntityExist(MxDSAction& p_dsAction) override; // vtable+0x28
|
|
|
|
MxEntity* AddToWorld(const char* p_id, MxS32 p_entityId, MxPresenter* p_presenter) override; // vtable+0x30
|
|
|
|
void NotifyCurrentEntity(const MxNotificationParam& p_param) override; // vtable+0x34
|
|
|
|
void Pause() override; // vtable+0x38
|
|
|
|
void Resume() override; // vtable+0x3c
|
2024-01-26 16:00:02 -05:00
|
|
|
|
|
|
|
LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid);
|
2024-02-16 19:34:30 -05:00
|
|
|
LegoROI* FindROI(const char* p_name);
|
2023-12-26 19:45:48 -05:00
|
|
|
void AddWorld(LegoWorld* p_world);
|
2024-01-28 17:10:04 -05:00
|
|
|
void DeleteWorld(LegoWorld* p_world);
|
2024-01-17 15:48:48 -05:00
|
|
|
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags);
|
2024-02-04 12:33:37 -05:00
|
|
|
void CreateBackgroundAudio();
|
2024-03-01 16:32:10 -05:00
|
|
|
void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId);
|
2024-02-16 12:12:45 -05:00
|
|
|
MxResult RegisterScripts();
|
2024-04-19 11:42:28 -04:00
|
|
|
const char* GetScriptName(MxU32 p_index);
|
|
|
|
MxAtomId* GetScriptAtom(MxU32 p_index);
|
2024-02-16 20:10:42 -05:00
|
|
|
MxS32 GetScriptIndex(const char* p_key);
|
2024-03-23 10:09:20 -04:00
|
|
|
void DeleteAction();
|
2024-02-04 12:33:37 -05:00
|
|
|
|
|
|
|
static MxS32 GetCurrPathInfo(LegoPathBoundary**, MxS32&);
|
|
|
|
static void CreateInstance();
|
|
|
|
static LegoOmni* GetInstance();
|
2023-06-25 21:34:13 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoVideoManager* GetVideoManager() { return (LegoVideoManager*) m_videoManager; }
|
|
|
|
LegoSoundManager* GetSoundManager() { return (LegoSoundManager*) m_soundManager; }
|
2024-02-22 16:59:44 -05:00
|
|
|
LegoInputManager* GetInputManager() { return m_inputManager; }
|
|
|
|
LegoTextureContainer* GetTextureContainer() { return m_textureContainer; }
|
2024-02-24 11:48:16 -05:00
|
|
|
ViewLODListManager* GetViewLODListManager() { return m_viewLODListManager; }
|
2024-01-26 16:00:02 -05:00
|
|
|
LegoWorld* GetCurrentWorld() { return m_currentWorld; }
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoNavController* GetNavController() { return m_navController; }
|
2024-06-12 09:13:52 -04:00
|
|
|
LegoPathActor* GetUserActor() { return m_userActor; }
|
2024-06-05 13:00:46 -04:00
|
|
|
LegoPlantManager* GetPlantManager() { return m_plantManager; }
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoAnimationManager* GetAnimationManager() { return m_animationManager; }
|
2024-06-05 13:00:46 -04:00
|
|
|
LegoBuildingManager* GetBuildingManager() { return m_buildingManager; }
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoGameState* GetGameState() { return m_gameState; }
|
|
|
|
MxBackgroundAudioManager* GetBackgroundAudioManager() { return m_bkgAudioManager; }
|
|
|
|
MxTransitionManager* GetTransitionManager() { return m_transitionManager; }
|
2023-11-05 10:07:28 -05:00
|
|
|
MxDSAction& GetCurrentAction() { return m_action; }
|
2024-03-09 15:07:52 -05:00
|
|
|
LegoCharacterManager* GetCharacterManager() { return m_characterManager; }
|
2024-02-10 13:02:52 -05:00
|
|
|
LegoWorldList* GetWorldList() { return m_worldList; }
|
2023-04-27 22:19:39 -04:00
|
|
|
|
2024-01-09 04:43:21 -05:00
|
|
|
inline void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; }
|
2024-06-12 09:13:52 -04:00
|
|
|
inline void SetUserActor(LegoPathActor* p_userActor) { m_userActor = p_userActor; }
|
2024-02-02 12:18:46 -05:00
|
|
|
inline void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; }
|
2024-01-29 17:30:20 -05:00
|
|
|
inline void SetExit(MxBool p_exit) { m_exit = p_exit; }
|
2024-03-23 10:09:20 -04:00
|
|
|
inline MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction)
|
|
|
|
{
|
2024-04-19 11:42:28 -04:00
|
|
|
return m_unk0x13c ? Start(&p_dsAction) : SUCCESS;
|
2024-03-23 10:09:20 -04:00
|
|
|
}
|
2024-03-23 14:00:34 -04:00
|
|
|
inline void SetUnknown13c(MxBool p_unk0x13c) { m_unk0x13c = p_unk0x13c; }
|
2023-12-29 10:22:18 -05:00
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
inline void CloseMainWindow() { PostMessageA(m_windowHandle, WM_CLOSE, 0, 0); }
|
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x10058b30
|
|
|
|
// LegoOmni::`scalar deleting destructor'
|
|
|
|
|
2023-04-27 22:19:39 -04:00
|
|
|
private:
|
2024-02-16 12:12:45 -05:00
|
|
|
ScriptContainer* m_scripts; // 0x68
|
2024-01-01 19:17:38 -05:00
|
|
|
ViewLODListManager* m_viewLODListManager; // 0x6c
|
2024-02-22 16:59:44 -05:00
|
|
|
LegoInputManager* m_inputManager; // 0x70
|
|
|
|
LegoTextureContainer* m_textureContainer; // 0x74
|
2023-12-16 13:14:01 -05:00
|
|
|
LegoWorldList* m_worldList; // 0x78
|
|
|
|
LegoWorld* m_currentWorld; // 0x7c
|
2023-12-29 10:22:18 -05:00
|
|
|
MxBool m_exit; // 0x80
|
2023-12-16 13:14:01 -05:00
|
|
|
LegoNavController* m_navController; // 0x84
|
2024-06-12 09:13:52 -04:00
|
|
|
LegoPathActor* m_userActor; // 0x88
|
2024-03-09 15:07:52 -05:00
|
|
|
LegoCharacterManager* m_characterManager; // 0x8c
|
2023-12-16 13:14:01 -05:00
|
|
|
LegoPlantManager* m_plantManager; // 0x90
|
|
|
|
LegoAnimationManager* m_animationManager; // 0x94
|
|
|
|
LegoBuildingManager* m_buildingManager; // 0x98
|
|
|
|
LegoGameState* m_gameState; // 0x9c
|
|
|
|
MxDSAction m_action; // 0xa0
|
2023-10-24 19:38:27 -04:00
|
|
|
MxBackgroundAudioManager* m_bkgAudioManager; // 0x134
|
|
|
|
MxTransitionManager* m_transitionManager; // 0x138
|
2024-04-26 11:37:07 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
MxBool m_unk0x13c; // 0x13c
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
2024-05-04 08:06:32 -04:00
|
|
|
#endif // LEGOMAIN_H
|