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:
Fabian Neundorf
2025-06-28 16:28:13 +02:00
committed by GitHub
parent 16a94c725c
commit 89539a64f1
6 changed files with 18 additions and 18 deletions

View File

@@ -121,7 +121,7 @@ protected:
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

View File

@@ -28,7 +28,7 @@ public:
};
enum {
c_altBit1 = 0x01
c_disabled = 0x01
};
LegoEntity() { Init(); }
@@ -83,7 +83,7 @@ public:
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 @@ public:
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

View File

@@ -18,7 +18,7 @@ LegoActor::LegoActor()
m_frequencyFactor = 0.0f;
m_sound = NULL;
m_unk0x70 = 0.0f;
m_unk0x10 = 0;
m_interaction = 0;
m_actorId = 0;
}

View File

@@ -29,7 +29,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;
@@ -265,7 +265,7 @@ void LegoEntity::ParseAction(char* p_extra)
// FUNCTION: BETA10 0x1007ee87
void LegoEntity::ClickSound(MxBool p_und)
{
if (!GetUnknown0x10IsSet(c_altBit1)) {
if (!IsInteraction(c_disabled)) {
MxU32 objectId = 0;
const char* name = m_roi->GetName();
@@ -297,7 +297,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();
@@ -329,7 +329,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;
}
}
}

View File

@@ -691,7 +691,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()) {

View File

@@ -790,7 +790,7 @@ void LegoAnimPresenter::StartingTickle()
}
FUN_10069b10();
FUN_1006c8a0(TRUE);
SetDisabled(TRUE);
if (m_unk0x78 == NULL) {
if (fabs(m_action->GetDirection()[0]) >= 0.00000047683716F ||
@@ -1090,7 +1090,7 @@ void LegoAnimPresenter::EndAction()
}
}
FUN_1006c8a0(FALSE);
SetDisabled(FALSE);
FUN_1006ab70();
VTable0x90();
@@ -1151,18 +1151,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);
}
}
}