mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-06 01:48:15 -04:00
d_a_obj_tousekiki (#839)
This commit is contained in:
+1
-1
@@ -1432,7 +1432,7 @@ config.libs = [
|
||||
ActorRel(Matching, "d_a_obj_tide"),
|
||||
ActorRel(Matching, "d_a_obj_timer"),
|
||||
ActorRel(Equivalent, "d_a_obj_toripost", extra_cflags=['-pragma "nosyminline on"']), # weak func order
|
||||
ActorRel(NonMatching, "d_a_obj_tousekiki"),
|
||||
ActorRel(Matching, "d_a_obj_tousekiki", extra_cflags=['-pragma "nosyminline on"']),
|
||||
ActorRel(NonMatching, "d_a_obj_warpt"),
|
||||
ActorRel(Matching, "d_a_obj_wood", extra_cflags=['-pragma "nosyminline on"']),
|
||||
ActorRel(Equivalent, "d_a_pirate_flag"), # weak func order
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define D_A_OBJ_TOUSEKIKI_H
|
||||
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "d/d_cc_d.h"
|
||||
|
||||
class mDoExt_McaMorf;
|
||||
|
||||
class daObj_Tousekiki_c : public fopAc_ac_c {
|
||||
public:
|
||||
@@ -9,13 +12,21 @@ public:
|
||||
inline bool _delete();
|
||||
inline bool _draw();
|
||||
inline bool _execute();
|
||||
void demo_move() {}
|
||||
void set_mtx() {}
|
||||
inline void demo_move();
|
||||
inline void set_mtx();
|
||||
|
||||
void CreateHeap();
|
||||
BOOL CreateHeap();
|
||||
|
||||
static const char M_arcname[];
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
};
|
||||
/* 0x290 */ request_of_phase_process_class mPhase;
|
||||
/* 0x298 */ J3DModel* mModel;
|
||||
/* 0x29C */ mDoExt_McaMorf* mMorf;
|
||||
/* 0x2A0 */ Mtx m2A0;
|
||||
/* 0x2D0 */ u16 m2D0;
|
||||
/* 0x2D4 */ dCcD_Stts mStts;
|
||||
/* 0x310 */ dCcD_Cyl mCyl;
|
||||
}; // size = 0x440
|
||||
|
||||
#endif /* D_A_OBJ_TOUSEKIKI_H */
|
||||
|
||||
@@ -4,17 +4,50 @@
|
||||
*/
|
||||
|
||||
#include "d/actor/d_a_obj_tousekiki.h"
|
||||
#include "d/actor/d_a_obj_pirateship.h"
|
||||
#include "d/res/res_touseki.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "d/d_priority.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
|
||||
static daObjPirateship::Act_c* l_p_ship;
|
||||
|
||||
const char daObj_Tousekiki_c::M_arcname[] = "Touseki";
|
||||
|
||||
/* 000000EC-0000010C .text CheckCreateHeap__FP10fopAc_ac_c */
|
||||
static BOOL CheckCreateHeap(fopAc_ac_c*) {
|
||||
/* Nonmatching */
|
||||
static BOOL CheckCreateHeap(fopAc_ac_c* a_this) {
|
||||
return ((daObj_Tousekiki_c*)a_this)->CreateHeap();
|
||||
}
|
||||
|
||||
/* 0000010C-000002BC .text CreateHeap__17daObj_Tousekiki_cFv */
|
||||
void daObj_Tousekiki_c::CreateHeap() {
|
||||
/* Nonmatching */
|
||||
BOOL daObj_Tousekiki_c::CreateHeap() {
|
||||
mMorf = new mDoExt_McaMorf(
|
||||
(J3DModelData*)dComIfG_getObjectRes(M_arcname, TOUSEKI_INDEX_BDL_ATOSK_A),
|
||||
NULL,
|
||||
NULL,
|
||||
(J3DAnmTransform*)dComIfG_getObjectRes(M_arcname, TOUSEKI_INDEX_BCK_ATOSK_NAGE),
|
||||
J3DFrameCtrl::EMode_LOOP,
|
||||
1.0f,
|
||||
0,
|
||||
-1,
|
||||
1,
|
||||
NULL,
|
||||
0x80000,
|
||||
0x11000002
|
||||
);
|
||||
if (mMorf == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes(M_arcname, TOUSEKI_INDEX_BCK_ATOSK_NAGE), 0, 0.0f, 1.0f, 0.0f, -1.0f, NULL);
|
||||
m2D0 = 0xFFFF;
|
||||
mMorf->setFrame(mMorf->getEndFrame() - 1.0f);
|
||||
mModel = mMorf->getModel();
|
||||
if (mModel == NULL) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 000002BC-000002DC .text daObj_TousekikiCreate__FPv */
|
||||
@@ -24,22 +57,89 @@ static cPhs_State daObj_TousekikiCreate(void* i_this) {
|
||||
|
||||
/* 000002DC-000004F4 .text _create__17daObj_Tousekiki_cFv */
|
||||
cPhs_State daObj_Tousekiki_c::_create() {
|
||||
/* Nonmatching */
|
||||
#if VERSION == VERSION_DEMO
|
||||
cPhs_State PVar1 = dComIfG_resLoad(&mPhase, M_arcname);
|
||||
if (PVar1 == cPhs_COMPLEATE_e) {
|
||||
fopAcM_SetupActor(this, daObj_Tousekiki_c);
|
||||
#else
|
||||
fopAcM_SetupActor(this, daObj_Tousekiki_c);
|
||||
|
||||
cPhs_State PVar1 = dComIfG_resLoad(&mPhase, M_arcname);
|
||||
if (PVar1 == cPhs_COMPLEATE_e) {
|
||||
#endif
|
||||
if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x900)) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
|
||||
mDoMtx_stack_c::YrotM(shape_angle.y);
|
||||
mDoMtx_stack_c::scaleM(scale.x, scale.y, scale.z);
|
||||
MTXCopy(mDoMtx_stack_c::get(), m2A0);
|
||||
mModel->setBaseScale(scale);
|
||||
|
||||
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
|
||||
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
|
||||
mModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
|
||||
MTXCopy(mDoMtx_stack_c::get(), m2A0);
|
||||
l_p_ship = (daObjPirateship::Act_c*)fopAcM_SearchByID(parentActorID);
|
||||
fopAcM_SetMtx(this, mModel->getBaseTRMtx());
|
||||
MTXCopy(mModel->getBaseTRMtx(), m2A0);
|
||||
}
|
||||
return PVar1;
|
||||
}
|
||||
|
||||
bool daObj_Tousekiki_c::_delete() {
|
||||
dComIfG_resDeleteDemo(&mPhase, M_arcname);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 000006E8-00000718 .text daObj_TousekikiDelete__FPv */
|
||||
static BOOL daObj_TousekikiDelete(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daObj_TousekikiDelete(void* v_this) {
|
||||
return ((daObj_Tousekiki_c*)v_this)->_delete();
|
||||
}
|
||||
|
||||
void daObj_Tousekiki_c::demo_move() {
|
||||
static cXyz touseki_offset(0.0f, 700.0f, 850.0f);
|
||||
cMtx_multVec(l_p_ship->mModel->getBaseTRMtx(), &touseki_offset, ¤t.pos);
|
||||
if (dDemo_setDemoData(this, dDemo_actor_c::ENABLE_ANM_FRAME_e | dDemo_actor_c::ENABLE_ANM_e | dDemo_actor_c::ENABLE_ROTATE_e, mMorf, "Touseki") == 0) {
|
||||
shape_angle = l_p_ship->shape_angle;
|
||||
current.angle = shape_angle;
|
||||
}
|
||||
}
|
||||
|
||||
void daObj_Tousekiki_c::set_mtx() {
|
||||
mModel->setBaseScale(scale);
|
||||
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
|
||||
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
|
||||
mModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
MTXCopy(mDoMtx_stack_c::get(), m2A0);
|
||||
}
|
||||
|
||||
bool daObj_Tousekiki_c::_execute() {
|
||||
demo_move();
|
||||
set_mtx();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 00000718-000008A4 .text daObj_TousekikiExecute__FPv */
|
||||
static BOOL daObj_TousekikiExecute(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daObj_TousekikiExecute(void* v_this) {
|
||||
return ((daObj_Tousekiki_c*)v_this)->_execute();
|
||||
}
|
||||
|
||||
bool daObj_Tousekiki_c::_draw() {
|
||||
if (l_p_ship->m2CC == 0) {
|
||||
return true;
|
||||
}
|
||||
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr);
|
||||
g_env_light.setLightTevColorType(mModel, &tevStr);
|
||||
mMorf->updateDL();
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 000008A4-00000934 .text daObj_TousekikiDraw__FPv */
|
||||
static BOOL daObj_TousekikiDraw(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daObj_TousekikiDraw(void* v_this) {
|
||||
return ((daObj_Tousekiki_c*)v_this)->_draw();
|
||||
}
|
||||
|
||||
/* 00000934-0000093C .text daObj_TousekikiIsDelete__FPv */
|
||||
|
||||
Reference in New Issue
Block a user