Implement dCom attention inlines

This commit is contained in:
LagoLunatic
2025-03-01 00:48:29 -05:00
parent 6c6b5a95ac
commit 6e83a87f42
12 changed files with 79 additions and 34 deletions
+13 -8
View File
@@ -1,7 +1,6 @@
#ifndef D_D_ATTENTION_H
#define D_D_ATTENTION_H
#include "SSystem/SComponent/c_angle.h"
#include "m_Do/m_Do_ext.h"
class fopAc_ac_c;
@@ -171,15 +170,28 @@ public:
void setFlag(u32 flag) { mFlags |= flag; }
void clrFlag(u32 flag) { mFlags &= ~flag; }
bool Lockon() { return LockonTruth() || chkFlag(0x20000000); } // regswap
void offAleart() {
setFlag(0x80000000);
}
void revivalAleart() {
clrFlag(0x80000000);
}
void CatchRequest(fopAc_ac_c* param_0, u8 param_1, f32 param_2, f32 param_3,
f32 param_4, s16 param_5, int param_6) {
mCatch.request(param_0, param_1, param_2, param_3, param_4, param_5, param_6);
}
u8 getCatchChgItem() { return mCatch.getChangeItem(); }
fopAc_ac_c* getCatghTarget() { return mCatch.getCatghTarget(); }
fopAc_ac_c* getLookTarget() { return mLook[0].convPId(mLook[0].getLookTarget()); }
fopAc_ac_c* getLook2Target() { return mLook[1].convPId(mLook[1].getLookTarget()); }
fopAc_ac_c* getZHintTarget() { return mHint.getZHintTarget(); }
int ZHintRequest(fopAc_ac_c* param_1, int param_2) {
return mHint.request(param_1, param_2);
}
static s32 loc_type_num;
static u32 act_type_num;
static struct LocTbl {
@@ -201,15 +213,8 @@ public:
void LockEdge() {}
void changeOwner() {}
void chkEnemySound() {}
u8 getCatchChgItem() { return mCatch.getChangeItem(); }
void getCatghTarget() {}
void offAleart() {}
void revivalAleart() {
clrFlag(0x80000000);
}
void LookRequest(fopAc_ac_c*, f32, f32, f32, s16, int) {}
void Look2RequestF(fopAc_ac_c*, s16, int) {}
void ZHintRequest(fopAc_ac_c*, int) {}
public:
/* 0x000 */ daPy_lk_c* mpPlayer;
+48 -12
View File
@@ -2135,14 +2135,6 @@ inline dVibration_c& dComIfGp_getVibration() {
return g_dComIfG_gameInfo.play.getVibration();
}
inline dAttention_c& dComIfGp_getAttention() {
return g_dComIfG_gameInfo.play.getAttention();
}
inline void dComIfGp_att_revivalAleart() {
return dComIfGp_getAttention().revivalAleart();
}
inline dDetect_c& dComIfGp_getDetect() {
return g_dComIfG_gameInfo.play.getDetect();
}
@@ -3494,14 +3486,58 @@ inline s32 dComIfGp_particle_checkAtrCodeEffect(int code) { return g_dComIfG_gam
* === ATTENTION ===
*/
inline dAttention_c& dComIfGp_getAttention() {
return g_dComIfG_gameInfo.play.getAttention();
}
inline void dComIfGp_att_revivalAleart() {
dComIfGp_getAttention().revivalAleart();
}
inline void dComIfGp_att_offAleart() {
dComIfGp_getAttention().offAleart();
}
inline int dComIfGp_att_ZHintRequest(fopAc_ac_c* param_1, int param_2) {
return dComIfGp_getAttention().ZHintRequest(param_1, param_2);
}
inline void dComIfGp_att_LookRequest(fopAc_ac_c* param_0, f32 i_horizontalDist, f32 i_upDist,
f32 i_downDist, s16 i_angle, int param_5) {
dComIfGp_getAttention().LookRequest(param_0, i_horizontalDist, i_upDist, i_downDist, i_angle, param_5);
}
inline void dComIfGp_att_Look2RequestF(fopAc_ac_c* param_0, s16 param_1, int param_2) {
dComIfGp_getAttention().Look2RequestF(param_0, param_1, param_2);
}
inline void dComIfGp_att_CatchRequest(fopAc_ac_c* param_0, u8 param_1, f32 param_2, f32 param_3,
f32 param_4, s16 param_5, s32 param_6) {
dAttention_c& attention = g_dComIfG_gameInfo.play.getAttention();
attention.CatchRequest(param_0, param_1, param_2, param_3, param_4,param_5, param_6);
f32 param_4, s16 param_5, int param_6) {
dComIfGp_getAttention().CatchRequest(param_0, param_1, param_2, param_3, param_4,param_5, param_6);
}
inline u8 dComIfGp_att_getCatchChgItem() {
return g_dComIfG_gameInfo.play.getAttention().getCatchChgItem();
return dComIfGp_getAttention().getCatchChgItem();
}
inline fopAc_ac_c* dComIfGp_att_getCatghTarget() {
return dComIfGp_getAttention().getCatghTarget();
}
inline void dComIfGp_att_ChangeOwner() {
dComIfGp_getAttention().setFlag(0x80);
}
inline fopAc_ac_c* dComIfGp_att_getLookTarget() {
return dComIfGp_getAttention().getLookTarget();
}
inline fopAc_ac_c* dComIfGp_att_getZHint() {
return dComIfGp_getAttention().getZHintTarget();
}
inline void dComIfGp_att_chkEnemySound() {
return dComIfGp_getAttention().chkEnemySound();
}
/**
+1 -1
View File
@@ -203,7 +203,7 @@ BOOL daNh_c::checkBinCatch() {
return TRUE;
}
dComIfGp_getAttention().CatchRequest(
dComIfGp_att_CatchRequest(
this, dItem_FIREFLY_BOTTLE_e,
l_HIO.prm.field_0x08, l_HIO.prm.field_0x0c,
l_HIO.prm.field_0x10, l_HIO.prm.field_0x3c,
+1
View File
@@ -12,6 +12,7 @@
#include "f_op/f_op_actor_mng.h"
#include "m_Do/m_Do_ext.h"
#include "m_Do/m_Do_mtx.h"
#include "SSystem/SComponent/c_angle.h"
#include "weak_bss_936_to_1036.h" // IWYU pragma: keep
#include "weak_data_1811.h" // IWYU pragma: keep
+1 -1
View File
@@ -3389,7 +3389,7 @@ BOOL daNpc_Ji1_c::CreateInit() {
}
}
dComIfGp_getAttention().setFlag(0x80000000);
dComIfGp_att_offAleart();
mEventCut.setActorInfo("Ji1", this);
mEventCut.setJntCtrlPtr(&m_jnt);
field_0xC84 = 0x12;
+1 -1
View File
@@ -3170,7 +3170,7 @@ BOOL daNpc_Md_c::draw() {
J3DModel* model = mpMorf->getModel();
J3DModelData* modelData = model->getModelData();
g_env_light.settingTevStruct(0, &current.pos, &tevStr);
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
drawDamageFog();
g_env_light.setLightTevColorType(model, &tevStr);
m0520.entry(modelData);
+3 -3
View File
@@ -316,7 +316,7 @@ s32 daObjMknjD::Act_c::Mthd_Create() {
/* 00000B64-00000BDC .text Delete__Q210daObjMknjD5Act_cFv */
int daObjMknjD::Act_c::Delete() {
dComIfGp_getAttention().mFlags &= 0x7fffffff;
dComIfGp_att_revivalAleart();
for (int i = 0; i < 4; i++) {
mSmokeCBs[i].end();
@@ -801,7 +801,7 @@ int daObjMknjD::Act_c::Execute(Mtx** i_mtx) {
mDoAud_bgmStop(30);
mDoAud_taktModeMuteOff();
dComIfGp_getAttention().mFlags |= 0x80000000;
dComIfGp_att_offAleart();
if (m043E == true) {
m0432 = 0x2B;
@@ -818,7 +818,7 @@ int daObjMknjD::Act_c::Execute(Mtx** i_mtx) {
privateCut();
if (dComIfGp_evmng_endCheck(mDemoEventIdx)) {
dComIfGp_getAttention().mFlags &= ~0x80000000;
dComIfGp_att_revivalAleart();
dComIfGp_event_reset();
fopAcM_delete(this);
+1 -1
View File
@@ -19,7 +19,7 @@ void daPy_py_c::changePlayer(fopAc_ac_c* newPlayer) {
}
dComIfGp_setPlayer(0, newPlayer);
dComIfGp_getCamera(0)->mCamera.mpPlayerActor = newPlayer;
dComIfGp_getAttention().mFlags |= 0x80;
dComIfGp_att_ChangeOwner();
}
/* 80102940-80102B84 .text objWindHitCheck__9daPy_py_cFP8dCcD_Cyl */
+1 -1
View File
@@ -3383,7 +3383,7 @@ BOOL daPy_lk_c::execute() {
setActorPointer();
setAtnList();
fopAc_ac_c* zTarget = dComIfGp_getAttention().getZHintTarget();
fopAc_ac_c* zTarget = dComIfGp_att_getZHint();
if (zTarget) {
stopDoButtonQuake(FALSE);
} else {
+2 -1
View File
@@ -13,6 +13,7 @@
#include "f_op/f_op_actor_mng.h"
#include "m_Do/m_Do_mtx.h"
#include "SSystem/SComponent/c_lib.h"
#include "SSystem/SComponent/c_angle.h"
#include "weak_bss_936_to_1036.h" // IWYU pragma: keep
#include "weak_data_1811.h" // IWYU pragma: keep
@@ -478,7 +479,7 @@ static BOOL daSail_Draw(sail_class* i_this) {
i_this->tevStr = l_p_ship->tevStr;
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &i_this->current.pos, &i_this->tevStr);
g_env_light.setLightTevColorType(i_this->mSailPacket.mStickModel, &i_this->tevStr);
mDoExt_modelUpdateDL(i_this->mSailPacket.mStickModel);
+6 -5
View File
@@ -11,6 +11,7 @@
#include "d/d_s_play.h"
#include "m_Do/m_Do_ext.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "SSystem/SComponent/c_angle.h"
s32 dAttention_c::loc_type_num = 3;
u32 dAttention_c::act_type_num = 5;
@@ -378,12 +379,12 @@ void dAttention_c::stockAttention(u32 interactMask) {
if (pTarget != mLockOnList[0].getActor()) {
if (pTarget != NULL) {
if (mLockOnList[0].getActor() != NULL)
mFlags |= 2;
setFlag(0x02);
} else {
mFlags |= 1;
setFlag(0x01);
}
mFlags |= 4;
setFlag(0x04);
}
LockonTarget(0);
@@ -452,12 +453,12 @@ BOOL sound_attention(fopAc_ac_c* actor, void* userWork) {
void dAttention_c::runSoundProc() {
mEnemyBsPcId = fpcM_ERROR_PROCESS_ID_e;
mEnemyDistance = 10000.0f;
if (!(mFlags & 0x80000000)) {
if (!chkFlag(0x80000000)) {
fopAcIt_Executor((fopAcIt_ExecutorFunc)sound_attention, this);
fopAc_ac_c* actor = fopAcM_SearchByID(mEnemyBsPcId);
if (actor != NULL) {
mDoAud_bgmNowBattle(mEnemyDistance * 0.1f);
mFlags |= 0x100;
setFlag(0x100);
}
}
}
+1
View File
@@ -9,6 +9,7 @@
#include "d/res/res_key.h"
#include "d/res/res_hkyo.h"
#include "d/actor/d_a_player.h"
#include "SSystem/SComponent/c_angle.h"
/* 8006B39C-8006B3A8 .text getSwbit__12dDoor_info_cFv */
u8 dDoor_info_c::getSwbit() {