mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-07 13:23:27 -04:00
d_ky_thunder OK, minor for m_Do_graphic
This commit is contained in:
+3
-3
@@ -422,7 +422,7 @@ config.libs = [
|
||||
Object(NonMatching, "d/actor/d_a_agb.cpp", extra_cflags=['-pragma "nosyminline on"']),
|
||||
Object(Matching, "d/actor/d_a_arrow.cpp", extra_cflags=["-sym off"]),
|
||||
Object(Matching, "d/actor/d_a_bg.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_bomb.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_bomb.cpp", extra_cflags=['-pragma "nosyminline on"']),
|
||||
Object(Matching, "d/actor/d_a_bomb2.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_boomerang.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_dai_item.cpp"),
|
||||
@@ -455,7 +455,7 @@ config.libs = [
|
||||
Object(NonMatching, "d/d_kankyo.cpp"),
|
||||
Object(Matching, "d/d_kyeff.cpp"),
|
||||
Object(Matching, "d/d_kyeff2.cpp"),
|
||||
Object(NonMatching, "d/d_ky_thunder.cpp"),
|
||||
Object(Matching, "d/d_ky_thunder.cpp"),
|
||||
Object(Matching, "d/d_letter.cpp"),
|
||||
Object(Matching, "d/d_level_se.cpp"),
|
||||
Object(NonMatching, "d/d_menu_cloth.cpp"),
|
||||
@@ -1265,7 +1265,7 @@ config.libs = [
|
||||
ActorRel(NonMatching, "d_a_obj_coming"),
|
||||
ActorRel(NonMatching, "d_a_obj_demo_barrel"),
|
||||
ActorRel(NonMatching, "d_a_obj_doguu"),
|
||||
ActorRel(Matching, "d_a_obj_doguu_demo"),
|
||||
ActorRel(Matching, "d_a_obj_doguu_demo"),
|
||||
ActorRel(NonMatching, "d_a_obj_gryw00"),
|
||||
ActorRel(Matching, "d_a_obj_hfuck1", extra_cflags=['-pragma "nosyminline on"']),
|
||||
ActorRel(Matching, "d_a_obj_hole", extra_cflags=['-pragma "nosyminline on"']),
|
||||
|
||||
@@ -20,9 +20,8 @@ public:
|
||||
/* 0x290 */ request_of_phase_process_class mPhs;
|
||||
/* 0x298 */ J3DModel* mpModel;
|
||||
/* 0x29C */ dBgW* mpBgW;
|
||||
/* 0x2A0 */ Mtx mtx;
|
||||
/* 0x2D0 */ u8 mFlag; // this field seems to be set to 1 only when initalized with CreateInit,
|
||||
// can probably be a bool
|
||||
/* 0x2A0 */ Mtx mMtx;
|
||||
/* 0x2D0 */ bool mBgwRegistered;
|
||||
/* 0x2D1 */ u8 mUnusedParam;
|
||||
/* 0x2D4 */ u32 mShape;
|
||||
};
|
||||
|
||||
@@ -20,8 +20,7 @@ static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
|
||||
|
||||
/* 00000098-00000214 .text CreateHeap__13daObjDoguuD_cFv */
|
||||
BOOL daObjDoguuD_c::CreateHeap() {
|
||||
mUnusedParam = fopAcM_GetParam(this) & 0xFF; // Im not sure why this is here, none of the other
|
||||
// classes I looked at did this
|
||||
mUnusedParam = fopAcM_GetParam(this) & 0xFF;
|
||||
|
||||
J3DModelData* modelData = (J3DModelData*)(dComIfG_getObjectRes("DoguuD", 0x04));
|
||||
JUT_ASSERT(0x65, modelData != 0);
|
||||
@@ -32,7 +31,7 @@ BOOL daObjDoguuD_c::CreateHeap() {
|
||||
mDoMtx_stack_c::transS(current.pos);
|
||||
mDoMtx_stack_c::YrotM(shape_angle.y);
|
||||
mDoMtx_stack_c::scaleM(mScale);
|
||||
mDoMtx_copy(mDoMtx_stack_c::get(), mtx);
|
||||
mDoMtx_copy(mDoMtx_stack_c::get(), mMtx);
|
||||
|
||||
mpBgW = new dBgW();
|
||||
|
||||
@@ -40,7 +39,7 @@ BOOL daObjDoguuD_c::CreateHeap() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mpBgW->Set((cBgD_t*)dComIfG_getObjectRes("DoguuD", 0x07), cBgW::MOVE_BG_e, &mtx))
|
||||
if (mpBgW->Set((cBgD_t*)dComIfG_getObjectRes("DoguuD", 0x07), cBgW::MOVE_BG_e, &mMtx))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
@@ -51,7 +50,7 @@ void daObjDoguuD_c::CreateInit() {
|
||||
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
|
||||
fopAcM_setCullSizeBox(this, -30000.0f, -5000.0f, -30000.0f, 30000.0f, 40000.0f, 30000.0f);
|
||||
dComIfG_Bgsp()->Regist(mpBgW, this);
|
||||
mFlag = 1;
|
||||
mBgwRegistered = true;
|
||||
set_mtx();
|
||||
}
|
||||
|
||||
@@ -65,19 +64,18 @@ void daObjDoguuD_c::set_mtx() {
|
||||
|
||||
s32 daObjDoguuD_c::_create() {
|
||||
fopAcM_SetupActor(this, daObjDoguuD_c);
|
||||
mFlag = 0;
|
||||
mBgwRegistered = false;
|
||||
|
||||
s32 ret = dComIfG_resLoad(&mPhs, "DoguuD");
|
||||
s32 phase_state = dComIfG_resLoad(&mPhs, "DoguuD");
|
||||
|
||||
if (ret == cPhs_COMPLEATE_e) {
|
||||
if (fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x1460) == 0) {
|
||||
ret = cPhs_ERROR_e;
|
||||
} else {
|
||||
CreateInit();
|
||||
if (phase_state == cPhs_COMPLEATE_e) {
|
||||
if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x1460)) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
CreateInit();
|
||||
}
|
||||
|
||||
return ret;
|
||||
return phase_state;
|
||||
}
|
||||
|
||||
/* 00000314-000003BC .text daObjDoguuD_create__FPv */
|
||||
@@ -86,7 +84,7 @@ static s32 daObjDoguuD_create(void* i_this) {
|
||||
}
|
||||
|
||||
BOOL daObjDoguuD_c::_delete() {
|
||||
if (heap != NULL && mFlag == 1)
|
||||
if (heap != NULL && mBgwRegistered == true)
|
||||
dComIfG_Bgsp()->Release(mpBgW);
|
||||
|
||||
dComIfG_resDelete(&mPhs, "DoguuD");
|
||||
|
||||
+25
-20
@@ -16,6 +16,15 @@
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
|
||||
class dThunder_modelInfo_c {
|
||||
public:
|
||||
// Offsets are relative to dThunder_c instead of dThunder_modelInfo_c
|
||||
/* 0x0FC */ J3DModel * mpModel;
|
||||
/* 0x100 */ mDoExt_invisibleModel mInvisModel;
|
||||
/* 0x108 */ mDoExt_btkAnm mBtk;
|
||||
/* 0x11C */ mDoExt_brkAnm mBrk;
|
||||
};
|
||||
|
||||
class dThunder_c : public kankyo_class {
|
||||
public:
|
||||
inline ~dThunder_c();
|
||||
@@ -27,10 +36,7 @@ public:
|
||||
|
||||
public:
|
||||
/* 0x0F8 */ JKRSolidHeap * solid_heap;
|
||||
/* 0x0FC */ J3DModel * mpModel;
|
||||
/* 0x100 */ mDoExt_invisibleModel mInvisModel;
|
||||
/* 0x108 */ mDoExt_btkAnm mBtk;
|
||||
/* 0x11C */ mDoExt_brkAnm mBrk;
|
||||
/* 0x0FC */ dThunder_modelInfo_c mModelInfo;
|
||||
/* 0x134 */ cXyz mScale;
|
||||
/* 0x140 */ cXyz mPos;
|
||||
/* 0x14C */ cXyz mPosNeg;
|
||||
@@ -43,8 +49,8 @@ dThunder_c::~dThunder_c() {
|
||||
}
|
||||
|
||||
BOOL dThunder_c::execute() {
|
||||
mBrk.setPlaySpeed(1.0f);
|
||||
if (mBrk.play()) {
|
||||
mModelInfo.mBrk.setPlaySpeed(1.0f);
|
||||
if (mModelInfo.mBrk.play()) {
|
||||
mDoAud_seStart(JA_SE_OBJ_THUNDER_FAR, &mPos);
|
||||
fopKyM_Delete(this);
|
||||
}
|
||||
@@ -59,17 +65,17 @@ BOOL dThunder_c::draw() {
|
||||
|
||||
Mtx m;
|
||||
MTXCopy(mDoMtx_stack_c::get(), m);
|
||||
mpModel->setBaseScale(mScale);
|
||||
mpModel->setBaseTRMtx(m);
|
||||
mModelInfo.mpModel->setBaseScale(mScale);
|
||||
mModelInfo.mpModel->setBaseTRMtx(m);
|
||||
|
||||
mBtk.entry(mpModel->getModelData(), mBtkTime);
|
||||
mBrk.entry(mpModel->getModelData());
|
||||
mModelInfo.mBtk.entry(mModelInfo.mpModel->getModelData(), mBtkTime);
|
||||
mModelInfo.mBrk.entry(mModelInfo.mpModel->getModelData());
|
||||
|
||||
dComIfGd_setList();
|
||||
mDoExt_modelUpdateDL(mpModel);
|
||||
mInvisModel.entryMaskOff();
|
||||
mBtk.remove(mpModel->getModelData());
|
||||
mBrk.remove(mpModel->getModelData());
|
||||
mDoExt_modelUpdateDL(mModelInfo.mpModel);
|
||||
mModelInfo.mInvisModel.entryMaskOff();
|
||||
mModelInfo.mBtk.remove(mModelInfo.mpModel->getModelData());
|
||||
mModelInfo.mBrk.remove(mModelInfo.mpModel->getModelData());
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -108,7 +114,6 @@ BOOL dThunder_IsDelete(dThunder_c* i_this) {
|
||||
|
||||
/* 80198ABC-80198B68 .text dThunder_Delete__FP10dThunder_c */
|
||||
BOOL dThunder_Delete(dThunder_c* i_this) {
|
||||
/* Nonmatching */
|
||||
mDoAud_seDeleteObject(&i_this->mPos);
|
||||
mDoAud_seDeleteObject(&i_this->mPosNeg);
|
||||
i_this->~dThunder_c();
|
||||
@@ -135,21 +140,21 @@ s32 dThunder_c::create() {
|
||||
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Always", ALWAYS_BDL_YTHDR00);
|
||||
JUT_ASSERT(0x6e, modelData != 0);
|
||||
|
||||
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x01000200);
|
||||
if (mpModel == NULL)
|
||||
mModelInfo.mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x01000200);
|
||||
if (mModelInfo.mpModel == NULL)
|
||||
return cPhs_ERROR_e;
|
||||
|
||||
if (!mInvisModel.create(mpModel))
|
||||
if (!mModelInfo.mInvisModel.create(mModelInfo.mpModel))
|
||||
return cPhs_ERROR_e;
|
||||
|
||||
J3DAnmTextureSRTKey * anm = (J3DAnmTextureSRTKey *)dComIfG_getObjectRes("Always", ALWAYS_BTK_YTHDR00);
|
||||
JUT_ASSERT(0x7d, anm != 0);
|
||||
if (!mBtk.init(modelData, anm, false, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, false, 0))
|
||||
if (!mModelInfo.mBtk.init(modelData, anm, false, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, false, 0))
|
||||
return cPhs_ERROR_e;
|
||||
|
||||
J3DAnmTevRegKey * canm = (J3DAnmTevRegKey *)dComIfG_getObjectRes("Always", ALWAYS_BRK_YTHDR00);
|
||||
JUT_ASSERT(0x8c, canm != 0);
|
||||
if (!mBrk.init(modelData, canm, true, J3DFrameCtrl::LOOP_ONCE_e, 1.0f, 0, -1, false, 0))
|
||||
if (!mModelInfo.mBrk.init(modelData, canm, true, J3DFrameCtrl::LOOP_ONCE_e, 1.0f, 0, -1, false, 0))
|
||||
return cPhs_ERROR_e;
|
||||
|
||||
mBtkTime = cM_rndF(1.0f);
|
||||
|
||||
@@ -450,7 +450,7 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
/* Nonmatching */
|
||||
if (mDoGph_gInf_c::isAutoForcus()) {
|
||||
f32 projv[7];
|
||||
f32 viewv[4];
|
||||
f32 viewv[6];
|
||||
f32 x, y, z;
|
||||
|
||||
GXGetProjectionv(projv);
|
||||
@@ -679,11 +679,15 @@ u8* mDoGph_allocFromAny(u32 size, int align) {
|
||||
void mDoGph_screenCaptureDraw() {
|
||||
s32 sizeW = mCaptureSizeWidth;
|
||||
s32 sizeH = mCaptureSizeHeight;
|
||||
s32 sizeW_double = sizeW * 2;
|
||||
s32 sizeH_double = sizeH * 2;
|
||||
s32 sizeW_half = sizeW / 2;
|
||||
s32 sizeH_half = sizeH / 2;
|
||||
s32 centerX = mCaptureCenterX;
|
||||
s32 centerY = mCaptureCenterY;
|
||||
|
||||
f32 projv[7];
|
||||
f32 viewv[4];
|
||||
f32 viewv[6];
|
||||
u32 left, top, width, height;
|
||||
GXTexObj texObj;
|
||||
|
||||
@@ -706,9 +710,9 @@ void mDoGph_screenCaptureDraw() {
|
||||
if (mCaptureDraw == 1) {
|
||||
drawRectangle(centerX - sizeW, centerY - sizeH, centerX + sizeW, centerY + sizeH);
|
||||
} else if (mCaptureDraw == 2) {
|
||||
drawRectangle(centerX - (sizeW >> 1), centerY - (sizeH >> 1), centerX + (sizeW >> 1), centerY + (sizeH >> 1));
|
||||
drawRectangle(centerX - sizeW_half, centerY - sizeH_half, centerX + sizeW_half, centerY + sizeH_half);
|
||||
} else if (mCaptureDraw == 3) {
|
||||
drawRectangle(centerX + sizeW * -2, centerY + sizeH * -2, centerX + sizeW * 2, centerY + sizeH * 2);
|
||||
drawRectangle(centerX - sizeW_double, centerY - sizeH_double, centerX + sizeW_double, centerY + sizeH_double);
|
||||
} else if (mCaptureDraw == 4) {
|
||||
drawRectangle(centerX - sizeW, centerY - sizeH, centerX, centerY);
|
||||
drawRectangle(centerX, centerY - sizeH, centerX + sizeW, centerY);
|
||||
@@ -761,7 +765,6 @@ void mCaptureGXDrawSyncTimeOut(OSAlarm*, OSContext*) {
|
||||
|
||||
/* 8000AC3C-8000AEA4 .text mDoGph_screenCapture__Fv */
|
||||
bool mDoGph_screenCapture() {
|
||||
/* Nonmatching */
|
||||
s32 sizeW = mCaptureSizeWidth;
|
||||
s32 sizeH = mCaptureSizeHeight;
|
||||
s32 sizeW2 = sizeW << 1;
|
||||
@@ -770,7 +773,7 @@ bool mDoGph_screenCapture() {
|
||||
s32 centerY = mCaptureCenterY;
|
||||
|
||||
f32 projv[7];
|
||||
f32 viewv[4];
|
||||
f32 viewv[6];
|
||||
u32 left, top, width, height;
|
||||
|
||||
mCaptureTextureSize = GXGetTexBufferSize(sizeW, sizeH, mCaptureTextureFormat, GX_FALSE, 0);
|
||||
|
||||
Reference in New Issue
Block a user