mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 08:54:15 +00:00
Add LegoOmni::World enum (#1252)
This commit is contained in:
committed by
GitHub
parent
3e427ab03e
commit
bcc41256f8
@@ -416,7 +416,7 @@ void LegoAnimationManager::Suspend()
|
||||
m_animState = (AnimState*) GameState()->CreateState("AnimState");
|
||||
}
|
||||
|
||||
if (m_worldId == 0) {
|
||||
if (m_worldId == LegoOmni::e_act1) {
|
||||
m_animState->InitFromAnims(m_animCount, m_anims, m_lastExtraCharacterId);
|
||||
}
|
||||
|
||||
@@ -495,7 +495,7 @@ void LegoAnimationManager::Resume()
|
||||
void LegoAnimationManager::Init()
|
||||
{
|
||||
m_unk0x402 = FALSE;
|
||||
m_worldId = -1;
|
||||
m_worldId = LegoOmni::e_undefined;
|
||||
m_animCount = 0;
|
||||
m_anims = NULL;
|
||||
m_unk0x18 = 0;
|
||||
@@ -580,7 +580,7 @@ void LegoAnimationManager::EnableCamAnims(MxBool p_enableCamAnims)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005f720
|
||||
MxResult LegoAnimationManager::LoadWorldInfo(MxS32 p_worldId)
|
||||
MxResult LegoAnimationManager::LoadWorldInfo(LegoOmni::World p_worldId)
|
||||
{
|
||||
MxResult result = FAILURE;
|
||||
MxS32 i, j, k;
|
||||
@@ -615,7 +615,7 @@ MxResult LegoAnimationManager::LoadWorldInfo(MxS32 p_worldId)
|
||||
m_animState = (AnimState*) GameState()->CreateState("AnimState");
|
||||
}
|
||||
|
||||
if (m_worldId == 0) {
|
||||
if (m_worldId == LegoOmni::e_act1) {
|
||||
m_animState->InitFromAnims(m_animCount, m_anims, m_lastExtraCharacterId);
|
||||
}
|
||||
|
||||
@@ -623,7 +623,7 @@ MxResult LegoAnimationManager::LoadWorldInfo(MxS32 p_worldId)
|
||||
|
||||
LegoFile file;
|
||||
|
||||
if (p_worldId == -1) {
|
||||
if (p_worldId == LegoOmni::e_undefined) {
|
||||
result = SUCCESS;
|
||||
goto done;
|
||||
}
|
||||
@@ -961,7 +961,7 @@ MxResult LegoAnimationManager::FUN_100605e0(
|
||||
{
|
||||
MxResult result = FAILURE;
|
||||
|
||||
if (m_worldId != -1 && p_index < m_animCount && m_tranInfoList != NULL) {
|
||||
if (m_worldId != LegoOmni::e_undefined && p_index < m_animCount && m_tranInfoList != NULL) {
|
||||
PurgeExtra(FALSE);
|
||||
FUN_10062770();
|
||||
|
||||
|
||||
@@ -78,14 +78,14 @@ void LegoPlantManager::Init()
|
||||
g_plantInfo[i] = g_plantInfoInit[i];
|
||||
}
|
||||
|
||||
m_worldId = -1;
|
||||
m_worldId = LegoOmni::e_undefined;
|
||||
m_unk0x0c = 0;
|
||||
m_numEntries = 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10026360
|
||||
// FUNCTION: BETA10 0x100c5032
|
||||
void LegoPlantManager::LoadWorldInfo(MxS32 p_worldId)
|
||||
void LegoPlantManager::LoadWorldInfo(LegoOmni::World p_worldId)
|
||||
{
|
||||
m_worldId = p_worldId;
|
||||
LegoWorld* world = CurrentWorld();
|
||||
@@ -98,7 +98,7 @@ void LegoPlantManager::LoadWorldInfo(MxS32 p_worldId)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100263a0
|
||||
void LegoPlantManager::Reset(MxS32 p_worldId)
|
||||
void LegoPlantManager::Reset(LegoOmni::World p_worldId)
|
||||
{
|
||||
MxU32 i;
|
||||
DeleteObjects(g_sndAnimScript, SndanimScript::c_AnimC1, SndanimScript::c_AnimBld18);
|
||||
@@ -113,7 +113,7 @@ void LegoPlantManager::Reset(MxS32 p_worldId)
|
||||
RemovePlant(i, p_worldId);
|
||||
}
|
||||
|
||||
m_worldId = -1;
|
||||
m_worldId = LegoOmni::e_undefined;
|
||||
m_unk0x0c = 0;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ LegoPlantInfo* LegoPlantManager::GetInfoArray(MxS32& p_length)
|
||||
|
||||
// FUNCTION: LEGO1 0x10026590
|
||||
// FUNCTION: BETA10 0x100c561e
|
||||
LegoEntity* LegoPlantManager::CreatePlant(MxS32 p_index, LegoWorld* p_world, MxS32 p_worldId)
|
||||
LegoEntity* LegoPlantManager::CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId)
|
||||
{
|
||||
LegoEntity* entity = NULL;
|
||||
|
||||
@@ -244,7 +244,7 @@ LegoEntity* LegoPlantManager::CreatePlant(MxS32 p_index, LegoWorld* p_world, MxS
|
||||
|
||||
// FUNCTION: LEGO1 0x100266c0
|
||||
// FUNCTION: BETA10 0x100c5859
|
||||
void LegoPlantManager::RemovePlant(MxS32 p_index, MxS32 p_worldId)
|
||||
void LegoPlantManager::RemovePlant(MxS32 p_index, LegoOmni::World p_worldId)
|
||||
{
|
||||
if (p_index < sizeOfArray(g_plantInfo)) {
|
||||
MxU32 world = 1 << (MxU8) p_worldId;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "legogamestate.h"
|
||||
#include "legoinputmanager.h"
|
||||
#include "legolocomotionanimpresenter.h"
|
||||
#include "legomain.h"
|
||||
#include "legonavcontroller.h"
|
||||
#include "legoplantmanager.h"
|
||||
#include "legosoundmanager.h"
|
||||
@@ -102,8 +101,7 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction)
|
||||
}
|
||||
|
||||
SetIsWorldActive(TRUE);
|
||||
m_worldId = -1;
|
||||
|
||||
m_worldId = LegoOmni::e_undefined;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -180,7 +178,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_worldId != -1 && m_set0xd0.empty()) {
|
||||
if (m_worldId != LegoOmni::e_undefined && m_set0xd0.empty()) {
|
||||
PlantManager()->Reset(m_worldId);
|
||||
BuildingManager()->Reset();
|
||||
}
|
||||
@@ -701,7 +699,7 @@ void LegoWorld::Enable(MxBool p_enable)
|
||||
Lego()->SetNavController(m_cameraController->GetNavController());
|
||||
}
|
||||
|
||||
if (m_worldId != -1) {
|
||||
if (m_worldId != LegoOmni::e_undefined) {
|
||||
PlantManager()->LoadWorldInfo(m_worldId);
|
||||
AnimationManager()->LoadWorldInfo(m_worldId);
|
||||
BuildingManager()->LoadWorldInfo();
|
||||
@@ -724,7 +722,7 @@ void LegoWorld::Enable(MxBool p_enable)
|
||||
AnimationManager()->Reset(FALSE);
|
||||
m_set0xd0.insert(this);
|
||||
|
||||
if (m_worldId != -1) {
|
||||
if (m_worldId != LegoOmni::e_undefined) {
|
||||
PlantManager()->Reset(m_worldId);
|
||||
BuildingManager()->Reset();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ LegoWorldPresenter::~LegoWorldPresenter()
|
||||
{
|
||||
MxBool result = FALSE;
|
||||
if (m_entity) {
|
||||
MxS32 worldId = ((LegoWorld*) m_entity)->GetWorldId();
|
||||
LegoOmni::World worldId = ((LegoWorld*) m_entity)->GetWorldId();
|
||||
PlantManager()->LoadWorldInfo(worldId);
|
||||
AnimationManager()->LoadWorldInfo(worldId);
|
||||
BuildingManager()->LoadWorldInfo();
|
||||
|
||||
@@ -266,32 +266,31 @@ done:
|
||||
// FUNCTION: LEGO1 0x1005a5f0
|
||||
MxResult LegoOmni::RegisterWorlds()
|
||||
{
|
||||
m_worlds = new WorldContainer[19];
|
||||
m_worlds = new WorldContainer[e_numWorlds];
|
||||
|
||||
if (!m_worlds) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
m_worlds[0] = WorldContainer();
|
||||
m_worlds[1] = WorldContainer(0, "ACT1", g_isleScript);
|
||||
m_worlds[2] = WorldContainer(1, "IMAIN", g_infomainScript);
|
||||
m_worlds[3] = WorldContainer(2, "ICUBE", g_infoscorScript);
|
||||
m_worlds[4] = WorldContainer(3, "IREG", g_regbookScript);
|
||||
m_worlds[5] = WorldContainer(4, "IELEV", g_elevbottScript);
|
||||
m_worlds[6] = WorldContainer(5, "IISLE", g_infodoorScript);
|
||||
m_worlds[7] = WorldContainer(6, "HOSP", g_hospitalScript);
|
||||
m_worlds[8] = WorldContainer(7, "POLICE", g_policeScript);
|
||||
m_worlds[9] = WorldContainer(8, "GMAIN", g_garageScript);
|
||||
m_worlds[10] = WorldContainer(9, "BLDH", g_copterScript);
|
||||
m_worlds[11] = WorldContainer(10, "BLDD", g_dunecarScript);
|
||||
m_worlds[12] = WorldContainer(11, "BLDJ", g_jetskiScript);
|
||||
m_worlds[13] = WorldContainer(12, "BLDR", g_racecarScript);
|
||||
m_worlds[14] = WorldContainer(13, "RACC", g_carraceScript);
|
||||
m_worlds[15] = WorldContainer(14, "RACJ", g_jetraceScript);
|
||||
m_worlds[16] = WorldContainer(15, "ACT2", g_act2mainScript);
|
||||
m_worlds[17] = WorldContainer(16, "ACT3", g_act3Script);
|
||||
m_worlds[18] = WorldContainer(17, "TEST", g_testScript);
|
||||
|
||||
m_worlds[1] = WorldContainer(e_act1, "ACT1", g_isleScript);
|
||||
m_worlds[2] = WorldContainer(e_imain, "IMAIN", g_infomainScript);
|
||||
m_worlds[3] = WorldContainer(e_icube, "ICUBE", g_infoscorScript);
|
||||
m_worlds[4] = WorldContainer(e_ireg, "IREG", g_regbookScript);
|
||||
m_worlds[5] = WorldContainer(e_ielev, "IELEV", g_elevbottScript);
|
||||
m_worlds[6] = WorldContainer(e_iisle, "IISLE", g_infodoorScript);
|
||||
m_worlds[7] = WorldContainer(e_hosp, "HOSP", g_hospitalScript);
|
||||
m_worlds[8] = WorldContainer(e_police, "POLICE", g_policeScript);
|
||||
m_worlds[9] = WorldContainer(e_gmain, "GMAIN", g_garageScript);
|
||||
m_worlds[10] = WorldContainer(e_bldh, "BLDH", g_copterScript);
|
||||
m_worlds[11] = WorldContainer(e_bldd, "BLDD", g_dunecarScript);
|
||||
m_worlds[12] = WorldContainer(e_bldj, "BLDJ", g_jetskiScript);
|
||||
m_worlds[13] = WorldContainer(e_bldr, "BLDR", g_racecarScript);
|
||||
m_worlds[14] = WorldContainer(e_racc, "RACC", g_carraceScript);
|
||||
m_worlds[15] = WorldContainer(e_racj, "RACJ", g_jetraceScript);
|
||||
m_worlds[16] = WorldContainer(e_act2, "ACT2", g_act2mainScript);
|
||||
m_worlds[17] = WorldContainer(e_act3, "ACT3", g_act3Script);
|
||||
m_worlds[18] = WorldContainer(e_test, "TEST", g_testScript);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -476,10 +475,10 @@ MxS32 LegoOmni::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b430
|
||||
const char* LegoOmni::GetWorldName(MxU32 p_id)
|
||||
const char* LegoOmni::GetWorldName(LegoOmni::World p_worldId)
|
||||
{
|
||||
for (MxS32 i = 0; i < 19; i++) {
|
||||
if (m_worlds[i].m_id == p_id) {
|
||||
for (MxS32 i = 0; i < e_numWorlds; i++) {
|
||||
if (m_worlds[i].m_id == p_worldId) {
|
||||
return m_worlds[i].m_key;
|
||||
}
|
||||
}
|
||||
@@ -489,10 +488,10 @@ const char* LegoOmni::GetWorldName(MxU32 p_id)
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b460
|
||||
// FUNCTION: BETA10 0x1008edd8
|
||||
MxAtomId* LegoOmni::GetWorldAtom(MxU32 p_id)
|
||||
MxAtomId* LegoOmni::GetWorldAtom(LegoOmni::World p_worldId)
|
||||
{
|
||||
for (MxS32 i = 0; i < 19; i++) {
|
||||
if (m_worlds[i].m_id == p_id) {
|
||||
for (MxS32 i = 0; i < e_numWorlds; i++) {
|
||||
if (m_worlds[i].m_id == p_worldId) {
|
||||
return m_worlds[i].m_atomId;
|
||||
}
|
||||
}
|
||||
@@ -503,15 +502,15 @@ MxAtomId* LegoOmni::GetWorldAtom(MxU32 p_id)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b490
|
||||
MxS32 LegoOmni::GetWorldId(const char* p_key)
|
||||
LegoOmni::World LegoOmni::GetWorldId(const char* p_key)
|
||||
{
|
||||
for (MxS32 i = 0; i < 19; i++) {
|
||||
for (MxS32 i = 0; i < e_numWorlds; i++) {
|
||||
if ((MxS32) &m_worlds[i] != -4 && !strcmpi(m_worlds[i].GetKey(), p_key)) {
|
||||
return m_worlds[i].GetId();
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return e_undefined;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b4f0
|
||||
|
||||
@@ -1111,7 +1111,7 @@ MxResult LegoAct2::FUN_10052560(
|
||||
|
||||
action.SetObjectId(p_objectId);
|
||||
// World index: see LegoOmni::RegisterWorlds
|
||||
action.SetAtomId(*Lego()->GetWorldAtom(15));
|
||||
action.SetAtomId(*Lego()->GetWorldAtom(LegoOmni::e_act2));
|
||||
|
||||
if (p_location) {
|
||||
action.SetUp(Mx3DPointFloat(0.0f, 1.0f, 0.0f));
|
||||
|
||||
Reference in New Issue
Block a user