mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
Merge remote-tracking branch 'isle/master'
This commit is contained in:
commit
99be9c8767
@ -123,7 +123,7 @@ class Hospital : public LegoWorld {
|
||||
MxLong m_copLedAnimTimer; // 0x11c
|
||||
MxLong m_pizzaLedAnimTimer; // 0x120
|
||||
MxLong m_time; // 0x124
|
||||
undefined m_unk0x128; // 0x128
|
||||
MxBool m_exited; // 0x128
|
||||
};
|
||||
|
||||
#endif // HOSPITAL_H
|
||||
|
||||
@ -121,7 +121,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
|
||||
void SubstituteVariables();
|
||||
void FUN_1006b900(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
|
||||
void FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
|
||||
void FUN_1006c8a0(MxBool p_bool);
|
||||
void SetDisabled(MxBool p_disabled);
|
||||
|
||||
LegoAnim* m_anim; // 0x64
|
||||
LegoROI** m_roiMap; // 0x68
|
||||
|
||||
@ -79,7 +79,7 @@ class LegoBuildingManager : public MxCore {
|
||||
MxBool SwitchMove(LegoEntity* p_entity);
|
||||
MxBool SwitchMood(LegoEntity* p_entity);
|
||||
MxU32 GetAnimationId(LegoEntity* p_entity);
|
||||
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
|
||||
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood);
|
||||
MxBool DecrementCounter(LegoEntity* p_entity);
|
||||
MxBool DecrementCounter(MxS32 p_index);
|
||||
MxBool DecrementCounter(LegoBuildingInfo* p_data);
|
||||
|
||||
@ -88,7 +88,7 @@ class LegoCharacterManager {
|
||||
MxBool SwitchMove(LegoROI* p_roi);
|
||||
MxBool SwitchMood(LegoROI* p_roi);
|
||||
MxU32 GetAnimationId(LegoROI* p_roi);
|
||||
MxU32 GetSoundId(LegoROI* p_roi, MxBool p_und);
|
||||
MxU32 GetSoundId(LegoROI* p_roi, MxBool p_basedOnMood);
|
||||
MxU8 GetMood(LegoROI* p_roi);
|
||||
LegoROI* CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
||||
MxResult UpdateBoundingSphereAndBox(LegoROI* p_roi);
|
||||
|
||||
@ -28,7 +28,7 @@ class LegoEntity : public MxEntity {
|
||||
};
|
||||
|
||||
enum {
|
||||
c_altBit1 = 0x01
|
||||
c_disabled = 0x01
|
||||
};
|
||||
|
||||
LegoEntity() { Init(); }
|
||||
@ -68,7 +68,7 @@ class LegoEntity : public MxEntity {
|
||||
// FUNCTION: BETA10 0x10013260
|
||||
virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30
|
||||
|
||||
virtual void ClickSound(MxBool p_und); // vtable+0x34
|
||||
virtual void ClickSound(MxBool p_basedOnMood); // vtable+0x34
|
||||
virtual void ClickAnimation(); // vtable+0x38
|
||||
virtual void SwitchVariant(); // vtable+0x3c
|
||||
virtual void SwitchSound(); // vtable+0x40
|
||||
@ -83,7 +83,7 @@ class LegoEntity : public MxEntity {
|
||||
Mx3DPointFloat GetWorldUp();
|
||||
Mx3DPointFloat GetWorldPosition();
|
||||
|
||||
MxBool GetUnknown0x10IsSet(MxU8 p_flag) { return m_unk0x10 & p_flag; }
|
||||
MxBool IsInteraction(MxU8 p_flag) { return m_interaction & p_flag; }
|
||||
MxBool GetFlagsIsSet(MxU8 p_flag) { return m_flags & p_flag; }
|
||||
MxU8 GetFlags() { return m_flags; }
|
||||
|
||||
@ -101,14 +101,14 @@ class LegoEntity : public MxEntity {
|
||||
void SetFlags(MxU8 p_flags) { m_flags = p_flags; }
|
||||
void SetFlag(MxU8 p_flag) { m_flags |= p_flag; }
|
||||
void ClearFlag(MxU8 p_flag) { m_flags &= ~p_flag; }
|
||||
void SetUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 |= p_flag; }
|
||||
void ClearUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 &= ~p_flag; }
|
||||
void SetInteractionFlag(MxU8 p_flag) { m_interaction |= p_flag; }
|
||||
void ClearInteractionFlag(MxU8 p_flag) { m_interaction &= ~p_flag; }
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
void SetWorld();
|
||||
|
||||
MxU8 m_unk0x10; // 0x10
|
||||
MxU8 m_interaction; // 0x10
|
||||
MxU8 m_flags; // 0x11
|
||||
Mx3DPointFloat m_worldLocation; // 0x14
|
||||
Mx3DPointFloat m_worldDirection; // 0x28
|
||||
|
||||
@ -49,7 +49,7 @@ class LEGO1_EXPORT LegoPlantManager : public MxCore {
|
||||
MxBool SwitchMove(LegoEntity* p_entity);
|
||||
MxBool SwitchMood(LegoEntity* p_entity);
|
||||
MxU32 GetAnimationId(LegoEntity* p_entity);
|
||||
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
|
||||
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood);
|
||||
LegoPlantInfo* GetInfoArray(MxS32& p_length);
|
||||
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId);
|
||||
MxBool DecrementCounter(LegoEntity* p_entity);
|
||||
|
||||
@ -199,10 +199,10 @@ LegoBuildingInfo g_buildingInfoInit[16] = {
|
||||
MxU32 LegoBuildingManager::g_maxSound = 6;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f373c
|
||||
MxU32 g_unk0x100f373c = 0x3c;
|
||||
MxU32 g_buildingSoundIdOffset = 0x3c;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3740
|
||||
MxU32 g_unk0x100f3740 = 0x42;
|
||||
MxU32 g_buildingSoundIdMoodOffset = 0x42;
|
||||
|
||||
// clang-format off
|
||||
// GLOBAL: LEGO1 0x100f3788
|
||||
@ -227,6 +227,8 @@ LegoBuildingInfo g_buildingInfo[16];
|
||||
// GLOBAL: LEGO1 0x100f3748
|
||||
MxS32 LegoBuildingManager::g_maxMove[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 0};
|
||||
|
||||
#define HAUS1_INDEX 12
|
||||
|
||||
// FUNCTION: LEGO1 0x1002f8b0
|
||||
void LegoBuildingManager::configureLegoBuildingManager(MxS32 p_buildingManagerConfig)
|
||||
{
|
||||
@ -461,7 +463,7 @@ MxBool LegoBuildingManager::SwitchVariant(LegoEntity* p_entity)
|
||||
|
||||
roi->SetVisibility(FALSE);
|
||||
info->m_variant = g_buildingInfoVariants[m_nextVariant];
|
||||
CreateBuilding(12, CurrentWorld());
|
||||
CreateBuilding(HAUS1_INDEX, CurrentWorld());
|
||||
|
||||
if (info->m_entity != NULL) {
|
||||
info->m_entity->GetROI()->SetVisibility(TRUE);
|
||||
@ -548,7 +550,7 @@ MxU32 LegoBuildingManager::GetAnimationId(LegoEntity* p_entity)
|
||||
|
||||
// FUNCTION: LEGO1 0x1002ff40
|
||||
// FUNCTION: BETA10 0x10064398
|
||||
MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
|
||||
MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood)
|
||||
{
|
||||
LegoBuildingInfo* info = GetInfo(p_entity);
|
||||
|
||||
@ -556,12 +558,12 @@ MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (p_state) {
|
||||
return info->m_mood + g_unk0x100f3740;
|
||||
if (p_basedOnMood) {
|
||||
return info->m_mood + g_buildingSoundIdMoodOffset;
|
||||
}
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_sound + g_unk0x100f373c;
|
||||
return info->m_sound + g_buildingSoundIdOffset;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -39,10 +39,10 @@ MxU32 g_characterAnimationId = 10;
|
||||
char* LegoCharacterManager::g_customizeAnimFile = NULL;
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4d8
|
||||
MxU32 g_soundIdOffset = 50;
|
||||
MxU32 g_characterSoundIdOffset = 50;
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4dc
|
||||
MxU32 g_soundIdMoodOffset = 66;
|
||||
MxU32 g_characterSoundIdMoodOffset = 66;
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4e8
|
||||
MxU32 g_headTextureCounter = 0;
|
||||
@ -933,16 +933,16 @@ MxU32 LegoCharacterManager::GetAnimationId(LegoROI* p_roi)
|
||||
|
||||
// FUNCTION: LEGO1 0x10085140
|
||||
// FUNCTION: BETA10 0x10076855
|
||||
MxU32 LegoCharacterManager::GetSoundId(LegoROI* p_roi, MxBool p_und)
|
||||
MxU32 LegoCharacterManager::GetSoundId(LegoROI* p_roi, MxBool p_basedOnMood)
|
||||
{
|
||||
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||
|
||||
if (p_und) {
|
||||
return info->m_mood + g_soundIdMoodOffset;
|
||||
if (p_basedOnMood) {
|
||||
return info->m_mood + g_characterSoundIdMoodOffset;
|
||||
}
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_sound + g_soundIdOffset;
|
||||
return info->m_sound + g_characterSoundIdOffset;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
|
||||
@ -40,10 +40,10 @@ MxU8 g_counters[] = {1, 2, 2, 3};
|
||||
MxU32 LegoPlantManager::g_maxSound = 8;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3160
|
||||
MxU32 g_unk0x100f3160 = 56;
|
||||
MxU32 g_plantSoundIdOffset = 56;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3164
|
||||
MxU32 g_unk0x100f3164 = 66;
|
||||
MxU32 g_plantSoundIdMoodOffset = 66;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3168
|
||||
MxS32 LegoPlantManager::g_maxMove[4] = {3, 3, 3, 3};
|
||||
@ -514,16 +514,16 @@ MxU32 LegoPlantManager::GetAnimationId(LegoEntity* p_entity)
|
||||
|
||||
// FUNCTION: LEGO1 0x10026ba0
|
||||
// FUNCTION: BETA10 0x100c61ba
|
||||
MxU32 LegoPlantManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
|
||||
MxU32 LegoPlantManager::GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood)
|
||||
{
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (p_state) {
|
||||
return (info->m_mood & 1) + g_unk0x100f3164;
|
||||
if (p_basedOnMood) {
|
||||
return (info->m_mood & 1) + g_plantSoundIdMoodOffset;
|
||||
}
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_sound + g_unk0x100f3160;
|
||||
return info->m_sound + g_plantSoundIdOffset;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -20,7 +20,7 @@ LegoActor::LegoActor()
|
||||
m_frequencyFactor = 0.0f;
|
||||
m_sound = NULL;
|
||||
m_unk0x70 = 0.0f;
|
||||
m_unk0x10 = 0;
|
||||
m_interaction = 0;
|
||||
m_actorId = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ void LegoEntity::Init()
|
||||
m_roi = NULL;
|
||||
m_cameraFlag = FALSE;
|
||||
m_siFile = NULL;
|
||||
m_unk0x10 = 0;
|
||||
m_interaction = 0;
|
||||
m_flags = 0;
|
||||
m_actionType = Extra::ActionType::e_unknown;
|
||||
m_targetEntityId = -1;
|
||||
@ -266,23 +266,23 @@ void LegoEntity::ParseAction(char* p_extra)
|
||||
|
||||
// FUNCTION: LEGO1 0x10010f10
|
||||
// FUNCTION: BETA10 0x1007ee87
|
||||
void LegoEntity::ClickSound(MxBool p_und)
|
||||
void LegoEntity::ClickSound(MxBool p_basedOnMood)
|
||||
{
|
||||
if (!GetUnknown0x10IsSet(c_altBit1)) {
|
||||
if (!IsInteraction(c_disabled)) {
|
||||
MxU32 objectId = 0;
|
||||
const char* name = m_roi->GetName();
|
||||
|
||||
switch (m_type) {
|
||||
case e_actor:
|
||||
objectId = CharacterManager()->GetSoundId(m_roi, p_und);
|
||||
objectId = CharacterManager()->GetSoundId(m_roi, p_basedOnMood);
|
||||
break;
|
||||
case e_unk1:
|
||||
break;
|
||||
case e_plant:
|
||||
objectId = PlantManager()->GetSoundId(this, p_und);
|
||||
objectId = PlantManager()->GetSoundId(this, p_basedOnMood);
|
||||
break;
|
||||
case e_building:
|
||||
objectId = BuildingManager()->GetSoundId(this, p_und);
|
||||
objectId = BuildingManager()->GetSoundId(this, p_basedOnMood);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -300,7 +300,7 @@ void LegoEntity::ClickSound(MxBool p_und)
|
||||
// FUNCTION: BETA10 0x1007f062
|
||||
void LegoEntity::ClickAnimation()
|
||||
{
|
||||
if (!GetUnknown0x10IsSet(c_altBit1)) {
|
||||
if (!IsInteraction(c_disabled)) {
|
||||
MxU32 objectId = 0;
|
||||
MxDSAction action;
|
||||
const char* name = m_roi->GetName();
|
||||
@ -332,7 +332,7 @@ void LegoEntity::ClickAnimation()
|
||||
action.SetObjectId(objectId);
|
||||
action.AppendExtra(strlen(extra) + 1, extra);
|
||||
LegoOmni::GetInstance()->GetAnimationManager()->StartEntityAction(action, this);
|
||||
m_unk0x10 |= c_altBit1;
|
||||
m_interaction |= c_disabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -697,7 +697,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
|
||||
for (MxS32 i = 0; i < numPlants; i++) {
|
||||
LegoEntity* entity = plantMgr->CreatePlant(i, NULL, LegoOmni::e_act1);
|
||||
|
||||
if (entity != NULL && !entity->GetUnknown0x10IsSet(LegoEntity::c_altBit1)) {
|
||||
if (entity != NULL && !entity->IsInteraction(LegoEntity::c_disabled)) {
|
||||
LegoROI* roi = entity->GetROI();
|
||||
|
||||
if (roi != NULL && roi->GetVisibility()) {
|
||||
|
||||
@ -793,7 +793,7 @@ void LegoAnimPresenter::StartingTickle()
|
||||
}
|
||||
|
||||
FUN_10069b10();
|
||||
FUN_1006c8a0(TRUE);
|
||||
SetDisabled(TRUE);
|
||||
|
||||
if (m_unk0x78 == NULL) {
|
||||
if (fabs(m_action->GetDirection()[0]) >= 0.00000047683716F ||
|
||||
@ -1093,7 +1093,7 @@ void LegoAnimPresenter::EndAction()
|
||||
}
|
||||
}
|
||||
|
||||
FUN_1006c8a0(FALSE);
|
||||
SetDisabled(FALSE);
|
||||
FUN_1006ab70();
|
||||
VTable0x90();
|
||||
|
||||
@ -1154,18 +1154,18 @@ void LegoAnimPresenter::VTable0x90()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006c8a0
|
||||
void LegoAnimPresenter::FUN_1006c8a0(MxBool p_bool)
|
||||
void LegoAnimPresenter::SetDisabled(MxBool p_disabled)
|
||||
{
|
||||
if (m_roiMapSize != 0 && m_roiMap != NULL) {
|
||||
for (MxU32 i = 1; i <= m_roiMapSize; i++) {
|
||||
LegoEntity* entity = m_roiMap[i]->GetEntity();
|
||||
|
||||
if (entity != NULL) {
|
||||
if (p_bool) {
|
||||
entity->SetUnknown0x10Flag(LegoEntity::c_altBit1);
|
||||
if (p_disabled) {
|
||||
entity->SetInteractionFlag(LegoEntity::c_disabled);
|
||||
}
|
||||
else {
|
||||
entity->ClearUnknown0x10Flag(LegoEntity::c_altBit1);
|
||||
entity->ClearInteractionFlag(LegoEntity::c_disabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ Hospital::Hospital()
|
||||
m_flashingLeds = 0;
|
||||
m_copLedAnimTimer = 0;
|
||||
m_pizzaLedAnimTimer = 0;
|
||||
m_unk0x128 = 0;
|
||||
m_exited = FALSE;
|
||||
NotificationManager()->Register(this);
|
||||
}
|
||||
|
||||
@ -369,8 +369,8 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
act1State = (Act1State*) GameState()->GetState("Act1State");
|
||||
act1State->SetUnknown18(9);
|
||||
case HospitalState::e_exitToFront:
|
||||
if (m_unk0x128 == 0) {
|
||||
m_unk0x128 = 1;
|
||||
if (m_exited == FALSE) {
|
||||
m_exited = TRUE;
|
||||
m_destLocation = LegoGameState::e_hospitalExited;
|
||||
|
||||
DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim);
|
||||
@ -378,8 +378,8 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
}
|
||||
break;
|
||||
case HospitalState::e_exitToInfocenter:
|
||||
if (m_unk0x128 == 0) {
|
||||
m_unk0x128 = 1;
|
||||
if (m_exited == FALSE) {
|
||||
m_exited = TRUE;
|
||||
m_destLocation = LegoGameState::e_infomain;
|
||||
|
||||
DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim);
|
||||
@ -412,8 +412,8 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
|
||||
m_interactionMode = 3;
|
||||
|
||||
if (m_hospitalState->m_state == HospitalState::e_explainQuestShort) {
|
||||
if (m_unk0x128 == 0) {
|
||||
m_unk0x128 = 1;
|
||||
if (m_exited == FALSE) {
|
||||
m_exited = TRUE;
|
||||
|
||||
TickleManager()->UnregisterClient(this);
|
||||
|
||||
@ -568,8 +568,8 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
m_currentAction = HospitalScript::c_hho016cl_RunAnim;
|
||||
m_setWithCurrentAction = 1;
|
||||
}
|
||||
else if (m_unk0x128 == 0) {
|
||||
m_unk0x128 = 1;
|
||||
else if (m_exited == FALSE) {
|
||||
m_exited = TRUE;
|
||||
m_hospitalState->m_state = HospitalState::e_exitImmediately;
|
||||
m_destLocation = LegoGameState::e_infomain;
|
||||
|
||||
@ -589,8 +589,8 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
m_currentAction = HospitalScript::c_hho016cl_RunAnim;
|
||||
m_setWithCurrentAction = 1;
|
||||
}
|
||||
else if (m_unk0x128 == 0) {
|
||||
m_unk0x128 = 1;
|
||||
else if (m_exited == FALSE) {
|
||||
m_exited = TRUE;
|
||||
m_hospitalState->m_state = HospitalState::e_exitImmediately;
|
||||
m_destLocation = LegoGameState::e_hospitalExited;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user