mirror of
https://github.com/zeldaret/tww.git
synced 2026-05-26 15:44:53 -04:00
d_wpot_water work
This commit is contained in:
@@ -67,6 +67,7 @@ public:
|
||||
void zDrawParticle();
|
||||
void zDrawChild();
|
||||
void loadYBBMtx(MtxP);
|
||||
bool isZDraw() { return field_0xc2 & 1; }
|
||||
|
||||
static JPADrawVisitorContainer vc;
|
||||
static JPADrawClipBoard cb;
|
||||
|
||||
@@ -302,7 +302,7 @@ public:
|
||||
void getgReRDirection(JGeometry::TVec3<f32>&) {}
|
||||
void isChildDraw() {}
|
||||
void isContinuousParticle() {}
|
||||
void isZDraw() {}
|
||||
bool isZDraw() { return mDraw.isZDraw(); }
|
||||
void loadTexture(u8, GXTexMapID) {}
|
||||
void setEmitterRotation(const JGeometry::TVec3<s16>&) {}
|
||||
void setGlobalParticleHeightScale(f32) {}
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
#ifndef D_WPOT_WATER_H
|
||||
#define D_WPOT_WATER_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "d/d_particle.h"
|
||||
#include "d/d_drawlist.h"
|
||||
#include "f_op/f_op_kankyo.h"
|
||||
|
||||
class dWpotWater_c {
|
||||
public:
|
||||
inline s32 create();
|
||||
inline BOOL draw();
|
||||
inline BOOL execute();
|
||||
};
|
||||
|
||||
class dWpotWater_EcallBack {
|
||||
class dWpotWater_EcallBack : public dPa_levelEcallBack {
|
||||
public:
|
||||
void execute(JPABaseEmitter*) {}
|
||||
void setup(JPABaseEmitter*, const cXyz*, const csXyz*, s8) {}
|
||||
@@ -19,4 +13,18 @@ public:
|
||||
void draw(JPABaseEmitter*);
|
||||
};
|
||||
|
||||
class dWpotWater_c : public kankyo_class {
|
||||
public:
|
||||
inline s32 create();
|
||||
inline BOOL draw();
|
||||
inline BOOL execute();
|
||||
|
||||
public:
|
||||
static dWpotWater_EcallBack mEcallback;
|
||||
|
||||
public:
|
||||
/* 0x0F8 */ JPABaseEmitter* emtr;
|
||||
/* 0x0FC */ dDlst_alphaVolPacket mPacket;
|
||||
};
|
||||
|
||||
#endif /* D_WPOT_WATER_H */
|
||||
|
||||
+95
-11
@@ -4,34 +4,118 @@
|
||||
//
|
||||
|
||||
#include "d/d_wpot_water.h"
|
||||
#include "f_op/f_op_kankyo.h"
|
||||
#include "d/d_bg_s_gnd_chk.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "f_op/f_op_kankyo_mng.h"
|
||||
|
||||
/* 8023F5D0-8023F64C .text draw__20dWpotWater_EcallBackFP14JPABaseEmitter */
|
||||
void dWpotWater_EcallBack::draw(JPABaseEmitter*) {
|
||||
/* Nonmatching */
|
||||
void dWpotWater_EcallBack::draw(JPABaseEmitter* emtr) {
|
||||
if (emtr->isZDraw()) {
|
||||
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_DST_ALPHA, GX_BL_INV_DST_ALPHA, GX_LO_CLEAR);
|
||||
GXSetZMode(GX_FALSE, GX_LEQUAL, GX_FALSE);
|
||||
GXSetZCompLoc(GX_FALSE);
|
||||
GXSetColorUpdate(GX_FALSE);
|
||||
GXSetAlphaUpdate(GX_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8023F64C-8023F688 .text dWpotWater_Draw__FP12dWpotWater_c */
|
||||
static void dWpotWater_Draw(dWpotWater_c*) {
|
||||
/* Nonmatching */
|
||||
static BOOL dWpotWater_Draw(dWpotWater_c* i_this) {
|
||||
dComIfGd_getXluList()->entryImm(&i_this->mPacket, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 8023F688-8023F740 .text dWpotWater_Execute__FP12dWpotWater_c */
|
||||
static void dWpotWater_Execute(dWpotWater_c*) {
|
||||
static BOOL dWpotWater_Execute(dWpotWater_c* i_this) {
|
||||
/* Nonmatching */
|
||||
mDoMtx_stack_c::transS(i_this->mPos.x, i_this->mPos.y + 50.0f, i_this->mPos.z);
|
||||
mDoMtx_stack_c::scaleM(220.0f, 100.0f, 220.0f);
|
||||
mDoMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), i_this->mPacket.mtx);
|
||||
if (i_this->emtr->isEnableDeleteEmitter()) {
|
||||
i_this->emtr->quitImmortalEmitter();
|
||||
fopKyM_Delete(i_this);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 8023F740-8023F748 .text dWpotWater_IsDelete__FP12dWpotWater_c */
|
||||
static void dWpotWater_IsDelete(dWpotWater_c*) {
|
||||
/* Nonmatching */
|
||||
static BOOL dWpotWater_IsDelete(dWpotWater_c* i_this) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 8023F748-8023F750 .text dWpotWater_Delete__FP12dWpotWater_c */
|
||||
static void dWpotWater_Delete(dWpotWater_c*) {
|
||||
/* Nonmatching */
|
||||
static BOOL dWpotWater_Delete(dWpotWater_c* i_this) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 8023F750-8023FFCC .text dWpotWater_Create__FP12kankyo_class */
|
||||
static void dWpotWater_Create(kankyo_class*) {
|
||||
static s32 dWpotWater_Create(kankyo_class* i_k) {
|
||||
/* Nonmatching */
|
||||
dWpotWater_c* i_this = (dWpotWater_c*)i_k;
|
||||
|
||||
dBgS_GndChk chk2;
|
||||
dBgS_ObjGndChk_Yogan chk;
|
||||
|
||||
s16 angle = 0;
|
||||
for (s32 i = 0; i < 50; i++, angle += 10000) {
|
||||
cXyz pos = i_this->mPos;
|
||||
pos.x += 2.040816f * cM_ssin(angle);
|
||||
pos.y += 100.0f;
|
||||
pos.z += 2.040816f * cM_scos(angle);
|
||||
chk.SetPos(&pos);
|
||||
f32 ret = dComIfG_Bgsp()->GroundCross(&chk);
|
||||
if (ret != -1000000000.0f) {
|
||||
chk2.SetPos(&pos);
|
||||
f32 ret2 = dComIfG_Bgsp()->GroundCross(&chk2);
|
||||
if (chk.ChkSetInfo() && dComIfG_Bgsp()->GetAttributeCode(chk) && ret2 < ret) {
|
||||
cXyz spawnPos = pos;
|
||||
spawnPos.y = ret + 25.0f;
|
||||
fopAcM_create(PROC_Obj_Magmarock, 0, &spawnPos, i_this->mParam);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cXyz pos = i_this->mPos;
|
||||
pos.y += 100.0f;
|
||||
chk2.SetPos(&pos);
|
||||
f32 ret = dComIfG_Bgsp()->GroundCross(&chk2);
|
||||
i_this->mPos.y = ret;
|
||||
if (ret != -1000000000.0f)
|
||||
return cPhs_ERROR_e;
|
||||
|
||||
fopAcM_create(PROC_HITOBJ, 0, &i_this->mPos, i_this->mParam);
|
||||
new(&i_this) dWpotWater_c();
|
||||
dComIfGp_particle_set(0x8083, &i_this->mPos);
|
||||
dComIfGp_particle_set(0x8084, &i_this->mPos);
|
||||
i_this->emtr = dComIfGp_particle_set(0x8086, &i_this->mPos, NULL, NULL, 0xAA, &dWpotWater_c::mEcallback);
|
||||
if (i_this->emtr == NULL)
|
||||
return cPhs_ERROR_e;
|
||||
|
||||
i_this->emtr->becomeImmortalEmitter();
|
||||
return cPhs_NEXT_e;
|
||||
}
|
||||
|
||||
kankyo_method_class l_dWpotWater_Method = {
|
||||
(process_method_func)dWpotWater_Create,
|
||||
(process_method_func)dWpotWater_Delete,
|
||||
(process_method_func)dWpotWater_Execute,
|
||||
(process_method_func)dWpotWater_IsDelete,
|
||||
(process_method_func)dWpotWater_Draw,
|
||||
};
|
||||
|
||||
kankyo_process_profile_definition g_profile_WPOT_WATER = {
|
||||
fpcLy_CURRENT_e,
|
||||
2,
|
||||
fpcPi_CURRENT_e,
|
||||
PROC_WPOT_WATER,
|
||||
&g_fpcLf_Method.base,
|
||||
sizeof(dWpotWater_c),
|
||||
0,
|
||||
0,
|
||||
&g_fopKy_Method,
|
||||
0x01CC,
|
||||
&l_dWpotWater_Method,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user