isle-portable/LEGO1/lego/legoomni/include/legomain.h

177 lines
6.2 KiB
C
Raw Normal View History

#ifndef LEGOMAIN_H
#define LEGOMAIN_H
2023-04-27 22:19:39 -04:00
#include "compat.h"
#include "mxdsaction.h"
2023-10-24 19:38:27 -04:00
#include "mxomni.h"
2023-04-27 22:19:39 -04:00
class Isle;
class LegoAnimationManager;
class LegoBuildingManager;
class LegoCharacterManager;
class LegoEntity;
class LegoGameState;
class LegoInputManager;
class LegoNavController;
class LegoPathActor;
class LegoPathBoundary;
class LegoPlantManager;
class LegoROI;
class LegoSoundManager;
class LegoTextureContainer;
class LegoVideoManager;
class LegoWorld;
class LegoWorldList;
class MxAtomId;
class MxBackgroundAudioManager;
class MxTransitionManager;
class ViewLODListManager;
2023-04-27 22:19:39 -04:00
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
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:
enum {
c_disableInput = 0x01,
c_disable3d = 0x02,
c_clearScreen = 0x04
};
// SIZE 0x1c
struct WorldContainer {
// FUNCTION: LEGO1 0x1005ac40
WorldContainer()
{
m_id = -1;
m_atomId = NULL;
}
WorldContainer(MxS32 p_id, const char* p_key, MxAtomId* p_atomId)
{
m_id = p_id;
if (p_key) {
strcpy(m_key, p_key);
}
m_atomId = p_atomId;
}
// FUNCTION: LEGO1 0x1005ac50
WorldContainer& operator=(const WorldContainer& p_container)
{
m_id = p_container.m_id;
strcpy(m_key, p_container.m_key);
m_atomId = p_container.m_atomId;
return *this;
}
MxS32 GetId() { return m_id; }
const char* GetKey() { return m_key; }
MxS32 m_id; // 0x00
char m_key[20]; // 0x04
MxAtomId* m_atomId; // 0x18
};
2023-10-24 19:38:27 -04:00
LegoOmni();
~LegoOmni() override;
2023-04-27 22:19:39 -04:00
MxLong Notify(MxParam& p_param) override; // vtable+0x04
2023-04-27 22:19:39 -04:00
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x10058aa0
const char* ClassName() const override // vtable+0x0c
2023-10-24 19:38:27 -04:00
{
// STRING: LEGO1 0x100f671c
2023-10-24 19:38:27 -04:00
return "LegoOmni";
}
2023-06-25 21:34:13 -04:00
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x10058ab0
MxBool IsA(const char* p_name) const override // vtable+0x10
2023-10-24 19:38:27 -04: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
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
LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid);
LegoROI* FindROI(const char* p_name);
void AddWorld(LegoWorld* p_world);
void DeleteWorld(LegoWorld* p_world);
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags);
void CreateBackgroundAudio();
void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId);
MxResult RegisterWorlds();
const char* GetWorldName(MxU32 p_id);
MxAtomId* GetWorldAtom(MxU32 p_id);
MxS32 GetWorldId(const char* p_key);
void DeleteAction();
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; }
LegoInputManager* GetInputManager() { return m_inputManager; }
LegoTextureContainer* GetTextureContainer() { return m_textureContainer; }
ViewLODListManager* GetViewLODListManager() { return m_viewLODListManager; }
LegoWorld* GetCurrentWorld() { return m_currentWorld; }
2023-10-24 19:38:27 -04:00
LegoNavController* GetNavController() { return m_navController; }
LegoPathActor* GetUserActor() { return m_userActor; }
LegoPlantManager* GetPlantManager() { return m_plantManager; }
2023-10-24 19:38:27 -04:00
LegoAnimationManager* GetAnimationManager() { return m_animationManager; }
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; }
MxDSAction& GetCurrentAction() { return m_action; }
LegoCharacterManager* GetCharacterManager() { return m_characterManager; }
LegoWorldList* GetWorldList() { return m_worldList; }
2023-04-27 22:19:39 -04:00
void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; }
void SetUserActor(LegoPathActor* p_userActor) { m_userActor = p_userActor; }
void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; }
void SetExit(MxBool p_exit) { m_exit = p_exit; }
MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction) { return m_unk0x13c ? Start(&p_dsAction) : SUCCESS; }
void SetUnknown13c(MxBool p_unk0x13c) { m_unk0x13c = p_unk0x13c; }
void CloseMainWindow() { PostMessageA(m_windowHandle, WM_CLOSE, 0, 0); }
// SYNTHETIC: LEGO1 0x10058b30
// LegoOmni::`scalar deleting destructor'
2023-04-27 22:19:39 -04:00
private:
WorldContainer* m_worlds; // 0x68
ViewLODListManager* m_viewLODListManager; // 0x6c
LegoInputManager* m_inputManager; // 0x70
LegoTextureContainer* m_textureContainer; // 0x74
LegoWorldList* m_worldList; // 0x78
LegoWorld* m_currentWorld; // 0x7c
MxBool m_exit; // 0x80
LegoNavController* m_navController; // 0x84
LegoPathActor* m_userActor; // 0x88
LegoCharacterManager* m_characterManager; // 0x8c
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
public:
MxBool m_unk0x13c; // 0x13c
2023-04-27 22:19:39 -04:00
};
#endif // LEGOMAIN_H