mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-05 18:57:14 -04:00
b289dece80
* fix kankyo UB
* Fix TEV Stage DL writing
BE issue
* BE Fixes in materials/shapes
* Move to Aurora GD impl
* JUTDataFileHeader
* j3d: load vertex and texture not through GD
* Endian swap vertex data (mostly)
* Just exit(0) when closing the game
Fix crashes :godo:
* fix fopAcM_ct_placement and remove memcpy
* J3D: track vertex arrays correctly, swap work
* fix visibility, turn off overridden new/delete when we call into aurora
* event: cut name be
* Default window improvements
Double size, allow OS to decide position
* survive TParse::parseHeader_next
* color swap fix
* swap endian/fixes oob function pointer
* Remove GXGetViewportv stub
Aurora has it now
* Set array pointers via GD again
Relies on https://github.com/encounter/aurora/pull/35
* Let Aurora decide graphics backend
* disable procbar drawing
* Fix TColor endianness conversion issues
Fixes the wrong color for the flashing logo
* cam param swap
* simplify vtx loading, mat/amb color fix
* endian swap stb/fvb data
* aurora stat changes
* fix storage buffer crash
dont unnecessarily reassign vertex buffers in a way that forces aurora to recache things
* set bgobj spec fix
* add camera debug, endian swap more stb data, d_a_bg_obj::spec_data_c swapped
* JKRExpHeap: fix bad allocator slowdown
* solid tex
* texture caching
* log level
* fix window aspect ratio, disable bloom, endian swap camera type data
camera is now actually playing opening cutscene!!!!
* add GXDestroyTexObj to a couple stack init'd GXTexObjs, remove some diag printfs
* endian swap joint weight envelope data
* move to dusk config
* verbose arg errors
* better stub logging (for now)
* less logging, more BE
* more stubbing, move logging stuff around
* move all logging to aurora logging
* fix STUB_LOG, __FUNCTION__ isn't a string literal, wasn't building as it
was.
* update aurora
* fix heap alignment mismatch and always head align for now
* prevent them from fucking up my shit
* forward jut warning to DuskLog
* remove report logging
* maybe and i must emphasize maybe fix JMessage parsing
* this was a dumb idea
* preserve negative alignment for JKRHeap
* use normal free on macos and linux
* ^
* fix JMAHermiteInterpolation c impl
* endian swap J2DScreen mColor (oops)
* swap more J3D anim data, remove weird pointer addr check in J3DMaterial getMaterialAnm
* typo fix
* Fix aligned_alloc() size issues on POSIX
aligned_alloc() requires its input size to be a multiple of alignment. This wasn't being upheld so there were allocation failures in init code that made the game fail to start outside Windows.
Also just cleaned up some of this code a bit and removed fallback cases that *shouldn't* get hit.
* _Exit instead of exit()
Seriously I don't want destructors to run. Let the OS reclaim that shit.
* Reapply "Isolate JKRHeap operator overloads" (#39)
This reverts commit 3623b27f37.
* Fix some oopsies
* Fix hardcoded pointer size in JUTCacheFont::allocArray
* More operator overload fixes
Add void template specialization for jkrDelete
Add new[] placement overload. Apparently.
* Fix delete macros on nullptr
TIL C++ allows that.
* fix delete[]
* fix new(std::nothrow) overload
* fix avoid ub
* swap remaining anim data needed for title logo
* get rid of op 7
* move aurora_end_frame to correct spot
* juttexture destroy tex
* j2d animation be
* shutdown crash
* link warp material fix
* mDoExt_3DlineMat1_c fix
* hacky keyboard controls
* endian swap J2DResReference, add kb_pad to files.cmake
* fix some missing endian swaps in J2D, remove addr alignment check
* Remove heap unsetting in aurora calls
Never worked properly and not the right solution even if it did
* Don't print in DC stubs
They're fine to never implement
* Fix alignment stuff again
* Compile GF from dolphin lib
Doesn't seem to break anything and shuts up some stub warnings
* j3dtexture tlut obj fix
* addTexMtxIndexInDL fix
* don't recreate null tex data every frame
* the actual fix i wanted to push
* its kinda fakematch city over here
* insert hte efb copy
* limited window size / viewport support
* IsDelete FIX
---------
Co-authored-by: madeline <qwertytrogi@gmail.com>
Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: Jeffrey Crowell <jeff@crowell.biz>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
322 lines
9.8 KiB
C++
322 lines
9.8 KiB
C++
#ifndef D_A_NPC_FAIRY_H
|
|
#define D_A_NPC_FAIRY_H
|
|
|
|
#include "d/actor/d_a_npc.h"
|
|
|
|
/**
|
|
* @ingroup actors-npcs
|
|
* @class daNpc_Fairy_c
|
|
* @brief Great Fairy
|
|
*
|
|
* @details
|
|
*
|
|
*/
|
|
|
|
class daNpc_Fairy_c;
|
|
|
|
class _Fairy_Feather_c {
|
|
public:
|
|
enum Joint {
|
|
/* 0x00 */ JNT_ROOT,
|
|
/* 0x01 */ JNT_TUKENE,
|
|
/* 0x02 */ JNT_FEATHER1AL1,
|
|
/* 0x03 */ JNT_FEATHER1AL2,
|
|
/* 0x04 */ JNT_FEATHER1AR1,
|
|
/* 0x05 */ JNT_FEATHER1AR2,
|
|
/* 0x06 */ JNT_FEATHER1BL1,
|
|
/* 0x07 */ JNT_FEATHER1BL2,
|
|
/* 0x08 */ JNT_FEATHER1BR1,
|
|
/* 0x09 */ JNT_FEATHER1BR2,
|
|
/* 0x0A */ JNT_FEATHER2AL1,
|
|
/* 0x0B */ JNT_FEATHER2AL2,
|
|
/* 0x0C */ JNT_FEATHER2AR1,
|
|
/* 0x0D */ JNT_FEATHER2AR2,
|
|
/* 0x0E */ JNT_FEATHER2BL1,
|
|
/* 0x0F */ JNT_FEATHER2BL2,
|
|
/* 0x10 */ JNT_FEATHER2BR1,
|
|
/* 0x11 */ JNT_FEATHER2BR2,
|
|
/* 0x12 */ JNT_FEATHER3AL1,
|
|
/* 0x13 */ JNT_FEATHER3AL2,
|
|
/* 0x14 */ JNT_FEATHER3AR1,
|
|
/* 0x15 */ JNT_FEATHER3AR2,
|
|
/* 0x16 */ JNT_FEATHER3BL1,
|
|
/* 0x17 */ JNT_FEATHER3BL2,
|
|
/* 0x18 */ JNT_FEATHER3BR1,
|
|
/* 0x19 */ JNT_FEATHER3BR2,
|
|
};
|
|
|
|
_Fairy_Feather_c() {
|
|
mpMorf = NULL;
|
|
mPrevAnm = -1;
|
|
}
|
|
~_Fairy_Feather_c() {
|
|
if (mpMorf != NULL) {
|
|
JKR_DELETE(mpMorf);
|
|
mpMorf = NULL;
|
|
}
|
|
}
|
|
BOOL create();
|
|
BOOL loadModel();
|
|
BOOL setAnm(int);
|
|
BOOL setBrk(int);
|
|
BOOL setBtk(int);
|
|
static int ctrlJointCallBack(J3DJoint*, int);
|
|
void connect(daNpc_Fairy_c*);
|
|
void draw(daNpc_Fairy_c*);
|
|
|
|
void output_anmframe() {}
|
|
|
|
void playAnm() {
|
|
mBtkAnm.play();
|
|
mBrkAnm.play();
|
|
mpMorf->play(0, 0);
|
|
}
|
|
|
|
f32 getAnmFrame() { return mpMorf->getFrame(); }
|
|
void setAnmFrame(f32 i_frame) { mpMorf->setFrame(i_frame); }
|
|
void setAnmPlaySpeed(f32 i_playSpeed) { mpMorf->setPlaySpeed(i_playSpeed); }
|
|
|
|
/* 0x00 */ mDoExt_McaMorfSO* mpMorf;
|
|
/* 0x04 */ mDoExt_invisibleModel mModel;
|
|
/* 0x0C */ mDoExt_btkAnm mBtkAnm;
|
|
/* 0x24 */ mDoExt_brkAnm mBrkAnm;
|
|
/* 0x3C */ int mPrevAnm;
|
|
/* 0x40 */ Z2Creature mSound;
|
|
};
|
|
|
|
struct daNpc_Fairy_HIOParam {
|
|
/* 0x00 */ daNpcT_HIOParam common;
|
|
/* 0x8C */ f32 spirit_width;
|
|
/* 0x90 */ f32 spirit_height;
|
|
};
|
|
|
|
class daNpc_Fairy_Param_c {
|
|
public:
|
|
virtual ~daNpc_Fairy_Param_c() {}
|
|
|
|
static daNpc_Fairy_HIOParam const m;
|
|
};
|
|
|
|
#if DEBUG
|
|
class daNpc_Fairy_HIO_c : public mDoHIO_entry_c {
|
|
public:
|
|
daNpc_Fairy_HIO_c();
|
|
void listenPropertyEvent(const JORPropertyEvent*);
|
|
void genMessage(JORMContext*);
|
|
|
|
/* 0x4 */ daNpc_Fairy_HIOParam m;
|
|
};
|
|
|
|
#define NPC_FAIRY_HIO_CLASS daNpc_Fairy_HIO_c
|
|
#else
|
|
#define NPC_FAIRY_HIO_CLASS daNpc_Fairy_Param_c
|
|
#endif
|
|
|
|
class daNpc_Fairy_c : public daNpcT_c {
|
|
public:
|
|
enum Joint {
|
|
/* 0x00 */ JNT_CENTER,
|
|
/* 0x01 */ JNT_BACKBONE1,
|
|
/* 0x02 */ JNT_BACKBONE2,
|
|
/* 0x03 */ JNT_BHAIR1,
|
|
/* 0x04 */ JNT_BHAIR2,
|
|
/* 0x05 */ JNT_BHAIR3,
|
|
/* 0x06 */ JNT_FHAIRL1,
|
|
/* 0x07 */ JNT_FHAIRL2,
|
|
/* 0x08 */ JNT_FHAIRL3,
|
|
/* 0x09 */ JNT_FHAIRR1,
|
|
/* 0x0A */ JNT_FHAIRR2,
|
|
/* 0x0B */ JNT_FHAIRR3,
|
|
/* 0x0C */ JNT_NECK,
|
|
/* 0x0D */ JNT_HEAD,
|
|
/* 0x0E */ JNT_CHIN,
|
|
/* 0x0F */ JNT_MAYUL,
|
|
/* 0x10 */ JNT_MAYUR,
|
|
/* 0x11 */ JNT_MOUTH,
|
|
/* 0x12 */ JNT_SHOULDERL,
|
|
/* 0x13 */ JNT_ARML1,
|
|
/* 0x14 */ JNT_ARML2,
|
|
/* 0x15 */ JNT_HANDL,
|
|
/* 0x16 */ JNT_FINGERL,
|
|
/* 0x17 */ JNT_THAMBL,
|
|
/* 0x18 */ JNT_SHOULDERR,
|
|
/* 0x19 */ JNT_ARMR1,
|
|
/* 0x1A */ JNT_ARMR2,
|
|
/* 0x1B */ JNT_HANDR,
|
|
/* 0x1C */ JNT_FINGERR,
|
|
/* 0x1D */ JNT_THAMBR,
|
|
/* 0x1E */ JNT_WAIST,
|
|
/* 0x1F */ JNT_CLOTH,
|
|
/* 0x20 */ JNT_LEGL1,
|
|
/* 0x21 */ JNT_LEGL2,
|
|
/* 0x22 */ JNT_FOOTL,
|
|
/* 0x23 */ JNT_TOEL,
|
|
/* 0x24 */ JNT_LEGR1,
|
|
/* 0x25 */ JNT_LEGR2,
|
|
/* 0x26 */ JNT_FOOTR,
|
|
/* 0x27 */ JNT_TOER,
|
|
};
|
|
|
|
typedef int (daNpc_Fairy_c::*actionFunc)(int);
|
|
typedef int (daNpc_Fairy_c::*cutFunc)(int);
|
|
|
|
~daNpc_Fairy_c();
|
|
cPhs_Step Create();
|
|
int CreateHeap();
|
|
void setAnmData();
|
|
bool setMotionAnm(int, f32, int);
|
|
bool afterSetMotionAnm(int, int, f32, int);
|
|
int Delete();
|
|
int Execute();
|
|
int Draw();
|
|
void drawOtherMdl();
|
|
static int createHeapCallBack(fopAc_ac_c*);
|
|
static int ctrlJointCallBack(J3DJoint*, int);
|
|
BOOL isDelete();
|
|
void reset();
|
|
void initStatus();
|
|
void afterJntAnm(int);
|
|
void setParam();
|
|
BOOL checkChangeEvt();
|
|
void setAfterTalkMotion();
|
|
void srchActors();
|
|
BOOL evtTalk();
|
|
BOOL evtCutProc();
|
|
BOOL evtEndProc();
|
|
void action();
|
|
void ptcl_water();
|
|
void ptcl_sprit();
|
|
void _to_FairyField();
|
|
int chk_tempbit();
|
|
void beforeMove();
|
|
void afterMoved();
|
|
void setAttnPos();
|
|
void setCollision();
|
|
int drawDbgInfo();
|
|
BOOL setAction(actionFunc, int);
|
|
int wait(int);
|
|
int talk(int);
|
|
int test(int);
|
|
void AppearDemoCall();
|
|
void ReturnDemoCall();
|
|
void PresentDemoCall();
|
|
int cutAppear_10F_01(int);
|
|
int _cutAppear_10F_01_Init(int const&);
|
|
int _cutAppear_10F_01_Main(int const&);
|
|
int cutAppear_10F_02(int);
|
|
int _cutAppear_10F_02_Init(int const&);
|
|
int _cutAppear_10F_02_Main(int const&);
|
|
int cutAppear_20F_01(int);
|
|
int _cutAppear_20F_01_Init(int const&);
|
|
int _cutAppear_20F_01_Main(int const&);
|
|
int cutAppear_20F_02(int);
|
|
int _cutAppear_20F_02_Init(int const&);
|
|
int _cutAppear_20F_02_Main(int const&);
|
|
int cutAppear_30F_01(int);
|
|
int _cutAppear_30F_01_Init(int const&);
|
|
int _cutAppear_30F_01_Main(int const&);
|
|
int cutAppear_30F_02(int);
|
|
int _cutAppear_30F_02_Init(int const&);
|
|
int _cutAppear_30F_02_Main(int const&);
|
|
int cutAppear_40F_01(int);
|
|
int _cutAppear_40F_01_Init(int const&);
|
|
int _cutAppear_40F_01_Main(int const&);
|
|
int cutAppear_40F_02(int);
|
|
int _cutAppear_40F_02_Init(int const&);
|
|
int _cutAppear_40F_02_Main(int const&);
|
|
int cutAppear_50F_01(int);
|
|
int _cutAppear_50F_01_Init(int const&, int const&);
|
|
int _cutAppear_50F_01_Main(int const&, int const&);
|
|
int cutAppear_50F_02(int);
|
|
int _cutAppear_50F_02_Init(int const&, int const&);
|
|
int _cutAppear_50F_02_Main(int const&, int const&);
|
|
int cutAppear_50F_03(int);
|
|
int _cutAppear_50F_03_Init(int const&, int const&);
|
|
int _cutAppear_50F_03_Main(int const&, int const&);
|
|
int cutAppear_50F_04(int);
|
|
int _cutAppear_50F_04_Init(int const&, int const&);
|
|
int _cutAppear_50F_04_Main(int const&, int const&);
|
|
int cutAppear_50F_05(int);
|
|
int _cutAppear_50F_05_Init(int const&, int const&);
|
|
int _cutAppear_50F_05_Main(int const&, int const&);
|
|
int cutSelect_Return1(int);
|
|
int _cutSelect_Return1_Init(int const&);
|
|
int _cutSelect_Return1_Main(int const&);
|
|
int cutSelect_Return2(int);
|
|
int _cutSelect_Return2_Init(int const&);
|
|
int _cutSelect_Return2_Main(int const&);
|
|
int cutSelect_Return3(int);
|
|
int _cutSelect_Return3_Init(int const&);
|
|
int _cutSelect_Return3_Main(int const&);
|
|
int cutReturnCancel(int);
|
|
int _cutReturnCancel_Init(int const&);
|
|
int _cutReturnCancel_Main(int const&);
|
|
daNpc_Fairy_c(daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
|
|
daNpcT_motionAnmData_c const* i_motionAnmData,
|
|
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
|
int i_faceMotionStepNum,
|
|
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
|
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
|
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
|
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
|
i_arcNames) {
|
|
OS_REPORT("|%06d:%x|daNpc_Fairy_c -> コンストラクト\n", g_Counter.mCounter0, this);
|
|
}
|
|
u16 getEyeballMaterialNo() { return 1; }
|
|
s32 getHeadJointNo() { return JNT_HEAD; }
|
|
s32 getNeckJointNo() { return JNT_NECK; }
|
|
s32 getBackboneJointNo() { return JNT_BACKBONE1; }
|
|
BOOL checkChangeJoint(int i_joint) { return i_joint == JNT_HEAD; }
|
|
BOOL checkRemoveJoint(int i_joint) { return i_joint == JNT_MOUTH; }
|
|
|
|
int getFlowNodeNo() {
|
|
u16 nodeNo = home.angle.x;
|
|
return nodeNo == 0xFFFF ? -1 : nodeNo;
|
|
}
|
|
|
|
u8 getType() {
|
|
u32 param = fopAcM_GetParam(this) & 0xFF;
|
|
if (param == 0xFF) {
|
|
param = 0;
|
|
}
|
|
|
|
return param;
|
|
}
|
|
|
|
BOOL chkAction(actionFunc action) { return mAction == action; }
|
|
|
|
int getSwitchBitNo() { return fopAcM_GetParam(this) >> 24; }
|
|
|
|
void sprit_se() { mSound.startCreatureSoundLevel(Z2SE_FAIRY_STAY, 0, -1); }
|
|
void feather_se() { mSound.startCreatureSoundLevel(Z2SE_FAIRY_HANE_STAY, 0, -1); }
|
|
void feather_appear_se() { mSound.startCreatureSound(Z2SE_FAIRY_HANE_OP, 0, -1); }
|
|
|
|
u8 getSceneNo1() { return (fopAcM_GetParam(this) >> 8) & 0xFF; }
|
|
u8 getSceneNo2() { return (fopAcM_GetParam(this) >> 16) & 0xFF; }
|
|
|
|
static char* mCutNameList[18];
|
|
static cutFunc mCutList[18];
|
|
private:
|
|
/* 0x0E40 */ NPC_FAIRY_HIO_CLASS* mHIO;
|
|
/* 0x0E44 */ dCcD_Cyl mCyl;
|
|
/* 0x0F80 */ u8 mType;
|
|
/* 0x0F84 */ actionFunc mAction;
|
|
/* 0x0F90 */ s16 mTimer;
|
|
/* 0x0F92 */ u8 field_0xf92[0xf94 - 0xf92];
|
|
/* 0x0F94 */ s16 mPrtclTimer;
|
|
/* 0x0F98 */ dPaPo_c mPaPo;
|
|
/* 0x0FD0 */ u32 mPrtcls[3];
|
|
/* 0x0FDC */ int mSwitchBit;
|
|
/* 0x0FE0 */ u8 field_0xfe0[0xfe4 - 0xfe0];
|
|
/* 0x0FE4 */ int mTempBit;
|
|
/* 0x0FE8 */ cXyz mCurrentPosCopy;
|
|
/* 0x0FF4 */ u16 field_0xff4;
|
|
/* 0x0FF6 */ u8 mStatus;
|
|
/* 0x0FF7 */ u8 mUnkFlag;
|
|
/* 0x0FF8 */ _Fairy_Feather_c mFairyFeather;
|
|
};
|
|
|
|
STATIC_ASSERT(sizeof(daNpc_Fairy_c) == 0x10c8);
|
|
|
|
#endif /* D_A_NPC_FAIRY_H */
|