diff options
| author | robojumper <robojumper@gmail.com> | 2025-12-28 23:34:04 +0100 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2026-01-28 19:13:39 +0100 |
| commit | 12c5c2862dc9c50a6a37ec964ea4c4196e6545a1 (patch) | |
| tree | 95a56ac8d95d4c1f9c68a6ceb156c4250435159e /include/toBeSorted | |
| parent | cffba79e3f0600d54dea3bdbb0506e2fc1c54199 (diff) | |
d_a_b_lastboss WIP
Diffstat (limited to 'include/toBeSorted')
| -rw-r--r-- | include/toBeSorted/d_enemy_sword_mdl.h | 59 | ||||
| -rw-r--r-- | include/toBeSorted/d_sword_swing_effect.h | 65 | ||||
| -rw-r--r-- | include/toBeSorted/d_sword_swing_effect_mgr.h | 43 |
3 files changed, 167 insertions, 0 deletions
diff --git a/include/toBeSorted/d_enemy_sword_mdl.h b/include/toBeSorted/d_enemy_sword_mdl.h new file mode 100644 index 00000000..33527979 --- /dev/null +++ b/include/toBeSorted/d_enemy_sword_mdl.h @@ -0,0 +1,59 @@ +#ifndef D_ENEMY_SWORD_MDL_H +#define D_ENEMY_SWORD_MDL_H + +#include "common.h" +#include "d/a/obj/d_a_obj_base.h" +#include "d/d_cc.h" +#include "d/d_shadow.h" +#include "egg/gfx/eggTexture.h" +#include "m/m3d/m_smdl.h" +#include "m/m_allocator.h" +#include "m/m_mtx.h" +#include "m/m_quat.h" +#include "m/m_vec.h" +#include "nw4r/types_nw4r.h" +#include "toBeSorted/d_sword_swing_effect_mgr.h" + +class dEnemySwordMdl_c { +public: + /* 0x000 */ m3d::smdl_c mMdl; + /* 0x01C */ dSwordSwingEffectProcMgr_c mProc; + +private: + /* 0x070 */ bool field_0x070; + /* 0x071 */ bool field_0x071; + /* 0x074 */ mVec3_c field_0x074; + /* 0x080 */ mVec3_c field_0x080; + /* 0x08C */ mVec3_c field_0x08C; + /* 0x098 */ mVec3_c field_0x098; + /* 0x0A4 */ f32 field_0x0A4; + /* 0x0A8 */ f32 field_0x0A8; + /* 0x0AC */ dCcD_Linked_Cps mCcs[3]; + /* 0x52C */ dColliderLinkedList mCcList; + +public: + dEnemySwordMdl_c() {} + virtual ~dEnemySwordMdl_c() {} + + bool create( + mAllocator_c *alloc, void *pData, const char *mdlName, u32 bufferOption, const mVec3_c &v1, const mVec3_c &v2, + cCcD_Stts &stts, EGG::ResTIMG *pImg, int nView, u32 *pSize + ); + bool create( + mAllocator_c *alloc, nw4r::g3d::ResFile resFile, const char *mdlName, u32 bufferOption, const mVec3_c &v1, + const mVec3_c &v2, cCcD_Stts &stts, EGG::ResTIMG *pImg, int nView, u32 *pSize + ); + + void calc(const mMtx_c &mtx, const mVec3_c &v1, bool mass); + bool entry(dAcObjBase_c *obj, dShadowCircle_c *shadow, mQuat_c *quat); + + void fn_8006B640(); + void fn_8006B660(UNKWORD, UNKWORD, UNKWORD, UNKWORD, UNKWORD, UNKWORD, UNKWORD, UNKWORD, UNKWORD, f32); + + void setAttackActive(bool b) { + field_0x070 = b; + mProc.setActive(false); + } +}; + +#endif diff --git a/include/toBeSorted/d_sword_swing_effect.h b/include/toBeSorted/d_sword_swing_effect.h new file mode 100644 index 00000000..1a97f0cd --- /dev/null +++ b/include/toBeSorted/d_sword_swing_effect.h @@ -0,0 +1,65 @@ +#ifndef D_SWORD_SWING_EFFECT_H +#define D_SWORD_SWING_EFFECT_H + +#include "common.h" +#include "egg/gfx/eggTexture.h" +#include "m/m3d/m_proc.h" +#include "m/m_allocator.h" +#include "m/m_color.h" +#include "m/m_vec.h" + +class dSwordSwingEffectProcBase_c : public m3d::proc_c { +protected: + struct swing_entry { + swing_entry() { + mLifetime = 0.0f; + } + ~swing_entry() {} + + void set(const mVec3_c &pos1, const mColor &c1, const mVec3_c &pos2, const mColor &c2); + + /* 0x00 */ f32 mLifetime; + /* 0x04 */ mVec3_c mv1; + /* 0x10 */ mVec3_c mv2; + /* 0x1C */ mColor mc1; + /* 0x20 */ mColor mc2; + }; + +public: + dSwordSwingEffectProcBase_c() : mpEntries(nullptr), mCount(0), mHead(0) {} + virtual ~dSwordSwingEffectProcBase_c() { + remove(); + } + + virtual int entry() override; + virtual void remove() override; + virtual void drawXlu() override; + + bool create(s32 num, mAllocator_c *alloc); + void addSwing(const mVec3_c &pos1, const mColor c1, const mVec3_c &pos2, const mColor c2); + void calc(f32 f); + +protected: + bool hasSwings() const; + + /* 0x18 */ swing_entry *mpEntries; + /* 0x1C */ u16 mNum; + /* 0x1E */ u16 mCount; + /* 0x20 */ u16 mHead; +}; + +class dSwordSwingEffectProc_c : public dSwordSwingEffectProcBase_c { +public: + dSwordSwingEffectProc_c() : mpImg(nullptr) {} + virtual ~dSwordSwingEffectProc_c() {} + + virtual void drawXlu() override; + + bool create(s32 num, mAllocator_c *alloc, EGG::ResTIMG *pImg, f32 scale); + +private: + /* 0x24 */ EGG::ResTIMG *mpImg; + /* 0x28 */ f32 mTexScale; +}; + +#endif diff --git a/include/toBeSorted/d_sword_swing_effect_mgr.h b/include/toBeSorted/d_sword_swing_effect_mgr.h new file mode 100644 index 00000000..e14600ad --- /dev/null +++ b/include/toBeSorted/d_sword_swing_effect_mgr.h @@ -0,0 +1,43 @@ +#ifndef D_SWORD_SWING_EFFECT_MGR_H +#define D_SWORD_SWING_EFFECT_MGR_H + +#include "m/m_color.h" +#include "m/m_vec.h" +#include "toBeSorted/d_sword_swing_effect.h" + +// TODO better name +class dSwordSwingEffectProcMgr_c { +private: + /* 0x00 */ dSwordSwingEffectProc_c mProc; + /* 0x2C */ bool mIsActive; + /* 0x30 */ mColor mC1; + /* 0x34 */ mColor mC2; + /* 0x38 */ mVec3_c field_0x38; + /* 0x44 */ mVec3_c field_0x44; + + void createSwingEntries(const mVec3_c &v1, const mVec3_c &v2); + +public: + dSwordSwingEffectProcMgr_c() : mC1(0xFF, 0xFF, 0xFF, 0x40), mC2(0xFF, 0xFF, 0xFF, 0x20) {} + virtual ~dSwordSwingEffectProcMgr_c() {} + + void setColor1(mColor c1) { + mC1 = c1; + } + + void setColor2(mColor c1) { + mC2 = c1; + } + + void setActive(bool v) { + mIsActive = v; + } + + bool create(s32 num, mAllocator_c *alloc, EGG::ResTIMG *pImg, f32 scale) { + return mProc.create(num, alloc, pImg, scale); + } + void calc(const mVec3_c &v1, const mVec3_c &v2); + void entry(); +}; + +#endif |
