mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-17 04:31:37 -04:00
Daswc (#2398)
* swball cleanup * daSwc00_c OK * Revert change in configure - we'll handle rel/dol changes in seperate PR
This commit is contained in:
+270
-237
@@ -4,318 +4,351 @@
|
||||
*/
|
||||
|
||||
#include "d/actor/d_a_swc00.h"
|
||||
#include "d/actor/d_a_player.h"
|
||||
#include "d/actor/d_a_horse.h"
|
||||
#include "d/d_debug_viewer.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include "dol2asm.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" static void hitCheck__FP9daSwc00_c();
|
||||
extern "C" static void daSwc00_Execute__FP9daSwc00_c();
|
||||
extern "C" void execute__9daSwc00_cFv();
|
||||
extern "C" void event_proc_call__9daSwc00_cFv();
|
||||
extern "C" void actionWait__9daSwc00_cFv();
|
||||
extern "C" void actionOrderEvent__9daSwc00_cFv();
|
||||
extern "C" void actionEvent__9daSwc00_cFv();
|
||||
extern "C" void actionDead__9daSwc00_cFv();
|
||||
extern "C" static bool daSwc00_IsDelete__FP9daSwc00_c();
|
||||
extern "C" static bool daSwc00_Delete__FP9daSwc00_c();
|
||||
extern "C" static void daSwc00_Create__FP10fopAc_ac_c();
|
||||
extern "C" extern char const* const d_a_swc00__stringBase0;
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void mDoMtx_YrotS__FPA4_fs();
|
||||
extern "C" void __ct__10fopAc_ac_cFv();
|
||||
extern "C" void fopAcM_delete__FP10fopAc_ac_c();
|
||||
extern "C" void fopAcM_searchActorDistanceXZ2__FPC10fopAc_ac_cPC10fopAc_ac_c();
|
||||
extern "C" void fopAcM_orderOtherEventId__FP10fopAc_ac_csUcUsUsUs();
|
||||
extern "C" void onSwitch__10dSv_info_cFii();
|
||||
extern "C" void offSwitch__10dSv_info_cFii();
|
||||
extern "C" void isSwitch__10dSv_info_cCFii();
|
||||
extern "C" void reset__14dEvt_control_cFv();
|
||||
extern "C" void getEventIdx__16dEvent_manager_cFP10fopAc_ac_cUc();
|
||||
extern "C" void endCheck__16dEvent_manager_cFs();
|
||||
extern "C" void __mi__4cXyzCFRC3Vec();
|
||||
extern "C" void __ptmf_scall();
|
||||
extern "C" u8 now__14mDoMtx_stack_c[48];
|
||||
extern "C" extern u8 data_805A1F28[4];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 805A1D94-805A1D98 000000 0004+00 2/2 0/0 0/0 .rodata @3708 */
|
||||
SECTION_RODATA static f32 const lit_3708 = -100.0f;
|
||||
COMPILER_STRIP_GATE(0x805A1D94, &lit_3708);
|
||||
|
||||
inline u8 daSwc00_getCondition(daSwc00_c* i_this) {
|
||||
return i_this->shape_angle.x;
|
||||
}
|
||||
|
||||
inline int daSwc00_getShape(daSwc00_c* i_this) {
|
||||
return (fopAcM_GetParam(i_this) >> 0x12) & 3;
|
||||
}
|
||||
|
||||
/* 805A13F8-805A15DC 000078 01E4+00 1/1 0/0 0/0 .text hitCheck__FP9daSwc00_c */
|
||||
// NONMATCHING - r30 / r31 swap
|
||||
static bool hitCheck(daSwc00_c* i_swc) {
|
||||
fopAc_ac_c* playerAc = (fopAc_ac_c*)daPy_getPlayerActorClass();
|
||||
static BOOL hitCheck(daSwc00_c* i_swc) {
|
||||
fopAc_ac_c* a_this = i_swc;
|
||||
fopAc_ac_c* playerAc = daPy_getPlayerActorClass();
|
||||
fopAc_ac_c* player;
|
||||
|
||||
if (daSwc00_getCondition(i_swc) == 2) {
|
||||
player = (fopAc_ac_c*)dComIfGp_getHorseActor();
|
||||
u8 condition = daSwc00_getCondition(i_swc);
|
||||
if (condition == 2) {
|
||||
player = dComIfGp_getHorseActor();
|
||||
} else {
|
||||
player = playerAc;
|
||||
}
|
||||
|
||||
if (player == NULL) {
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int shape = daSwc00_getShape(i_swc);
|
||||
if (shape == 3) {
|
||||
f32 xz_dist = fopAcM_searchActorDistanceXZ2(i_swc, player);
|
||||
f32 y_dist = fopAcM_searchActorDistanceY(i_swc, player);
|
||||
f32 xz_dist = fopAcM_searchActorDistanceXZ2(a_this, player);
|
||||
f32 y_dist = fopAcM_searchActorDistanceY(a_this, player);
|
||||
|
||||
if (xz_dist < i_swc->scale.x && -100.0f < y_dist && y_dist < i_swc->scale.y) {
|
||||
return true;
|
||||
if (xz_dist < a_this->scale.x && -100.0f < y_dist && y_dist < a_this->scale.y) {
|
||||
return TRUE;
|
||||
}
|
||||
} else if (shape == 0) {
|
||||
cXyz tmp1 = i_swc->field_0x568 - i_swc->current.pos;
|
||||
cXyz tmp2 = i_swc->field_0x574 - i_swc->current.pos;
|
||||
cXyz player_dist = player->current.pos - i_swc->current.pos;
|
||||
cXyz tmp1 = i_swc->field_0x568 - a_this->current.pos;
|
||||
cXyz tmp2 = i_swc->field_0x574 - a_this->current.pos;
|
||||
cXyz player_dist = player->current.pos - a_this->current.pos;
|
||||
|
||||
mDoMtx_stack_c::YrotS(-i_swc->current.angle.y);
|
||||
mDoMtx_stack_c::YrotS(-a_this->current.angle.y);
|
||||
mDoMtx_stack_c::multVec(&player_dist, &player_dist);
|
||||
|
||||
if ((tmp1.x <= player_dist.x && player_dist.x <= tmp2.x) &&
|
||||
(tmp1.y <= player_dist.y && player_dist.y <= tmp2.y) &&
|
||||
(tmp1.z <= player_dist.z && player_dist.z <= tmp2.z)) {
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
int daSwc00_Draw(daSwc00_c* i_this) {
|
||||
fopAc_ac_c* a_this = i_this;
|
||||
if (g_envHIO.mOther.field_0x46) {
|
||||
int shape = daSwc00_getShape(i_this);
|
||||
if (shape == 3) {
|
||||
GXColor local_44 = {0, 0, 0xff, 0xa0};
|
||||
GXColor* pColor = &local_44;
|
||||
dDbVw_drawCylinderXlu(a_this->current.pos, JMAFastSqrt(a_this->scale.x) - 30.0f, a_this->scale.y, *pColor, 1);
|
||||
} else if (shape == 0) {
|
||||
cXyz cStack_2c = i_this->field_0x574 - i_this->field_0x568;
|
||||
cStack_2c *= 0.5f;
|
||||
cXyz cStack_38 = i_this->field_0x568 + cStack_2c;
|
||||
csXyz cStack_40(0, 0, 0);
|
||||
cStack_40 = a_this->current.angle;
|
||||
GXColor local_48 = {0, 0, 0xff, 0xa0};
|
||||
GXColor* pColor = &local_48;
|
||||
dDbVw_drawCubeXlu(cStack_38, cStack_2c, cStack_40, *pColor);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* 805A15DC-805A15FC 00025C 0020+00 1/0 0/0 0/0 .text daSwc00_Execute__FP9daSwc00_c */
|
||||
static int daSwc00_Execute(daSwc00_c* i_this) {
|
||||
return i_this->execute();
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 805A1DAC-805A1DAC 000018 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DEAD static char const* const stringBase_805A1DAC =
|
||||
"領域スイッチ:引数0が不正値<%d>です\n";
|
||||
// "Area Switch: arg 0 is an invalid value <%d>\n";
|
||||
#pragma pop
|
||||
#ifndef DEBUG
|
||||
UNK_REL_DATA
|
||||
#endif
|
||||
|
||||
/* 805A1DD4-805A1DE0 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
|
||||
SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
inline static int daSwc00_getType(daSwc00_c *i_this) {
|
||||
return (i_this->shape_angle.x & 0xf00) >> 8;
|
||||
}
|
||||
|
||||
/* 805A1DE0-805A1DF4 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = {
|
||||
0x02000201,
|
||||
/* padding */
|
||||
0x40080000,
|
||||
0x00000000,
|
||||
0x3FE00000,
|
||||
0x00000000,
|
||||
};
|
||||
#pragma pop
|
||||
inline static int daSwc00_getSw1No(daSwc00_c *i_this) {
|
||||
return fopAcM_GetParam(i_this) & 0xff;
|
||||
}
|
||||
|
||||
/* 805A1DF4-805A1E34 -00001 0040+00 1/1 0/0 0/0 .data @3812 */
|
||||
SECTION_DATA static void* lit_3812[16] = {
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x1DC),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x22C),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x260),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x1A4),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x1DC),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x22C),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x260),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x294),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x294),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x2C8),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x2C8),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x2C8),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x2C8),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x2C8),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x2C8),
|
||||
(void*)(((char*)execute__9daSwc00_cFv) + 0x1A4),
|
||||
};
|
||||
inline static int daSwc00_getSw2No(daSwc00_c* i_this) {
|
||||
return (fopAcM_GetParam(i_this) >> 8) & 0xff;
|
||||
}
|
||||
|
||||
/* 805A15FC-805A18E8 00027C 02EC+00 2/1 0/0 0/0 .text execute__9daSwc00_cFv */
|
||||
int daSwc00_c::execute() {
|
||||
// NONMATCHING
|
||||
daPy_py_c* player = daPy_getPlayerActorClass();
|
||||
u8 condition = daSwc00_getCondition(this);
|
||||
switch(condition) {
|
||||
case 1:
|
||||
if (!player->checkHorseRide()) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (daPy_py_c::checkNowWolf() || player->checkHorseRide()) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (player->getKandelaarFlamePos() == NULL) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
int type = daSwc00_getType(this);
|
||||
int sw2 = daSwc00_getSw2No(this);
|
||||
|
||||
switch (type) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 7:
|
||||
case 15:
|
||||
if (sw2 != 0xff && !fopAcM_isSwitch(this, sw2)) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 8:
|
||||
if (sw2 != 0xff && fopAcM_isSwitch(this, sw2)) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OSReport_Error("領域スイッチ:引数0が不正値<%d>です\n", type);
|
||||
JUT_PANIC(289, "0");
|
||||
break;
|
||||
}
|
||||
|
||||
int sw1 = daSwc00_getSw1No(this);
|
||||
switch (daSwc00_getType(this)) {
|
||||
case 3:
|
||||
case 15:
|
||||
if (hitCheck(this)) {
|
||||
dComIfGs_onSwitch(sw1, fopAcM_GetRoomNo(this));
|
||||
field_0x583 = 1;
|
||||
field_0x584 = 1;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
case 4:
|
||||
if (hitCheck(this)) {
|
||||
dComIfGs_onSwitch(sw1, fopAcM_GetRoomNo(this));
|
||||
field_0x584 = 1;
|
||||
} else {
|
||||
dComIfGs_offSwitch(sw1, fopAcM_GetRoomNo(this));
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case 5:
|
||||
if (hitCheck(this)) {
|
||||
dComIfGs_onSwitch(sw1, fopAcM_GetRoomNo(this));
|
||||
field_0x584 = 1;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 6:
|
||||
if (hitCheck(this)) {
|
||||
dComIfGs_offSwitch(sw1, fopAcM_GetRoomNo(this));
|
||||
field_0x584 = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 8:
|
||||
if (hitCheck(this)) {
|
||||
dComIfGs_offSwitch(sw1, fopAcM_GetRoomNo(this));
|
||||
field_0x584 = 1;
|
||||
field_0x583 = 1;
|
||||
}
|
||||
}
|
||||
event_proc_call();
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 805A1E34-805A1E40 -00001 000C+00 0/1 0/0 0/0 .data @3820 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* lit_3820[3] = {
|
||||
(void*)NULL,
|
||||
(void*)0xFFFFFFFF,
|
||||
(void*)actionWait__9daSwc00_cFv,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 805A1E40-805A1E4C -00001 000C+00 0/1 0/0 0/0 .data @3821 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* lit_3821[3] = {
|
||||
(void*)NULL,
|
||||
(void*)0xFFFFFFFF,
|
||||
(void*)actionOrderEvent__9daSwc00_cFv,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 805A1E4C-805A1E58 -00001 000C+00 0/1 0/0 0/0 .data @3822 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* lit_3822[3] = {
|
||||
(void*)NULL,
|
||||
(void*)0xFFFFFFFF,
|
||||
(void*)actionEvent__9daSwc00_cFv,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 805A1E58-805A1E64 -00001 000C+00 0/1 0/0 0/0 .data @3823 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* lit_3823[3] = {
|
||||
(void*)NULL,
|
||||
(void*)0xFFFFFFFF,
|
||||
(void*)actionDead__9daSwc00_cFv,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 805A1E64-805A1E94 000090 0030+00 0/1 0/0 0/0 .data l_func$3819 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static u8 l_func[48] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 805A18E8-805A19A4 000568 00BC+00 1/1 0/0 0/0 .text event_proc_call__9daSwc00_cFv */
|
||||
void daSwc00_c::event_proc_call() {
|
||||
// NONMATCHING
|
||||
static daSwc00_c::actionFunc l_func[4] = {
|
||||
&daSwc00_c::actionWait,
|
||||
&daSwc00_c::actionOrderEvent,
|
||||
&daSwc00_c::actionEvent,
|
||||
&daSwc00_c::actionDead,
|
||||
};
|
||||
(this->*l_func[mAction])();
|
||||
}
|
||||
|
||||
static inline u8 daSwc00_getEvID(daSwc00_c* i_this) {
|
||||
return fopAcM_GetParam(i_this) >> 24;
|
||||
}
|
||||
|
||||
/* 805A19A4-805A1A28 000624 0084+00 1/0 0/0 0/0 .text actionWait__9daSwc00_cFv */
|
||||
void daSwc00_c::actionWait() {
|
||||
// NONMATCHING
|
||||
if (field_0x584 != 0) {
|
||||
if (daSwc00_getEvID(this) != 0xff) {
|
||||
setAction(ACTION_ORDER_EVENT);
|
||||
fopAcM_orderOtherEventId(this, mEventID, daSwc00_getEvID(this),
|
||||
0xffff, 0, 1);
|
||||
eventInfo.onCondition(dEvtCnd_CANDEMO_e);
|
||||
} else {
|
||||
setAction(ACTION_DEAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 805A1A28-805A1A94 0006A8 006C+00 1/0 0/0 0/0 .text actionOrderEvent__9daSwc00_cFv */
|
||||
void daSwc00_c::actionOrderEvent() {
|
||||
// NONMATCHING
|
||||
if (eventInfo.checkCommandDemoAccrpt()) {
|
||||
setAction(ACTION_EVENT);
|
||||
} else {
|
||||
fopAcM_orderOtherEventId(this, mEventID, daSwc00_getEvID(this), 0xffff, 0, 1);
|
||||
eventInfo.onCondition(dEvtCnd_CANDEMO_e);
|
||||
}
|
||||
}
|
||||
|
||||
/* 805A1A94-805A1AF0 000714 005C+00 1/0 0/0 0/0 .text actionEvent__9daSwc00_cFv */
|
||||
void daSwc00_c::actionEvent() {
|
||||
// NONMATCHING
|
||||
if (dComIfGp_evmng_endCheck(mEventID)) {
|
||||
setAction(ACTION_DEAD);
|
||||
dComIfGp_event_reset();
|
||||
}
|
||||
}
|
||||
|
||||
/* 805A1AF0-805A1B1C 000770 002C+00 1/0 0/0 0/0 .text actionDead__9daSwc00_cFv */
|
||||
void daSwc00_c::actionDead() {
|
||||
// NONMATCHING
|
||||
if (field_0x583 != 0) {
|
||||
fopAcM_delete(this);
|
||||
}
|
||||
}
|
||||
|
||||
/* 805A1B1C-805A1B24 00079C 0008+00 1/0 0/0 0/0 .text daSwc00_IsDelete__FP9daSwc00_c */
|
||||
static bool daSwc00_IsDelete(daSwc00_c* param_0) {
|
||||
return true;
|
||||
static int daSwc00_IsDelete(daSwc00_c* i_this) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 805A1B24-805A1B2C 0007A4 0008+00 1/0 0/0 0/0 .text daSwc00_Delete__FP9daSwc00_c */
|
||||
static bool daSwc00_Delete(daSwc00_c* param_0) {
|
||||
return true;
|
||||
static int daSwc00_Delete(daSwc00_c* i_this) {
|
||||
fpc_ProcID id = fopAcM_GetID(i_this);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 805A1E94-805A1ED4 -00001 0040+00 1/1 0/0 0/0 .data @3996 */
|
||||
SECTION_DATA static void* lit_3996[16] = {
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0x98),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0x90),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0x98),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0xDC),
|
||||
(void*)(((char*)daSwc00_Create__FP10fopAc_ac_c) + 0x90),
|
||||
};
|
||||
static inline int daSwc00_getScale(daSwc00_c* i_this) {
|
||||
return (fopAcM_GetParam(i_this) >> 20) & 0xf;
|
||||
}
|
||||
|
||||
/* 805A1B2C-805A1D8C 0007AC 0260+00 2/0 0/0 0/0 .text daSwc00_Create__FP10fopAc_ac_c */
|
||||
static void daSwc00_Create(fopAc_ac_c* param_0) {
|
||||
// NONMATCHING
|
||||
static int daSwc00_Create(fopAc_ac_c* a_this) {
|
||||
daSwc00_c* i_this = (daSwc00_c*)a_this;
|
||||
fopAcM_SetupActor(i_this, daSwc00_c);
|
||||
fpc_ProcID id = fopAcM_GetID(a_this);
|
||||
int sw1 = daSwc00_getSw1No(i_this);
|
||||
if (dComIfGs_isSwitch(sw1, fopAcM_GetRoomNo(a_this))) {
|
||||
switch (daSwc00_getType(i_this)) {
|
||||
case 3:
|
||||
case 15:
|
||||
return cPhs_ERROR_e;
|
||||
case 0:
|
||||
case 4:
|
||||
dComIfGs_offSwitch(daSwc00_getSw1No(i_this), fopAcM_GetRoomNo(a_this));
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (daSwc00_getType(i_this)) {
|
||||
case 7:
|
||||
case 8:
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
}
|
||||
int shape = daSwc00_getShape(i_this);
|
||||
int swcScale = daSwc00_getScale(i_this);
|
||||
if (shape == 3) {
|
||||
switch (swcScale) {
|
||||
case 0:
|
||||
default:
|
||||
a_this->scale.x *= 100.0f;
|
||||
a_this->scale.x += 30.0f;
|
||||
a_this->scale.x *= a_this->scale.x;
|
||||
a_this->scale.y *= 100.0f;
|
||||
break;
|
||||
case 1:
|
||||
a_this->scale.x *= 1000.0f;
|
||||
a_this->scale.x += 30.0f;
|
||||
a_this->scale.x *= a_this->scale.x;
|
||||
a_this->scale.y *= 1000.0f;
|
||||
break;
|
||||
}
|
||||
} else if (shape == 0) {
|
||||
switch (swcScale) {
|
||||
case 1:
|
||||
a_this->scale.x = 10.0f * a_this->scale.x;
|
||||
a_this->scale.y = 10.0f * a_this->scale.y;
|
||||
a_this->scale.z = 10.0f * a_this->scale.z;
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
i_this->field_0x568.set(a_this->current.pos.x - 50.0f * a_this->scale.x,
|
||||
a_this->current.pos.y,
|
||||
a_this->current.pos.z - 50.0f * a_this->scale.z);
|
||||
i_this->field_0x574.set(a_this->current.pos.x + 50.0f * a_this->scale.x,
|
||||
a_this->current.pos.y + 100.0f * a_this->scale.y,
|
||||
a_this->current.pos.z + 50.0f * a_this->scale.z);
|
||||
}
|
||||
i_this->mEventID = dComIfGp_getEventManager().getEventIdx(a_this, daSwc00_getEvID(i_this));
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 805A1D98-805A1D9C 000004 0004+00 0/0 0/0 0/0 .rodata @3991 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_RODATA static f32 const lit_3991 = 100.0f;
|
||||
COMPILER_STRIP_GATE(0x805A1D98, &lit_3991);
|
||||
#pragma pop
|
||||
|
||||
/* 805A1D9C-805A1DA0 000008 0004+00 0/0 0/0 0/0 .rodata @3992 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_RODATA static f32 const lit_3992 = 30.0f;
|
||||
COMPILER_STRIP_GATE(0x805A1D9C, &lit_3992);
|
||||
#pragma pop
|
||||
|
||||
/* 805A1DA0-805A1DA4 00000C 0004+00 0/0 0/0 0/0 .rodata @3993 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_RODATA static f32 const lit_3993 = 1000.0f;
|
||||
COMPILER_STRIP_GATE(0x805A1DA0, &lit_3993);
|
||||
#pragma pop
|
||||
|
||||
/* 805A1DA4-805A1DA8 000010 0004+00 0/0 0/0 0/0 .rodata @3994 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_RODATA static f32 const lit_3994 = 10.0f;
|
||||
COMPILER_STRIP_GATE(0x805A1DA4, &lit_3994);
|
||||
#pragma pop
|
||||
|
||||
/* 805A1DA8-805A1DAC 000014 0004+00 0/0 0/0 0/0 .rodata @3995 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_RODATA static f32 const lit_3995 = 50.0f;
|
||||
COMPILER_STRIP_GATE(0x805A1DA8, &lit_3995);
|
||||
#pragma pop
|
||||
|
||||
/* 805A1ED4-805A1EF4 -00001 0020+00 1/0 0/0 0/0 .data l_daSwc00_Method */
|
||||
static actor_method_class l_daSwc00_Method = {
|
||||
(process_method_func)daSwc00_Create__FP10fopAc_ac_c,
|
||||
(process_method_func)daSwc00_Delete__FP9daSwc00_c,
|
||||
(process_method_func)daSwc00_Execute__FP9daSwc00_c,
|
||||
(process_method_func)daSwc00_IsDelete__FP9daSwc00_c,
|
||||
(process_method_func)daSwc00_Create,
|
||||
(process_method_func)daSwc00_Delete,
|
||||
(process_method_func)daSwc00_Execute,
|
||||
(process_method_func)daSwc00_IsDelete,
|
||||
#ifdef DEBUG
|
||||
(process_method_func)daSwc00_Draw,
|
||||
#else
|
||||
NULL
|
||||
#endif
|
||||
};
|
||||
|
||||
/* 805A1EF4-805A1F24 -00001 0030+00 0/0 0/0 1/0 .data g_profile_SWC00 */
|
||||
|
||||
Reference in New Issue
Block a user