f_op_kankyo_mng close

This commit is contained in:
Jasper St. Pierre
2023-09-11 20:41:42 -07:00
parent 862b852620
commit bf5c15e70a
8 changed files with 126 additions and 31 deletions
+88 -17
View File
@@ -3,12 +3,36 @@
// Translation Unit: d_a_andsw0.cpp
//
#include "d_a_andsw0.h"
#include "dolphin/types.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "f_op/f_op_actor_mng.h"
#include "d/d_com_inf_game.h"
enum {
ACT_ON_ALL = 0,
ACT_OFF_ALL,
ACT_WAIT = 10,
ACT_TIMER = 20,
ACT_TIMER2,
ACT_TIMER_SET = 30,
};
struct andsw0_class : public fopAc_ac_c {
public:
/* 0x290 */ u32 _pad[2];
/* 0x298 */ u8 mAction;
/* 0x299 */ u8 mNumSwitchesToCheck;
/* 0x29A */ u8 mBehaviorType;
/* 0x29B */ u8 mSwitchToSet;
/* 0x29C */ u8 mFirstSwitchToCheck;
/* 0x29E */ u16 mTimer;
/* 0x2A0 */ u16 mEventMapToolNo;
/* 0x292 */ u8 mEventIdx;
/* 0x293 */ u8 mEventState;
};
/* 00000078-00000080 .text daAndsw0_Draw__FP12andsw0_class */
void daAndsw0_Draw(andsw0_class*) {
/* Nonmatching */
s32 daAndsw0_Draw(andsw0_class*) {
return 1;
}
/* 00000080-000003C4 .text daAndsw0_check__FP12andsw0_class */
@@ -37,37 +61,84 @@ void bb_s_sub(void*, void*) {
}
/* 000005D4-000006AC .text hajimari_actor_entry__FP12andsw0_class */
void hajimari_actor_entry(andsw0_class*) {
s32 hajimari_actor_entry(andsw0_class*) {
/* Nonmatching */
}
/* 000006AC-0000081C .text hajimarinomori_check__FP12andsw0_class */
void hajimarinomori_check(andsw0_class*) {
/* Nonmatching */
void hajimarinomori_check(andsw0_class* i_this) {
if (i_this->mBehaviorType == 0) {
if (hajimari_actor_entry(i_this))
i_this->mBehaviorType = 1;
} else {
if (dComIfGs_isEventBit(4)) {
//
}
}
}
/* 0000081C-00000914 .text event_start_check__FP12andsw0_class */
void event_start_check(andsw0_class*) {
/* Nonmatching */
static void event_start_check(andsw0_class* i_this) {
switch (i_this->mEventState) {
case 0:
default:
if (i_this->mEventIdx != -1 && i_fopAcM_isSwitch(i_this, i_this->mSwitchToSet)) {
if (i_this->mEvtInfo.i_checkCommandDemoAccrpt()) {
i_this->mEventState++;
} else {
fopAcM_orderOtherEventId(i_this, i_this->mEventIdx, i_this->mEventMapToolNo, 0xFFFF, 0, 1);
}
}
case 1:
if (dComIfGp_evmng_endCheck(i_this->mEventIdx)) {
dComIfGp_event_onEventFlag(8);
i_this->mEventState++;
}
break;
}
}
/* 00000914-00000964 .text daAndsw0_Execute__FP12andsw0_class */
void daAndsw0_Execute(andsw0_class*) {
/* Nonmatching */
s32 daAndsw0_Execute(andsw0_class* i_this) {
event_start_check(i_this);
if (i_this->mNumSwitchesToCheck == 0xFF)
hajimarinomori_check(i_this);
else
daAndsw0_check(i_this);
return 1;
}
/* 00000964-0000096C .text daAndsw0_IsDelete__FP12andsw0_class */
void daAndsw0_IsDelete(andsw0_class*) {
/* Nonmatching */
s32 daAndsw0_IsDelete(andsw0_class*) {
return 1;
}
/* 0000096C-00000974 .text daAndsw0_Delete__FP12andsw0_class */
void daAndsw0_Delete(andsw0_class*) {
/* Nonmatching */
s32 daAndsw0_Delete(andsw0_class*) {
return 1;
}
/* 00000974-00000A64 .text daAndsw0_Create__FP10fopAc_ac_c */
void daAndsw0_Create(fopAc_ac_c*) {
/* Nonmatching */
s32 daAndsw0_Create(fopAc_ac_c* ac) {
fopAcM_SetupActor(ac, andsw0_class);
andsw0_class * i_this = (andsw0_class *)ac;
i_this->mNumSwitchesToCheck = (fopAcM_GetParam(ac) >> 0) & 0xFF;
i_this->mBehaviorType = (fopAcM_GetParam(ac) >> 8) & 0xFF;
i_this->mSwitchToSet = (fopAcM_GetParam(ac) >> 24) & 0xFF;
i_this->mFirstSwitchToCheck = (fopAcM_GetParam(ac) >> 16) & 0xFF;
i_this->mTimer = (i_this->orig.angle.z & 0xFF) * 16;
i_this->mEventMapToolNo = i_this->orig.angle.x;
i_this->mEventIdx = dComIfGp_evmng_getEventIdx(NULL, i_this->mEventMapToolNo);
if (i_this->mBehaviorType == 2)
i_this->mAction = ACT_TIMER;
if (i_this->mFirstSwitchToCheck == 0xFF)
i_this->mFirstSwitchToCheck = 0;
if (i_this->mNumSwitchesToCheck == 0xFF) {
i_this->mSwitchToSet = 0;
i_this->mBehaviorType = 0;
}
return cPhs_COMPLEATE_e;
}
+1 -2
View File
@@ -164,14 +164,13 @@ static s32 daAndsw2_actionOrder(daAndsw2_c* i_this) {
/* 00000438-000004BC .text daAndsw2_actionEvent__FP10daAndsw2_c */
static s32 daAndsw2_actionEvent(daAndsw2_c* i_this) {
dComIfG_play_c* play = &g_dComIfG_gameInfo.play;
if (dComIfGp_evmng_endCheck(i_this->mEventIdx)) {
if (i_this->getType() == TYPE_CONTINUOUS) {
i_this->mAction = ACT_OFF;
} else {
i_this->mAction = ACT_WAIT;
}
play->mEvtCtrl.mStateFlags |= 8;
dComIfGp_event_onEventFlag(8);
}
return 1;
}
+2 -1
View File
@@ -7,6 +7,7 @@
#include "f_op/f_op_kankyo.h"
#include "f_pc/f_pc_executor.h"
#include "d/d_procname.h"
#include "d/d_com_inf_game.h"
#include "SSystem/SComponent/c_malloc.h"
#include "SSystem/SComponent/c_lib.h"
@@ -98,6 +99,6 @@ int fopKyM_createMpillar(cXyz const* i_pos, f32 i_size) {
scale.x = i_size;
scale.y = i_size;
scale.z = i_size;
// dComIfGp_particle_set(0x80d5, i_pos, NULL, &scale);
dComIfGp_particle_set(0x80d5, i_pos, NULL, &scale);
return -1;
}