mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-21 14:07:29 -04:00
d_a_itembase OK
This commit is contained in:
+1
-1
@@ -420,7 +420,7 @@ config.libs = [
|
||||
Object(NonMatching, "d/actor/d_a_hookshot.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_ib.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_item.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_itembase.cpp"),
|
||||
Object(Matching, "d/actor/d_a_itembase.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_nh.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_npc_fa1.cpp"),
|
||||
Object(NonMatching, "d/actor/d_a_obj_search.cpp"),
|
||||
|
||||
@@ -36,9 +36,9 @@ STATIC_ASSERT(sizeof(daItemBase_c_m_data) == 0x4C);
|
||||
|
||||
struct daItemBase_c : public fopAc_ac_c {
|
||||
public:
|
||||
s32 DeleteBase(const char*);
|
||||
s32 CreateItemHeap(const char*, short, short, short, short, short, short, short);
|
||||
virtual s32 DrawBase();
|
||||
BOOL DeleteBase(const char*);
|
||||
BOOL CreateItemHeap(const char*, short, short, short, short, short, short, short);
|
||||
virtual BOOL DrawBase();
|
||||
virtual void setListStart();
|
||||
void setListEnd();
|
||||
virtual void settingBeforeDraw();
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
virtual void setShadow();
|
||||
virtual void animEntry();
|
||||
void animPlay(float, float, float, float, float);
|
||||
virtual s32 clothCreate();
|
||||
virtual BOOL clothCreate();
|
||||
|
||||
void getItemNo();
|
||||
void getHeight();
|
||||
@@ -65,21 +65,21 @@ public:
|
||||
|
||||
public:
|
||||
/* 0x294 */ request_of_phase_process_class mPhs;
|
||||
/* 0x29C */ J3DModel* mModel;
|
||||
/* 0x2A0 */ J3DModel* mModelArrow[2]; // Extra models for arrow bundles
|
||||
/* 0x2A8 */ mDoExt_btkAnm* mBtkAnm1;
|
||||
/* 0x2AC */ mDoExt_btkAnm* mBtkAnm2;
|
||||
/* 0x2B0 */ mDoExt_brkAnm* mBrkAnm1;
|
||||
/* 0x2B4 */ mDoExt_brkAnm* mBrkAnm2;
|
||||
/* 0x2B8 */ mDoExt_bckAnm* mBckAnm;
|
||||
/* 0x29C */ J3DModel* mpModel;
|
||||
/* 0x2A0 */ J3DModel* mpModelArrow[2]; // Extra models for arrow bundles
|
||||
/* 0x2A8 */ mDoExt_btkAnm* mpBtkAnm1;
|
||||
/* 0x2AC */ mDoExt_btkAnm* mpBtkAnm2;
|
||||
/* 0x2B0 */ mDoExt_brkAnm* mpBrkAnm1;
|
||||
/* 0x2B4 */ mDoExt_brkAnm* mpBrkAnm2;
|
||||
/* 0x2B8 */ mDoExt_bckAnm* mpBckAnm;
|
||||
/* 0x2BC */ dBgS_ObjAcch mAcch;
|
||||
/* 0x480 */ dBgS_AcchCir mAcchCir;
|
||||
/* 0x4C0 */ dCcD_Stts mStts;
|
||||
/* 0x4FC */ dCcD_Cyl mCyl;
|
||||
/* 0x62C */ u8 field14_0x62c[0x630 - 0x62C];
|
||||
/* 0x630 */ int mPickupFlag;
|
||||
/* 0x634 */ int field19_0x634;
|
||||
/* 0x638 */ short field20_0x638;
|
||||
/* 0x62C */ s32 mShadowId;
|
||||
/* 0x630 */ s32 mPickupFlag;
|
||||
/* 0x634 */ s32 field_0x634;
|
||||
/* 0x638 */ s16 field_0x638;
|
||||
/* 0x63A */ u8 m_itemNo;
|
||||
/* 0x63B */ u8 mDrawFlags;
|
||||
};
|
||||
|
||||
@@ -1037,6 +1037,8 @@ public:
|
||||
void procCutKesa_init();
|
||||
void procCutKesa();
|
||||
void checkNoControll() const;
|
||||
|
||||
J3DAnmTevRegKey* getBombBrk() { return mpBombBrk; }
|
||||
|
||||
/* 0x0320 */ request_of_phase_process_class mPhsLoad;
|
||||
/* 0x0328 */ J3DModelData* mpModelData;
|
||||
@@ -1093,7 +1095,7 @@ public:
|
||||
/* 0x2E98 */ J3DModel* mpHeldItemModel;
|
||||
/* 0x2E9C */ mDoExt_bckAnm mSwordAnim;
|
||||
/* 0x2EAC */ u8 field_0x2EAC[0x2EB0 - 0x2EAC];
|
||||
/* 0x2EB0 */ J3DAnmTevRegKey* field_0x2eb0;
|
||||
/* 0x2EB0 */ J3DAnmTevRegKey* mpBombBrk;
|
||||
/* 0x2EB4 */ J3DAnmTevRegKey* mpGwp00BrkData;
|
||||
/* 0x2EB8 */ J3DAnmTextureSRTKey* mpGwp00BtkData;
|
||||
/* 0x2EBC */ u8 field_0x2EBC[0x2ED4 - 0x2EBC];
|
||||
|
||||
@@ -14,7 +14,7 @@ struct daShopItem_c : public daItemBase_c {
|
||||
char* getShopArcname();
|
||||
s16 getShopBmdIdx();
|
||||
void CreateInit();
|
||||
int _create();
|
||||
inline int _create();
|
||||
bool _execute();
|
||||
void set_mtx();
|
||||
bool _draw();
|
||||
@@ -23,7 +23,7 @@ struct daShopItem_c : public daItemBase_c {
|
||||
void setListStart() {}
|
||||
void settingBeforeDraw();
|
||||
void setTevStr();
|
||||
s32 clothCreate();
|
||||
BOOL clothCreate();
|
||||
|
||||
//funcs in d_a_shop_item_static
|
||||
cXyz* getScaleP();
|
||||
@@ -35,7 +35,7 @@ struct daShopItem_c : public daItemBase_c {
|
||||
|
||||
static const char m_cloth_arcname[];
|
||||
static const f32 m_cullfar_max;
|
||||
static const u8 mModelType[256];
|
||||
static const u8 mModelType[255];
|
||||
static const daShopItem_c_m_data mData[255];
|
||||
|
||||
/* 0x63C */ request_of_phase_process_class field_0x63C;
|
||||
|
||||
@@ -1119,6 +1119,10 @@ inline void dComIfGp_evmng_remove() {
|
||||
* === DRAWLIST ===
|
||||
*/
|
||||
|
||||
int dComIfGd_setShadow(u32 id, s8 param_2, J3DModel* pModel, cXyz* pPos, f32 param_5, f32 param_6,
|
||||
f32 y, f32 param_8, cBgS_PolyInfo& pFloorPoly, dKy_tevstr_c* param_10,
|
||||
s16 rotY, f32 param_12, GXTexObj* pTexObj);
|
||||
|
||||
inline int dComIfGd_setSimpleShadow(cXyz* pPos, f32 param_1, f32 param_2, cXyz* param_3, s16 angle,
|
||||
f32 param_5, GXTexObj* pTex) {
|
||||
return g_dComIfG_gameInfo.drawlist.setSimpleShadow(pPos, param_1, param_2, param_3, angle,
|
||||
@@ -1165,15 +1169,44 @@ inline void dComIfGd_setList() {
|
||||
g_dComIfG_gameInfo.drawlist.setXluList();
|
||||
}
|
||||
|
||||
inline void dComIfGd_setListMaskOff() {
|
||||
g_dComIfG_gameInfo.drawlist.setOpaListMaskOff();
|
||||
g_dComIfG_gameInfo.drawlist.setXluListMaskOff();
|
||||
}
|
||||
|
||||
inline void dComIfGd_setListSky() {
|
||||
g_dComIfG_gameInfo.drawlist.setOpaListSky();
|
||||
g_dComIfG_gameInfo.drawlist.setXluListSky();
|
||||
}
|
||||
|
||||
inline void dComIfGd_setListP0() {
|
||||
g_dComIfG_gameInfo.drawlist.setOpaListP0();
|
||||
g_dComIfG_gameInfo.drawlist.setXluListP0();
|
||||
}
|
||||
|
||||
inline void dComIfGd_setListP1() {
|
||||
g_dComIfG_gameInfo.drawlist.setOpaListP1();
|
||||
g_dComIfG_gameInfo.drawlist.setXluListP1();
|
||||
}
|
||||
|
||||
inline void dComIfGd_setListBG() {
|
||||
g_dComIfG_gameInfo.drawlist.setOpaListBG();
|
||||
}
|
||||
|
||||
inline void dComIfGd_setXluListBG() {
|
||||
g_dComIfG_gameInfo.drawlist.setXluListBG();
|
||||
}
|
||||
|
||||
inline void dComIfGd_setListFilter() {
|
||||
g_dComIfG_gameInfo.drawlist.setOpaListFilter();
|
||||
g_dComIfG_gameInfo.drawlist.setXluListFilter();
|
||||
}
|
||||
|
||||
inline void dComIfGd_setList2D() {
|
||||
g_dComIfG_gameInfo.drawlist.setOpaList2D();
|
||||
g_dComIfG_gameInfo.drawlist.setXluList2D();
|
||||
}
|
||||
|
||||
inline void dComIfGd_entryZSortXluList(J3DPacket* i_packet, cXyz& param_1) {
|
||||
g_dComIfG_gameInfo.drawlist.entryZSortXluList(i_packet, param_1);
|
||||
}
|
||||
|
||||
@@ -214,10 +214,20 @@ public:
|
||||
void setOpaDrawList(J3DDrawBuffer* buffer) { j3dSys.setDrawBuffer(buffer, OPA_BUFFER); }
|
||||
void setOpaList() { setOpaDrawList(mpBufInvisibleModelOpa); }
|
||||
void setXluList() { setXluDrawList(mpBufInvisibleModelXlu); }
|
||||
void setOpaListMaskOff() { setOpaDrawList(mpBufInvisibleModelMaskOffOpa); }
|
||||
void setXluListMaskOff() { setXluDrawList(mpBufInvisibleModelMaskOffXlu); }
|
||||
void setOpaListSky() { setOpaDrawList(mpBufSkyOpa); }
|
||||
void setXluListSky() { setXluDrawList(mpBufSkyXlu); }
|
||||
void setOpaListP0() { setOpaDrawList(mpLinkBuf); }
|
||||
void setXluListP0() { setXluDrawList(mpLinkBuf); }
|
||||
void setOpaListP1() { setOpaDrawList(field_0x0000c); }
|
||||
void setXluListP1() { setXluDrawList(field_0x00010); }
|
||||
void setOpaListBG() { setOpaDrawList(mpBufWorldOpa); }
|
||||
void setXluListBG() { setXluDrawList(mpBufWorldXlu); }
|
||||
void setOpaListFilter() { setOpaDrawList(mpWetherFxBuffer); }
|
||||
void setXluListFilter() { setXluDrawList(mpWetherFxBuffer); }
|
||||
void setOpaList2D() { setOpaDrawList(field_0x00038); }
|
||||
void setXluList2D() { setXluDrawList(field_0x00038); }
|
||||
|
||||
void entryZSortXluList(J3DPacket* i_packet, cXyz& param_1) {
|
||||
entryZSortXluDrawList(mpBufInvisibleModelXlu, i_packet, param_1);
|
||||
|
||||
@@ -45,13 +45,13 @@ class mDoExt_btkAnm : public mDoExt_baseAnm {
|
||||
public:
|
||||
mDoExt_btkAnm() { mpTexMtxAnm = NULL; }
|
||||
int init(J3DMaterialTable* i_matTable, J3DAnmTextureSRTKey* i_btk, int i_anmPlay,
|
||||
int i_attribute, f32 i_rate, s16 i_start, s16 i_end, bool i_modify, bool i_entry);
|
||||
int i_attribute, f32 i_rate, s16 i_start, s16 i_end, bool i_modify, int i_entry);
|
||||
void entry(J3DMaterialTable* i_matTable, f32 i_frame);
|
||||
void entry(J3DModelData *i_modelData, f32 i_frame);
|
||||
|
||||
void entry(J3DModelData* i_modelData) { entry(i_modelData, getFrame()); }
|
||||
int init(J3DModelData* i_modelData, J3DAnmTextureSRTKey* i_btk, int i_anmPlay, int i_attribute,
|
||||
f32 i_rate, s16 i_start, s16 i_end, bool i_modify, bool i_entry);
|
||||
f32 i_rate, s16 i_start, s16 i_end, bool i_modify, int i_entry);
|
||||
|
||||
int remove(J3DModelData* i_modelData) { return i_modelData->removeTexMtxAnimator(mpAnm); }
|
||||
void entryFrame() { entryFrame(getFrame()); }
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
static bool isAutoForcus() { return data_80450BE7; } */
|
||||
static void setTickRate(u32 rate) { JFWDisplay::getManager()->setTickRate(rate); }
|
||||
static void waitBlanking(int wait) { JFWDisplay::getManager()->waitBlanking(wait); }
|
||||
static BOOL isMonotone() { return mMonotone; }
|
||||
|
||||
static ResTIMG* getFrameBufferTimg() { return mFrameBufferTimg; }
|
||||
static void* getFrameBufferTex() { return mFrameBufferTex; }
|
||||
@@ -74,6 +75,9 @@ public:
|
||||
static bool mBlureFlag;
|
||||
static u8 mBlureRate;
|
||||
static u8 mFade;
|
||||
static u8 mMonotone;
|
||||
static s16 mMonotoneRate;
|
||||
static s16 mMonotoneRateSpeed;
|
||||
};
|
||||
|
||||
#endif /* M_DO_M_DO_GRAPHIC_H */
|
||||
@@ -226,8 +226,10 @@ void daArrow_c::setKeepMatrix() {
|
||||
daPy_py_c* player = daPy_getPlayerActorClass();
|
||||
|
||||
mDoMtx_stack_c::transS(0.7f, -0.07f, -0.2f);
|
||||
// TODO: How did they pass an unsigned short (0xB0B6) to a function that takes a signed short?
|
||||
mDoMtx_stack_c::XYZrotM(0xB0B6, 0x238E, -0x6333);
|
||||
// This function takes three signed shorts, but one of the literals passed here is unsigned.
|
||||
// X rotation must be a float literal to force the compiler to pass an unsigned short.
|
||||
// Z rotation must be an int literal to pass a signed short as normal.
|
||||
mDoMtx_stack_c::XYZrotM((248.5f*65536)/360, 0x238E, -0x6333);
|
||||
|
||||
MtxP handMtx = player->getLeftHandMatrix();
|
||||
cMtx_concat(handMtx, mDoMtx_stack_c::get(), mDoMtx_stack_c::get());
|
||||
|
||||
@@ -120,7 +120,7 @@ void daItem_c::CreateInit() {
|
||||
mAcch.Set(¤t.pos, &next.pos, this, 1, &mAcchCir, speedPtr = &speed, NULL, NULL);
|
||||
mAcch.m_flags &= ~0x400;
|
||||
mAcch.m_flags &= ~0x8;
|
||||
mCullMtx = mModel->mBaseTransformMtx;
|
||||
mCullMtx = mpModel->mBaseTransformMtx;
|
||||
mStts.Init(0, 0xFF, this);
|
||||
mCyl.Set(m_cyl_src);
|
||||
mCyl.SetStts(&mStts);
|
||||
@@ -329,13 +329,13 @@ void daItem_c::setTevStr() {
|
||||
mTevStr.mColorK0.r = 0xFF;
|
||||
mTevStr.mColorK0.g = 0xFF;
|
||||
mTevStr.mColorK0.b = 0xFF;
|
||||
g_env_light.setLightTevColorType(mModel, &mTevStr);
|
||||
g_env_light.setLightTevColorType(mpModel, &mTevStr);
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (!mModelArrow[i]) {
|
||||
if (!mpModelArrow[i]) {
|
||||
continue;
|
||||
}
|
||||
g_env_light.setLightTevColorType(mModelArrow[i], &mTevStr);
|
||||
g_env_light.setLightTevColorType(mpModelArrow[i], &mTevStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ void daItem_c::setItemTimer(int timer) {
|
||||
|
||||
/* 800F6E74-800F6EC8 .text checkPlayerGet__8daItem_cFv */
|
||||
BOOL daItem_c::checkPlayerGet() {
|
||||
if (field20_0x638 < getData()->field47_0x42) {
|
||||
if (field_0x638 < getData()->field47_0x42) {
|
||||
return FALSE;
|
||||
}
|
||||
if (mCurState == 3) {
|
||||
|
||||
+136
-74
@@ -4,188 +4,250 @@
|
||||
//
|
||||
|
||||
#include "d/actor/d_a_itembase.h"
|
||||
#include "d/d_item.h"
|
||||
#include "d/d_item_data.h"
|
||||
#include "d/d_resorce.h"
|
||||
#include "d/d_drawlist.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "d/d_item_data.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/actor/d_a_player_link.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/* 800F8A14-800F8A3C .text DeleteBase__12daItemBase_cFPCc */
|
||||
s32 daItemBase_c::DeleteBase(const char* resName) {
|
||||
BOOL daItemBase_c::DeleteBase(const char* resName) {
|
||||
dComIfG_resDelete(&mPhs, resName);
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 800F8A3C-800F8A44 .text clothCreate__12daItemBase_cFv */
|
||||
s32 daItemBase_c::clothCreate() {
|
||||
return 1;
|
||||
BOOL daItemBase_c::clothCreate() {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 800F8A44-800F9074 .text CreateItemHeap__12daItemBase_cFPCcsssssss */
|
||||
s32 daItemBase_c::CreateItemHeap(const char* resName, short resIdx, short btkAnm1, short btkAnm2, short brkAnm1, short brkAnm2, short bckAnm, short) {
|
||||
/* Nonmatching */
|
||||
BOOL daItemBase_c::CreateItemHeap(const char* resName, short resIdx, short btkAnm1, short btkAnm2, short brkAnm1, short brkAnm2, short bckAnm, short) {
|
||||
JUT_ASSERT(78, 0 <= m_itemNo && m_itemNo <= 255);
|
||||
|
||||
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(resName, resIdx);
|
||||
JUT_ASSERT(85, modelData != 0);
|
||||
|
||||
mModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
|
||||
if (!mModel) {
|
||||
return 0;
|
||||
mpModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
|
||||
if (!mpModel) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
switch (m_itemNo) {
|
||||
case ARROW_30:
|
||||
mModelArrow[0] = mDoExt_J3DModel__create(modelData, 8, 0x11000002);
|
||||
if (!mModelArrow[0]) {
|
||||
return 0;
|
||||
mpModelArrow[0] = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000002);
|
||||
if (!mpModelArrow[0]) {
|
||||
return FALSE;
|
||||
}
|
||||
case ARROW_20:
|
||||
mModelArrow[1] = mDoExt_J3DModel__create(modelData, 8, 0x11000002);
|
||||
if (!mModelArrow[1]) {
|
||||
return 0;
|
||||
mpModelArrow[1] = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000002);
|
||||
if (!mpModelArrow[1]) {
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
mModelArrow[1] = NULL;
|
||||
mModelArrow[0] = NULL;
|
||||
mpModelArrow[1] = NULL;
|
||||
mpModelArrow[0] = NULL;
|
||||
}
|
||||
|
||||
mBtkAnm1 = NULL;
|
||||
J3DAnmTextureSRTKey* pbtk;
|
||||
mpBtkAnm1 = NULL;
|
||||
if (btkAnm1 != -1) {
|
||||
J3DAnmTextureSRTKey* pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(resName, btkAnm1);
|
||||
pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(resName, btkAnm1);
|
||||
JUT_ASSERT(140, pbtk != 0);
|
||||
mBtkAnm1 = new mDoExt_btkAnm();
|
||||
if (!mBtkAnm1 || !mBtkAnm1->init(modelData, pbtk, true, 2, 1.0, 0, -1, false, false)) {
|
||||
return 0;
|
||||
mpBtkAnm1 = new mDoExt_btkAnm();
|
||||
if (!mpBtkAnm1 || !mpBtkAnm1->init(modelData, pbtk, TRUE, 2, 1.0, 0, -1, false, 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
mBtkAnm2 = NULL;
|
||||
mpBtkAnm2 = NULL;
|
||||
if (btkAnm2 != -1) {
|
||||
J3DAnmTextureSRTKey* pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(resName, btkAnm2);
|
||||
JUT_ASSERT(172, pbtk != 0);
|
||||
mBtkAnm2 = new mDoExt_btkAnm();
|
||||
if (!mBtkAnm2 || !mBtkAnm2->init(modelData, pbtk, true, 2, 1.0, 0, -1, false, false)) {
|
||||
return 0;
|
||||
pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(resName, btkAnm2);
|
||||
JUT_ASSERT(156, pbtk != 0);
|
||||
mpBtkAnm2 = new mDoExt_btkAnm();
|
||||
if (!mpBtkAnm2 || !mpBtkAnm2->init(modelData, pbtk, TRUE, 2, 1.0, 0, -1, false, 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
mBrkAnm1 = NULL;
|
||||
J3DAnmTevRegKey* pbrk;
|
||||
mpBrkAnm1 = NULL;
|
||||
if (brkAnm1 != -1) {
|
||||
J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(resName, brkAnm1);
|
||||
pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(resName, brkAnm1);
|
||||
JUT_ASSERT(172, pbrk != 0);
|
||||
int shouldAnimate = dItem_data::item_resource[m_itemNo].mTevRegAnimFrameIndex == 0xFF;
|
||||
mBrkAnm1 = new mDoExt_brkAnm();
|
||||
if (!mBrkAnm1 || !mBrkAnm1->init(modelData, pbrk, shouldAnimate, 2, 1.0, 0, -1, false, false)) {
|
||||
return 0;
|
||||
s8 tevFrm = dItem_data::getTevFrm(m_itemNo);
|
||||
BOOL shouldAnimate = TRUE;
|
||||
if (tevFrm != -1) {
|
||||
shouldAnimate = FALSE;
|
||||
}
|
||||
mpBrkAnm1 = new mDoExt_brkAnm();
|
||||
if (!mpBrkAnm1 || !mpBrkAnm1->init(modelData, pbrk, shouldAnimate, 2, 1.0, 0, -1, false, false)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
mBrkAnm2 = NULL;
|
||||
mpBrkAnm2 = NULL;
|
||||
if (brkAnm2 != -1) {
|
||||
J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(resName, brkAnm2);
|
||||
pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(resName, brkAnm2);
|
||||
JUT_ASSERT(197, pbrk != 0);
|
||||
mBrkAnm2 = new mDoExt_brkAnm();
|
||||
if (!mBrkAnm2 || !mBrkAnm2->init(modelData, pbrk, true, 2, 1.0, 0, -1, false, false)) {
|
||||
return 0;
|
||||
mpBrkAnm2 = new mDoExt_brkAnm();
|
||||
if (!mpBrkAnm2 || !mpBrkAnm2->init(modelData, pbrk, TRUE, 2, 1.0, 0, -1, false, false)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
mBckAnm = NULL;
|
||||
J3DAnmTransform* pbck;
|
||||
mpBckAnm = NULL;
|
||||
if (bckAnm != -1) {
|
||||
J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes(resName, bckAnm);
|
||||
pbck = (J3DAnmTransform*)dComIfG_getObjectRes(resName, bckAnm);
|
||||
JUT_ASSERT(212, pbck != 0);
|
||||
mBckAnm = new mDoExt_bckAnm();
|
||||
if (!mBckAnm || !mBckAnm->init(modelData, pbck, true, 2, 1.0, 0, -1, false)) {
|
||||
return 0;
|
||||
mpBckAnm = new mDoExt_bckAnm();
|
||||
if (!mpBckAnm || !mpBckAnm->init(modelData, pbck, TRUE, 2, 1.0, 0, -1, false)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!clothCreate()) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 800F9074-800F9130 .text DrawBase__12daItemBase_cFv */
|
||||
s32 daItemBase_c::DrawBase() {
|
||||
BOOL daItemBase_c::DrawBase() {
|
||||
setTevStr();
|
||||
animEntry();
|
||||
setListStart();
|
||||
settingBeforeDraw();
|
||||
|
||||
mDoExt_modelUpdateDL(mModel);
|
||||
mDoExt_modelUpdateDL(mpModel);
|
||||
|
||||
if (mModelArrow[0]) {
|
||||
mDoExt_modelUpdateDL(mModelArrow[0]);
|
||||
if (mpModelArrow[0]) {
|
||||
mDoExt_modelUpdateDL(mpModelArrow[0]);
|
||||
}
|
||||
if (mModelArrow[1]) {
|
||||
mDoExt_modelUpdateDL(mModelArrow[1]);
|
||||
if (mpModelArrow[1]) {
|
||||
mDoExt_modelUpdateDL(mpModelArrow[1]);
|
||||
}
|
||||
|
||||
setListEnd();
|
||||
setShadow();
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 800F9130-800F9184 .text setListStart__12daItemBase_cFv */
|
||||
void daItemBase_c::setListStart() {
|
||||
/* Nonmatching */
|
||||
if (!mDoGph_gInf_c::isMonotone()) {
|
||||
dComIfGd_setListMaskOff();
|
||||
} else {
|
||||
dComIfGd_setListP1();
|
||||
}
|
||||
}
|
||||
|
||||
/* 800F9184-800F91A8 .text setListEnd__12daItemBase_cFv */
|
||||
void daItemBase_c::setListEnd() {
|
||||
/* Nonmatching */
|
||||
dComIfGd_setList();
|
||||
}
|
||||
|
||||
/* 800F91A8-800F9244 .text settingBeforeDraw__12daItemBase_cFv */
|
||||
void daItemBase_c::settingBeforeDraw() {
|
||||
/* Nonmatching */
|
||||
if (isBomb(m_itemNo)) {
|
||||
daPy_lk_c* link = daPy_getPlayerLinkActorClass();
|
||||
link->getBombBrk()->setFrame(0.0f);
|
||||
mpModel->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
|
||||
}
|
||||
|
||||
if (m_itemNo == BOMB_BAG || m_itemNo == HUMMER || m_itemNo == SMALL_KEY) {
|
||||
dDlst_texSpecmapST(&mEyePos, &mTevStr, mpModel->getModelData(), 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
/* 800F9244-800F92DC .text setTevStr__12daItemBase_cFv */
|
||||
void daItemBase_c::setTevStr() {
|
||||
/* Nonmatching */
|
||||
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, getPositionP(), &mTevStr);
|
||||
g_env_light.setLightTevColorType(mpModel, &mTevStr);
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (!mpModelArrow[i]) {
|
||||
continue;
|
||||
}
|
||||
g_env_light.setLightTevColorType(mpModelArrow[i], &mTevStr);
|
||||
}
|
||||
}
|
||||
|
||||
/* 800F92DC-800F93A8 .text setShadow__12daItemBase_cFv */
|
||||
void daItemBase_c::setShadow() {
|
||||
/* Nonmatching */
|
||||
f32 shadowSize = mScale.x * dItem_data::getShadowSize(m_itemNo);
|
||||
if (!dItem_data::chkFlag(m_itemNo, 0x10)) {
|
||||
dComIfGd_setSimpleShadow2(
|
||||
getPositionP(), mAcch.GetGroundH(), shadowSize, mAcch.m_gnd,
|
||||
0, 1.0f, dDlst_shadowControl_c::getSimpleTex()
|
||||
);
|
||||
} else {
|
||||
mShadowId = dComIfGd_setShadow(
|
||||
mShadowId, 1, mpModel, getPositionP(), 80.0f, shadowSize,
|
||||
current.pos.y, mAcch.GetGroundH(), mAcch.m_gnd, &mTevStr,
|
||||
0, 1.0f, dDlst_shadowControl_c::getSimpleTex()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/* 800F93A8-800F94C0 .text animEntry__12daItemBase_cFv */
|
||||
void daItemBase_c::animEntry() {
|
||||
/* Nonmatching */
|
||||
if (mBrkAnm1) {
|
||||
int constantFrame = dItem_data::item_resource[m_itemNo].mTevRegAnimFrameIndex;
|
||||
if (mpBrkAnm1) {
|
||||
int constantFrame = dItem_data::getTevFrm(m_itemNo);
|
||||
if (constantFrame != -1) {
|
||||
mBrkAnm1->entry(mModel->getModelData(), constantFrame);
|
||||
mpBrkAnm1->entry(mpModel->getModelData(), constantFrame);
|
||||
} else {
|
||||
mBrkAnm1->entry(mModel->getModelData());
|
||||
mpBrkAnm1->entry(mpModel->getModelData());
|
||||
}
|
||||
}
|
||||
if (mBtkAnm1) {
|
||||
mBtkAnm1->entry(mModel->getModelData());
|
||||
if (mpBtkAnm1) {
|
||||
mpBtkAnm1->entry(mpModel->getModelData());
|
||||
}
|
||||
if (mBrkAnm2) {
|
||||
mBrkAnm2->entry(mModel->getModelData());
|
||||
if (mpBrkAnm2) {
|
||||
mpBrkAnm2->entry(mpModel->getModelData());
|
||||
}
|
||||
if (mBtkAnm2) {
|
||||
mBtkAnm2->entry(mModel->getModelData());
|
||||
if (mpBtkAnm2) {
|
||||
mpBtkAnm2->entry(mpModel->getModelData());
|
||||
}
|
||||
if (mBckAnm) {
|
||||
mBckAnm->entry(mModel->getModelData());
|
||||
if (mpBckAnm) {
|
||||
mpBckAnm->entry(mpModel->getModelData());
|
||||
}
|
||||
}
|
||||
|
||||
/* 800F94C0-800F95B8 .text animPlay__12daItemBase_cFfffff */
|
||||
void daItemBase_c::animPlay(float, float, float, float, float) {
|
||||
/* Nonmatching */
|
||||
void daItemBase_c::animPlay(f32 brk1Speed, f32 brk2Speed, f32 btk1Speed, f32 btk2Speed, f32 bckSpeed) {
|
||||
if (mpBrkAnm1 && dItem_data::getTevFrm(m_itemNo) == -1) {
|
||||
mpBrkAnm1->setPlaySpeed(brk1Speed);
|
||||
mpBrkAnm1->play();
|
||||
}
|
||||
|
||||
if (mpBtkAnm1) {
|
||||
mpBtkAnm1->setPlaySpeed(btk1Speed);
|
||||
mpBtkAnm1->play();
|
||||
}
|
||||
|
||||
if (mpBrkAnm2) {
|
||||
mpBrkAnm2->setPlaySpeed(brk2Speed);
|
||||
mpBrkAnm2->play();
|
||||
}
|
||||
|
||||
if (mpBtkAnm2) {
|
||||
mpBtkAnm2->setPlaySpeed(btk2Speed);
|
||||
mpBtkAnm2->play();
|
||||
}
|
||||
|
||||
if (mpBckAnm) {
|
||||
mpBckAnm->setPlaySpeed(bckSpeed);
|
||||
mpBckAnm->play();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,20 +21,20 @@ const f32 daShopItem_c::m_cullfar_max = 5000.0f;
|
||||
char* daShopItem_c::getShopArcname() {
|
||||
u8 type = fopAcM_GetParamBit(this, 8, 4);
|
||||
if(type == 1 || (type == 0 && mModelType[m_itemNo] == 0x01)) {
|
||||
return dItem_data::field_item_res[m_itemNo].mModelArcName;
|
||||
return dItem_data::getFieldArc(m_itemNo);
|
||||
}
|
||||
else {
|
||||
return dItem_data::item_resource[m_itemNo].mModelArcName;
|
||||
return dItem_data::getArcname(m_itemNo);
|
||||
}
|
||||
}
|
||||
|
||||
s16 daShopItem_c::getShopBmdIdx() {
|
||||
u8 type = fopAcM_GetParamBit(this, 8, 4);
|
||||
if(type == 1 || (type == 0 && mModelType[m_itemNo] == 0x01)) {
|
||||
return dItem_data::field_item_res[m_itemNo].mModelFileId;
|
||||
return dItem_data::getFieldBmdIdx(m_itemNo);
|
||||
}
|
||||
else {
|
||||
return dItem_data::item_resource[m_itemNo].mModelFileIdx;
|
||||
return dItem_data::getBmdIdx(m_itemNo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ void daShopItem_c::CreateInit() {
|
||||
tevType = (TevType)0x5C;
|
||||
}
|
||||
|
||||
mModel->setUserArea(0);
|
||||
mpModel->setUserArea(0);
|
||||
}
|
||||
|
||||
s32 daShopItem_c::clothCreate() {
|
||||
BOOL daShopItem_c::clothCreate() {
|
||||
if(isUseClothPacket(m_itemNo)) {
|
||||
dCloth_packet_c* (*clothFunc[4])(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**) = {dClothVobj03_create, dClothVobj04_create, dClothVobj05_create, dClothVobj07_0_create};
|
||||
u32 clothRes[4] = {0x20, 0x21, 0x22, 0x23};
|
||||
@@ -96,7 +96,7 @@ s32 daShopItem_c::clothCreate() {
|
||||
}
|
||||
|
||||
void daShopItem_c::set_mtx() {
|
||||
mModel->setBaseScale(mScale);
|
||||
mpModel->setBaseScale(mScale);
|
||||
MTXTrans(mDoMtx_stack_c::get(), current.pos.x, current.pos.y, current.pos.z);
|
||||
mDoMtx_stack_c::ZXYrotM(current.angle.x, current.angle.y, current.angle.z);
|
||||
MTXCopy(mDoMtx_stack_c::get(), field_0x64C);
|
||||
@@ -105,7 +105,7 @@ void daShopItem_c::set_mtx() {
|
||||
mDoMtx_stack_c::transM(temp1.x, temp1.y, temp1.z);
|
||||
const SVec& temp2 = getData()[m_itemNo].field_0x18;
|
||||
mDoMtx_stack_c::ZXYrotM(temp2.x, temp2.y, temp2.z);
|
||||
MTXCopy(mDoMtx_stack_c::get(), mModel->mBaseTransformMtx);
|
||||
MTXCopy(mDoMtx_stack_c::get(), mpModel->mBaseTransformMtx);
|
||||
|
||||
if(field_0x644 != 0) {
|
||||
// I have no clue why Nintendo would do this but it works
|
||||
@@ -139,7 +139,7 @@ bool daShopItem_c::_draw() {
|
||||
if(chkDraw() == 0) return 1;
|
||||
|
||||
if(m_itemNo == WATER_STATUE || m_itemNo == POSTMAN_STATUE) {
|
||||
mModel->getModelData()->getJointTree().getJointNodePointer(0)->setMtxCalc(0);
|
||||
mpModel->getModelData()->getJointTree().getJointNodePointer(0)->setMtxCalc(0);
|
||||
}
|
||||
DrawBase();
|
||||
|
||||
@@ -150,16 +150,16 @@ bool daShopItem_c::_draw() {
|
||||
|
||||
void daShopItem_c::settingBeforeDraw() {
|
||||
if(isBomb(m_itemNo) || (m_itemNo == BOMB_BAG) || (m_itemNo == HUMMER) || m_itemNo == SMALL_KEY || m_itemNo == PRESIDENT_STATUE) {
|
||||
dDlst_texSpecmapST(&mEyePos, &mTevStr, mModel->getModelData(), 1.0f);
|
||||
dDlst_texSpecmapST(&mEyePos, &mTevStr, mpModel->getModelData(), 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void daShopItem_c::setTevStr() {
|
||||
g_env_light.settingTevStruct(tevType, getPositionP(), &mTevStr);
|
||||
g_env_light.setLightTevColorType(mModel, &mTevStr);
|
||||
g_env_light.setLightTevColorType(mpModel, &mTevStr);
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(mModelArrow[i] != 0) {
|
||||
g_env_light.setLightTevColorType(mModelArrow[i], &mTevStr);
|
||||
if(mpModelArrow[i] != 0) {
|
||||
g_env_light.setLightTevColorType(mpModelArrow[i], &mTevStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ static actor_method_class daShopItemMethodTable = {
|
||||
(process_method_func)daShopItem_Delete,
|
||||
(process_method_func)daShopItem_Execute,
|
||||
(process_method_func)daShopItem_IsDelete,
|
||||
(process_method_func)0,
|
||||
(process_method_func)daShopItem_Draw,
|
||||
};
|
||||
|
||||
extern actor_process_profile_definition g_profile_ShopItem = {
|
||||
|
||||
@@ -263,7 +263,7 @@ const daShopItem_c_m_data daShopItem_c::mData[255] = {
|
||||
{{1.0f, 1.0f, 1.0f}, {0.0f, 20.0f, 0.0f}, {0, 0, 0}},
|
||||
{{1.0f, 1.0f, 1.0f}, {0.0f, 20.0f, 0.0f}, {0, 0, 0}},
|
||||
};
|
||||
const u8 daShopItem_c::mModelType[256] = {
|
||||
const u8 daShopItem_c::mModelType[255] = {
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
@@ -519,7 +519,6 @@ const u8 daShopItem_c::mModelType[256] = {
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
0
|
||||
};
|
||||
|
||||
cXyz* daShopItem_c::getScaleP() {
|
||||
|
||||
Reference in New Issue
Block a user