Implement/match LegoPlantManager::CreatePlant (#1039)

* Implement/match LegoPlantManager::CreatePlant

* Update names

* Fix name

* Fix

* Fix
This commit is contained in:
Christian Semmler
2024-06-18 13:35:03 -04:00
committed by GitHub
parent 1a46d370ec
commit e507f42717
13 changed files with 242 additions and 179 deletions

View File

@@ -151,7 +151,7 @@ public:
void Resume();
void FUN_1005f6d0(MxBool p_unk0x400);
void EnableCamAnims(MxBool p_enableCamAnims);
MxResult LoadScriptInfo(MxS32 p_scriptIndex);
MxResult LoadWorldInfo(MxS32 p_worldId);
MxBool FindVehicle(const char* p_name, MxU32& p_index);
MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info);
MxResult ReadModelInfo(LegoFile* p_file, ModelInfo* p_info);
@@ -244,7 +244,7 @@ private:
void FUN_100648f0(LegoTranInfo* p_tranInfo, MxLong p_unk0x404);
void FUN_10064b50(MxLong p_time);
MxS32 m_scriptIndex; // 0x08
MxS32 m_worldId; // 0x08
MxU16 m_animCount; // 0x0c
MxU16 m_unk0x0e; // 0x0e
MxU16 m_unk0x10; // 0x10

View File

@@ -67,7 +67,7 @@ public:
void Init();
void FUN_1002fa00();
void UpdatePosition(MxS32 p_index, LegoWorld* p_world);
void CreateBuilding(MxS32 p_index, LegoWorld* p_world);
void FUN_1002fb30();
MxResult Write(LegoStorage* p_storage);
MxResult Read(LegoStorage* p_storage);

View File

@@ -38,17 +38,17 @@ public:
};
// SIZE 0x1c
struct ScriptContainer {
struct WorldContainer {
// FUNCTION: LEGO1 0x1005ac40
ScriptContainer()
WorldContainer()
{
m_index = -1;
m_id = -1;
m_atomId = NULL;
}
ScriptContainer(MxS32 p_index, const char* p_key, MxAtomId* p_atomId)
WorldContainer(MxS32 p_id, const char* p_key, MxAtomId* p_atomId)
{
m_index = p_index;
m_id = p_id;
if (p_key) {
strcpy(m_key, p_key);
@@ -58,18 +58,18 @@ public:
}
// FUNCTION: LEGO1 0x1005ac50
ScriptContainer& operator=(const ScriptContainer& p_container)
WorldContainer& operator=(const WorldContainer& p_container)
{
m_index = p_container.m_index;
m_id = p_container.m_id;
strcpy(m_key, p_container.m_key);
m_atomId = p_container.m_atomId;
return *this;
}
inline MxS32 GetIndex() { return m_index; }
inline MxS32 GetId() { return m_id; }
inline const char* GetKey() { return m_key; }
MxS32 m_index; // 0x00
MxS32 m_id; // 0x00
char m_key[20]; // 0x04
MxAtomId* m_atomId; // 0x18
};
@@ -110,10 +110,10 @@ public:
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags);
void CreateBackgroundAudio();
void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId);
MxResult RegisterScripts();
const char* GetScriptName(MxU32 p_index);
MxAtomId* GetScriptAtom(MxU32 p_index);
MxS32 GetScriptIndex(const char* p_key);
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&);
@@ -154,7 +154,7 @@ public:
// LegoOmni::`scalar deleting destructor'
private:
ScriptContainer* m_scripts; // 0x68
WorldContainer* m_worlds; // 0x68
ViewLODListManager* m_viewLODListManager; // 0x6c
LegoInputManager* m_inputManager; // 0x70
LegoTextureContainer* m_textureContainer; // 0x74

View File

@@ -8,6 +8,7 @@ class LegoEntity;
class LegoPathBoundary;
class LegoROI;
class LegoStorage;
class LegoWorld;
// VTABLE: LEGO1 0x100d6758
// SIZE 0x2c
@@ -26,7 +27,7 @@ public:
}
void Init();
void FUN_10026360(MxS32 p_scriptIndex);
void LoadWorldInfo(MxS32 p_worldId);
void FUN_100263a0(undefined4 p_und);
MxResult Write(LegoStorage* p_storage);
MxResult Read(LegoStorage* p_storage);
@@ -47,9 +48,11 @@ public:
// LegoPlantManager::`scalar deleting destructor'
private:
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, MxS32 p_worldId);
static char* g_customizeAnimFile;
undefined4 m_unk0x08; // 0x08
MxS32 m_worldId; // 0x08
undefined m_unk0x0c; // 0x0c
undefined m_unk0x10[0x17]; // 0x10
undefined m_unk0x24; // 0x24

View File

@@ -9,13 +9,14 @@ class LegoPathBoundary;
// SIZE 0x54
struct LegoPlantInfo {
enum {
c_flag1 = 0x01,
c_flag2 = 0x02,
c_flag5 = 0x10,
c_flag6 = 0x20,
c_flag16 = 0x8000,
c_flag17 = 0x10000
// See LegoOmni::RegisterWorlds for IDs
enum Worlds {
c_act1 = 1 << 0,
c_imain = 1 << 1,
c_ielev = 1 << 4,
c_iisle = 1 << 5,
c_act2 = 1 << 15,
c_act3 = 1 << 16
};
enum Variant {
@@ -34,8 +35,8 @@ struct LegoPlantInfo {
};
LegoEntity* m_entity; // 0x00
MxU32 m_flags; // 0x04
Variant m_variant; // 0x08
MxU32 m_worlds; // 0x04 - see enum for possible bit flags
MxU8 m_variant; // 0x08 - see enum for possible values
MxU32 m_sound; // 0x0c
MxU32 m_move; // 0x10
MxU8 m_mood; // 0x14

View File

@@ -90,12 +90,12 @@ public:
inline LegoCameraController* GetCamera() { return m_cameraController; }
inline LegoEntityList* GetEntityList() { return m_entityList; }
inline MxS32 GetScriptIndex() { return m_scriptIndex; }
inline MxS32 GetWorldId() { return m_worldId; }
inline MxBool GetUnknown0xd0Empty() { return m_set0xd0.empty(); }
inline list<LegoROI*>& GetROIList() { return m_roiList; }
inline LegoHideAnimPresenter* GetHideAnimPresenter() { return m_hideAnimPresenter; }
inline void SetScriptIndex(MxS32 p_scriptIndex) { m_scriptIndex = p_scriptIndex; }
inline void SetWorldId(MxS32 p_worldId) { m_worldId = p_worldId; }
// SYNTHETIC: LEGO1 0x1001dee0
// LegoWorld::`scalar deleting destructor'
@@ -111,7 +111,7 @@ protected:
MxPresenterList m_controlPresenters; // 0xb8
MxCoreSet m_set0xd0; // 0xd0
list<LegoROI*> m_roiList; // 0xe0
MxS32 m_scriptIndex; // 0xec
MxS32 m_worldId; // 0xec
LegoHideAnimPresenter* m_hideAnimPresenter; // 0xf0
MxS16 m_startupTicks; // 0xf4
MxBool m_worldStarted; // 0xf6