mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Clear unknown 0x10 in LegoEntity
(#1593)
The naming is a bit weird, as only one bit is used so there are no other usages of this value.
This commit is contained in:
@@ -121,7 +121,7 @@ protected:
|
|||||||
void SubstituteVariables();
|
void SubstituteVariables();
|
||||||
void FUN_1006b900(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
|
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_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
|
LegoAnim* m_anim; // 0x64
|
||||||
LegoROI** m_roiMap; // 0x68
|
LegoROI** m_roiMap; // 0x68
|
||||||
|
@@ -28,7 +28,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
c_altBit1 = 0x01
|
c_disabled = 0x01
|
||||||
};
|
};
|
||||||
|
|
||||||
LegoEntity() { Init(); }
|
LegoEntity() { Init(); }
|
||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
Mx3DPointFloat GetWorldUp();
|
Mx3DPointFloat GetWorldUp();
|
||||||
Mx3DPointFloat GetWorldPosition();
|
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; }
|
MxBool GetFlagsIsSet(MxU8 p_flag) { return m_flags & p_flag; }
|
||||||
MxU8 GetFlags() { return m_flags; }
|
MxU8 GetFlags() { return m_flags; }
|
||||||
|
|
||||||
@@ -101,14 +101,14 @@ public:
|
|||||||
void SetFlags(MxU8 p_flags) { m_flags = p_flags; }
|
void SetFlags(MxU8 p_flags) { m_flags = p_flags; }
|
||||||
void SetFlag(MxU8 p_flag) { m_flags |= p_flag; }
|
void SetFlag(MxU8 p_flag) { m_flags |= p_flag; }
|
||||||
void ClearFlag(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 SetInteractionFlag(MxU8 p_flag) { m_interaction |= p_flag; }
|
||||||
void ClearUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 &= ~p_flag; }
|
void ClearInteractionFlag(MxU8 p_flag) { m_interaction &= ~p_flag; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Init();
|
void Init();
|
||||||
void SetWorld();
|
void SetWorld();
|
||||||
|
|
||||||
MxU8 m_unk0x10; // 0x10
|
MxU8 m_interaction; // 0x10
|
||||||
MxU8 m_flags; // 0x11
|
MxU8 m_flags; // 0x11
|
||||||
Mx3DPointFloat m_worldLocation; // 0x14
|
Mx3DPointFloat m_worldLocation; // 0x14
|
||||||
Mx3DPointFloat m_worldDirection; // 0x28
|
Mx3DPointFloat m_worldDirection; // 0x28
|
||||||
|
@@ -18,7 +18,7 @@ LegoActor::LegoActor()
|
|||||||
m_frequencyFactor = 0.0f;
|
m_frequencyFactor = 0.0f;
|
||||||
m_sound = NULL;
|
m_sound = NULL;
|
||||||
m_unk0x70 = 0.0f;
|
m_unk0x70 = 0.0f;
|
||||||
m_unk0x10 = 0;
|
m_interaction = 0;
|
||||||
m_actorId = 0;
|
m_actorId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ void LegoEntity::Init()
|
|||||||
m_roi = NULL;
|
m_roi = NULL;
|
||||||
m_cameraFlag = FALSE;
|
m_cameraFlag = FALSE;
|
||||||
m_siFile = NULL;
|
m_siFile = NULL;
|
||||||
m_unk0x10 = 0;
|
m_interaction = 0;
|
||||||
m_flags = 0;
|
m_flags = 0;
|
||||||
m_actionType = Extra::ActionType::e_unknown;
|
m_actionType = Extra::ActionType::e_unknown;
|
||||||
m_targetEntityId = -1;
|
m_targetEntityId = -1;
|
||||||
@@ -265,7 +265,7 @@ void LegoEntity::ParseAction(char* p_extra)
|
|||||||
// FUNCTION: BETA10 0x1007ee87
|
// FUNCTION: BETA10 0x1007ee87
|
||||||
void LegoEntity::ClickSound(MxBool p_und)
|
void LegoEntity::ClickSound(MxBool p_und)
|
||||||
{
|
{
|
||||||
if (!GetUnknown0x10IsSet(c_altBit1)) {
|
if (!IsInteraction(c_disabled)) {
|
||||||
MxU32 objectId = 0;
|
MxU32 objectId = 0;
|
||||||
const char* name = m_roi->GetName();
|
const char* name = m_roi->GetName();
|
||||||
|
|
||||||
@@ -297,7 +297,7 @@ void LegoEntity::ClickSound(MxBool p_und)
|
|||||||
// FUNCTION: BETA10 0x1007f062
|
// FUNCTION: BETA10 0x1007f062
|
||||||
void LegoEntity::ClickAnimation()
|
void LegoEntity::ClickAnimation()
|
||||||
{
|
{
|
||||||
if (!GetUnknown0x10IsSet(c_altBit1)) {
|
if (!IsInteraction(c_disabled)) {
|
||||||
MxU32 objectId = 0;
|
MxU32 objectId = 0;
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
const char* name = m_roi->GetName();
|
const char* name = m_roi->GetName();
|
||||||
@@ -329,7 +329,7 @@ void LegoEntity::ClickAnimation()
|
|||||||
action.SetObjectId(objectId);
|
action.SetObjectId(objectId);
|
||||||
action.AppendExtra(strlen(extra) + 1, extra);
|
action.AppendExtra(strlen(extra) + 1, extra);
|
||||||
LegoOmni::GetInstance()->GetAnimationManager()->StartEntityAction(action, this);
|
LegoOmni::GetInstance()->GetAnimationManager()->StartEntityAction(action, this);
|
||||||
m_unk0x10 |= c_altBit1;
|
m_interaction |= c_disabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -691,7 +691,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
|
|||||||
for (MxS32 i = 0; i < numPlants; i++) {
|
for (MxS32 i = 0; i < numPlants; i++) {
|
||||||
LegoEntity* entity = plantMgr->CreatePlant(i, NULL, LegoOmni::e_act1);
|
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();
|
LegoROI* roi = entity->GetROI();
|
||||||
|
|
||||||
if (roi != NULL && roi->GetVisibility()) {
|
if (roi != NULL && roi->GetVisibility()) {
|
||||||
|
@@ -790,7 +790,7 @@ void LegoAnimPresenter::StartingTickle()
|
|||||||
}
|
}
|
||||||
|
|
||||||
FUN_10069b10();
|
FUN_10069b10();
|
||||||
FUN_1006c8a0(TRUE);
|
SetDisabled(TRUE);
|
||||||
|
|
||||||
if (m_unk0x78 == NULL) {
|
if (m_unk0x78 == NULL) {
|
||||||
if (fabs(m_action->GetDirection()[0]) >= 0.00000047683716F ||
|
if (fabs(m_action->GetDirection()[0]) >= 0.00000047683716F ||
|
||||||
@@ -1090,7 +1090,7 @@ void LegoAnimPresenter::EndAction()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FUN_1006c8a0(FALSE);
|
SetDisabled(FALSE);
|
||||||
FUN_1006ab70();
|
FUN_1006ab70();
|
||||||
VTable0x90();
|
VTable0x90();
|
||||||
|
|
||||||
@@ -1151,18 +1151,18 @@ void LegoAnimPresenter::VTable0x90()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1006c8a0
|
// FUNCTION: LEGO1 0x1006c8a0
|
||||||
void LegoAnimPresenter::FUN_1006c8a0(MxBool p_bool)
|
void LegoAnimPresenter::SetDisabled(MxBool p_disabled)
|
||||||
{
|
{
|
||||||
if (m_roiMapSize != 0 && m_roiMap != NULL) {
|
if (m_roiMapSize != 0 && m_roiMap != NULL) {
|
||||||
for (MxU32 i = 1; i <= m_roiMapSize; i++) {
|
for (MxU32 i = 1; i <= m_roiMapSize; i++) {
|
||||||
LegoEntity* entity = m_roiMap[i]->GetEntity();
|
LegoEntity* entity = m_roiMap[i]->GetEntity();
|
||||||
|
|
||||||
if (entity != NULL) {
|
if (entity != NULL) {
|
||||||
if (p_bool) {
|
if (p_disabled) {
|
||||||
entity->SetUnknown0x10Flag(LegoEntity::c_altBit1);
|
entity->SetInteractionFlag(LegoEntity::c_disabled);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
entity->ClearUnknown0x10Flag(LegoEntity::c_altBit1);
|
entity->ClearInteractionFlag(LegoEntity::c_disabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user