Merge pull request #252 from robojumper/more_cursor_stuff

Cursor Cleanup
This commit is contained in:
robojumper
2025-09-27 12:21:38 +02:00
committed by GitHub
25 changed files with 1476 additions and 487 deletions
+7
View File
@@ -19,6 +19,13 @@ public:
BASE_PROP_0x40 = (1 << 6),
BASE_PROP_0x80 = (1 << 7),
BASE_PROP_0x100 = (1 << 8),
BASE_PROP_0x200 = (1 << 9),
BASE_PROP_0x400 = (1 << 10),
BASE_PROP_UNK_PARTICLE_1 = BASE_PROP_0x400 | BASE_PROP_0x200 | BASE_PROP_0x80 | BASE_PROP_0x40 |
BASE_PROP_0x20 | BASE_PROP_0x10 | BASE_PROP_0x8 | BASE_PROP_0x1,
BASE_PROP_UNK_PARTICLE_2 = BASE_PROP_0x400 | BASE_PROP_0x200 | BASE_PROP_0x80 | BASE_PROP_0x40 |
BASE_PROP_0x20 | BASE_PROP_0x10 | BASE_PROP_0x8 | BASE_PROP_0x2 | BASE_PROP_0x1,
};
// field from profile init
+215 -148
View File
@@ -6,75 +6,70 @@
#include "d/d_cursor_hit_check.h"
#include "d/lyt/d2d.h"
#include "m/m2d.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_pane.h"
#include "s/s_FStateID.hpp"
#include "s/s_State.hpp"
#include "s/s_StateID.hpp"
#include "toBeSorted/d_emitter.h"
#include "toBeSorted/d_emitter_callbacks.h"
struct dCsGame_HIO_c {
dCsGame_HIO_c();
virtual ~dCsGame_HIO_c() {}
/** A variant of the cursor position getter for dCsGame_c */
class dCursorInterfaceGame_c : public dCursorInterface_c {
public:
dCursorInterfaceGame_c() {}
virtual ~dCursorInterfaceGame_c() {}
virtual mVec2_c &getCursorPos();
/* 0x04 */ f32 field_0x04;
/* 0x08 */ f32 field_0x08;
/* 0x0C */ f32 field_0x0C;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ f32 field_0x14;
/* 0x18 */ f32 field_0x18;
/* 0x1C */ f32 field_0x1C;
/* 0x20 */ f32 field_0x20;
/* 0x24 */ f32 field_0x24;
/* 0x28 */ f32 field_0x28;
/* 0x2C */ f32 field_0x2C;
/* 0x30 */ s32 field_0x30;
/* 0x34 */ f32 field_0x34;
/* 0x38 */ f32 field_0x38;
/* 0x3C */ f32 field_0x3C;
/* 0x40 */ u8 field_0x40;
/* 0x41 */ u8 field_0x41;
/* 0x42 */ u8 field_0x42;
private:
/* 0x14 */ mVec2_c field_0x14;
};
class EffectRelatedTmp {
// TODO - these could also be in the dCsGame_c namespace
// TODO - rename these
class dCsGameLytBase1_c {
public:
EffectRelatedTmp();
virtual ~EffectRelatedTmp();
virtual ~dCsGameLytBase1_c() {}
/* 0x0C */ virtual void setPosition(const mVec2_c &pos) {
mPosition = pos;
}
void doSomething(EffectsStruct *s);
};
class EffectRelated : public EffectRelatedTmp {
public:
EffectRelated(u32 x = 0x28, f32 y = 3.5f);
virtual ~EffectRelated() {}
};
class dCsGameLytBase_c {
public:
dCsGameLytBase_c() {}
virtual ~dCsGameLytBase_c() {}
virtual void dCsGameLytBase_0x0C() {} // not overridden
virtual void dCsGameLytBase_0x10() {} // overridden by both
virtual void dCsGameLytBase_0x14() = 0;
virtual void dCsGameLytBase_0x18() {} // not overridden
virtual void dCsGameLytBase_0x1C() {} // not overridden
virtual void dCsGameLytBase_0x20() = 0;
virtual void dCsGameLytBase_0x24() = 0;
virtual void dCsGameLytBase_0x28() = 0;
/* 0x10 */ virtual bool init() = 0;
/* 0x14 */ virtual bool remove() = 0;
/* 0x18 */ virtual bool execute() = 0;
/* 0x1C */ virtual bool draw() = 0;
protected:
/* 0x04 */ u8 field_0x04[0x0C - 0x04];
/* 0x04 */ mVec2_c mPosition;
};
class dCsGameLyt1_c : public dCsGameLytBase_c {
class dCsGameLytBase2_c : public dCsGameLytBase1_c {
public:
virtual ~dCsGameLytBase2_c() {}
/* 0x10 */ virtual bool init();
/* 0x14 */ virtual bool remove() = 0;
/* 0x18 */ virtual bool execute();
/* 0x1C */ virtual bool draw();
/* 0x20 */ virtual void loadResAcc() = 0;
/* 0x24 */ virtual void build() = 0;
/* 0x28 */ virtual d2d::LytBase_c *getLyt() = 0;
protected:
};
class dCsGameLyt1_c : public dCsGameLytBase2_c {
public:
dCsGameLyt1_c() : mpResAcc(nullptr) {}
virtual ~dCsGameLyt1_c() {}
virtual void dCsGameLytBase_0x10() override;
virtual void dCsGameLytBase_0x14() override;
virtual void dCsGameLytBase_0x20() override;
virtual void dCsGameLytBase_0x24() override;
virtual void dCsGameLytBase_0x28() override;
virtual bool init() override;
virtual bool remove() override;
virtual void loadResAcc() override;
virtual void build() override;
virtual d2d::LytBase_c *getLyt() override {
return &mLyt;
}
void setResAcc(m2d::ResAccIf_c *resAcc) {
mpResAcc = resAcc;
@@ -85,15 +80,17 @@ private:
/* 0x10 */ d2d::LytBase_c mLyt;
};
class dCsGameLyt2_c : public dCsGameLytBase_c {
class dCsGameLyt2_c : public dCsGameLytBase2_c {
public:
dCsGameLyt2_c() : mpResAcc(nullptr) {}
virtual ~dCsGameLyt2_c() {}
virtual void dCsGameLytBase_0x10() override;
virtual void dCsGameLytBase_0x14() override;
virtual void dCsGameLytBase_0x20() override;
virtual void dCsGameLytBase_0x24() override;
virtual void dCsGameLytBase_0x28() override;
virtual bool init() override;
virtual bool remove() override;
virtual void loadResAcc() override;
virtual void build() override;
virtual d2d::LytBase_c *getLyt() override {
return &mLyt;
}
void setResAcc(m2d::ResAccIf_c *resAcc) {
mpResAcc = resAcc;
@@ -104,61 +101,62 @@ private:
/* 0x10 */ d2d::LytBase_c mLyt;
};
class Tmp {
public:
d2d::AnmGroup_c mAnmGroups[0x17];
};
class dCsGameAnmGroups_c {
public:
dCsGameAnmGroups_c() {}
virtual ~dCsGameAnmGroups_c() {}
Tmp tmp;
};
/// @brief Game cursor.
class dCsGame_c : public dCs_c {
public:
enum CursorType_e {
CS_NONE = 0,
/** Default pointer */
CS_POINTER_DEF = 1,
/** Grab pointer */
CS_POINTER_CAT = 2,
CS_BOW = 6,
CS_DOWSING = 7,
CS_VACUUM = 8,
CS_PACHINKO = 9,
CS_HOOKSHOT = 10,
CS_PLAYERCAM = 14,
};
dCsGame_c();
virtual ~dCsGame_c();
virtual int create() override;
virtual int doDelete() override;
virtual int execute() override;
virtual int draw() override;
static dCsGame_c *GetInstance() {
return sInstance;
}
void setSomething(int);
bool fn_801BF5E0() const;
bool fn_801BF630() const;
bool shouldDraw() const;
/// @brief Item cursor.
class lytItemCursor_c {
class lytItemCursor_c : public dCsGameLytBase2_c {
friend class dCsGame_c;
public:
enum CursorType_e {
BOW = 6,
};
/// @brief Bow cursor.
class lytBowCsr_c {
public:
lytBowCsr_c(dCsGameAnmGroups_c &g, d2d::LytBase_c *lyt)
: mAnm(g.tmp.mAnmGroups, 0x17), mpLyt(lyt), mStateMgr(*this, sStateID::null) {}
lytBowCsr_c(d2d::AnmGroups g, d2d::LytBase_c *lyt)
: mAnm(g), mpLyt(lyt), mStateMgr(*this, sStateID::null), field_0x50(0.0f), field_0x54(0.0f) {}
virtual ~lytBowCsr_c() {}
void init();
void enter();
inline void select() {
// TODO this function might be breaking vtable order
mStateMgr.changeState(StateID_Select);
}
void execute();
void startDrawOrCharge(f32 f1, f32 f2);
void aimStart();
void ready();
private:
STATE_FUNC_DECLARE(lytBowCsr_c, Invisible);
STATE_FUNC_DECLARE(lytBowCsr_c, Select);
@@ -173,14 +171,24 @@ public:
/* 0x4C */ d2d::LytBase_c *mpLyt;
/* 0x50 */ f32 field_0x50;
/* 0x54 */ f32 field_0x54;
/* 0x58 */ u8 field_0x58[0x68 - 0x58]; // idk
/* 0x58 */ nw4r::lyt::Pane *mpPanesArrowRing[4];
};
/// @brief Dowsing cursor.
class lytDowsingCsr_c {
public:
lytDowsingCsr_c(dCsGameAnmGroups_c &g, d2d::LytBase_c *lyt)
: mAnm(g.tmp.mAnmGroups, 0x17), mpLyt(lyt), mStateMgr(*this, sStateID::null) {}
lytDowsingCsr_c(d2d::AnmGroups g, d2d::LytBase_c *lyt)
: mAnm(g),
mpLyt(lyt),
mStateMgr(*this, sStateID::null),
mpRingAllPane(nullptr),
mpDowsingPane(nullptr),
field_0xC0(0.0f),
field_0xC4(0),
mRotZ(0),
field_0xCC(0.0f),
field_0xD0(0.0f),
mAlpha(0) {}
virtual ~lytDowsingCsr_c() {}
void init();
@@ -188,6 +196,13 @@ public:
void enter();
void execute();
void setParams(const mAng &rot, f32 v1, f32 v2);
void setUnkWord(UNKWORD v);
void moveEffectsIn();
void moveEffectsOut();
void updateEffects();
private:
STATE_FUNC_DECLARE(lytDowsingCsr_c, NotFind);
STATE_FUNC_DECLARE(lytDowsingCsr_c, ToFind);
@@ -200,29 +215,34 @@ public:
/* 0x4C */ d2d::LytBase_c *mpLyt;
/* 0x50 */ EffectsStruct mEffects1;
/* 0x84 */ EffectsStruct mEffects2;
/* 0xB8 */ f32 field_0xB8;
/* 0xBC */ f32 field_0xBC;
/* 0xB8 */ nw4r::lyt::Pane *mpRingAllPane;
/* 0xBC */ nw4r::lyt::Pane *mpDowsingPane;
/* 0xC0 */ f32 field_0xC0;
/* 0xC4 */ u8 field_0xC4[0xD8 - 0xC4];
/* 0xC4 */ UNKWORD field_0xC4;
/* 0xC8 */ mAng mRotZ;
/* 0xCC */ f32 field_0xCC;
/* 0xD0 */ f32 field_0xD0;
/* 0xD4 */ u32 mAlpha;
};
/// @brief Slingshot cursor.
class lytPachinkoCsr_c {
public:
lytPachinkoCsr_c(dCsGameAnmGroups_c &g, d2d::LytBase_c *lyt)
: mAnm(g.tmp.mAnmGroups, 0x17),
lytPachinkoCsr_c(d2d::AnmGroups g, d2d::LytBase_c *lyt)
: mAnm(g),
mpLyt(lyt),
mStateMgr(*this, sStateID::null),
field_0x50(0),
field_0x54(0.0f),
field_0x58(0.0f) {}
mIsCharging(false),
mDrawProgress(0.0f),
mSavedOnProgress(0.0f) {}
virtual ~lytPachinkoCsr_c() {}
void init();
// void enter();
void execute();
void setCharging(bool charging, f32 progress);
private:
STATE_FUNC_DECLARE(lytPachinkoCsr_c, Invisible);
STATE_FUNC_DECLARE(lytPachinkoCsr_c, Select);
@@ -235,16 +255,16 @@ public:
/* 0x04 */ UI_STATE_MGR_DECLARE(lytPachinkoCsr_c);
/* 0x40 */ d2d::AnmGroups mAnm;
/* 0x4C */ d2d::LytBase_c *mpLyt;
/* 0x50 */ u8 field_0x50;
/* 0x54 */ f32 field_0x54;
/* 0x58 */ f32 field_0x58;
/* 0x50 */ bool mIsCharging;
/* 0x54 */ f32 mDrawProgress;
/* 0x58 */ f32 mSavedOnProgress;
};
/// @brief Clawshots cursor.
class lytCrawShotCsr_c {
public:
lytCrawShotCsr_c(dCsGameAnmGroups_c &g, d2d::LytBase_c *lyt)
: mAnm(g.tmp.mAnmGroups, 0x17), mpLyt(lyt), mStateMgr(*this, sStateID::null) {}
lytCrawShotCsr_c(d2d::AnmGroups g, d2d::LytBase_c *lyt)
: mAnm(g), mpLyt(lyt), mStateMgr(*this, sStateID::null), mLocked(false) {}
virtual ~lytCrawShotCsr_c() {}
void init();
@@ -252,6 +272,9 @@ public:
void enter();
void execute();
void setLocked(bool locked);
void setRotate(f32 rot);
private:
STATE_FUNC_DECLARE(lytCrawShotCsr_c, Normal);
STATE_FUNC_DECLARE(lytCrawShotCsr_c, ToLock);
@@ -261,14 +284,18 @@ public:
/* 0x04 */ UI_STATE_MGR_DECLARE(lytCrawShotCsr_c);
/* 0x40 */ d2d::AnmGroups mAnm;
/* 0x4C */ d2d::LytBase_c *mpLyt;
/* 0x50 */ u8 field_0x50[0x6C - 0x50];
/* 0x50 */ u8 field_0x50[0x54 - 0x50];
/* 0x54 */ bool mLocked;
/* 0x58 */ nw4r::lyt::Pane *mpPaneCrawFix;
/* 0x5C */ nw4r::lyt::Pane *mpPaneCraws[3];
/* 0x68 */ f32 field_0x68;
};
/// @brief Gust Bellows cursor.
class lytVacuumCsr_c {
public:
lytVacuumCsr_c(dCsGameAnmGroups_c &g, d2d::LytBase_c *lyt)
: mAnm(g.tmp.mAnmGroups, 0x17), mpLyt(lyt), mStateMgr(*this, sStateID::null) {}
lytVacuumCsr_c(d2d::AnmGroups g, d2d::LytBase_c *lyt)
: mAnm(g), mpLyt(lyt), mStateMgr(*this, sStateID::null), mLocked(false) {}
virtual ~lytVacuumCsr_c() {}
void init();
@@ -276,6 +303,9 @@ public:
void enter();
void execute();
void setUnkFloat(f32 f);
void setLocked(bool locked);
private:
STATE_FUNC_DECLARE(lytVacuumCsr_c, Normal);
STATE_FUNC_DECLARE(lytVacuumCsr_c, ToLock);
@@ -285,49 +315,47 @@ public:
/* 0x04 */ UI_STATE_MGR_DECLARE(lytVacuumCsr_c);
/* 0x40 */ d2d::AnmGroups mAnm;
/* 0x4C */ d2d::LytBase_c *mpLyt;
/* 0x50 */ u8 field_0x50[0x5C - 0x50];
/* 0x5C */ u8 field_0x5C;
/* 0x50 */ u8 field_0x50[0x54 - 0x50];
/* 0x54 */ f32 field_0x54;
/* 0x58 */ u8 field_0x58[0x5C - 0x58];
/* 0x5C */ bool mLocked;
};
public:
lytItemCursor_c()
: mStateMgr(*this, sStateID::null),
mAnm(mAnmGroups.tmp.mAnmGroups, 0x17),
mBow(mAnmGroups, &mLyt),
mDowsing(mAnmGroups, &mLyt),
mPachinko(mAnmGroups, &mLyt),
mCrawShot(mAnmGroups, &mLyt),
mVacuum(mAnmGroups, &mLyt) {}
mBow(mAnm, &mLyt),
mDowsing(mAnm, &mLyt),
mPachinko(mAnm, &mLyt),
mCrawShot(mAnm, &mLyt),
mVacuum(mAnm, &mLyt) {}
virtual ~lytItemCursor_c() {}
virtual void lytItemCursor0x0C();
virtual bool init();
virtual bool remove();
bool preInit();
bool doInit();
virtual bool init() override;
virtual bool remove() override;
virtual bool execute() override;
virtual void loadResAcc() override;
virtual void build() override;
virtual d2d::LytBase_c *getLyt() override {
return &mLyt;
}
void setResAcc(m2d::ResAccIf_c *resAcc) {
mpResAcc = resAcc;
}
bool isCursorActive() const {
return mCursorActive;
}
void setField0x9A0(u8 val) {
mCursorActive = val;
}
// TODO - maybe a system for overriding cursor type
void setNextCursorType(CursorType_e cs) {
mNextCursor = true;
mNextCursorType = cs;
}
void offNextCursor() {
mNextCursor = false;
}
void changeState(const sFStateID_c<lytItemCursor_c> &newState);
void pachinkoSetCharging(bool charging, f32 progress);
void dowsingSetParams(const mAng &rot, f32 v1, f32 v2);
void dowsingSetUnkWord(UNKWORD v);
void vacuumSetUnkFloat(f32 v);
void vacuumSetLocked(bool locked);
void clawshotsSetLocked(bool locked);
void bowStartDrawOrCharge(f32 f1, f32 f2);
void bowAimStart();
void bowReady();
private:
STATE_FUNC_DECLARE(lytItemCursor_c, Invisible);
STATE_FUNC_DECLARE(lytItemCursor_c, Bow);
@@ -337,13 +365,30 @@ public:
STATE_FUNC_DECLARE(lytItemCursor_c, HookShot);
STATE_FUNC_DECLARE(lytItemCursor_c, PlayerCam);
/* 0x004 */ f32 field_0x004;
/* 0x008 */ f32 field_0x008;
/* 0x00C */ UI_STATE_MGR_DECLARE(lytItemCursor_c);
template <int N>
class Tmp {
public:
d2d::AnmGroup_c mAnmGroups[N];
};
class dCsGameAnmGroups_c {
public:
dCsGameAnmGroups_c() {}
virtual ~dCsGameAnmGroups_c() {}
d2d::AnmGroup_c &operator[](int idx) {
return tmp.mAnmGroups[idx];
}
Tmp<0x17> tmp;
};
/* 0x048 */ EffectsStruct mEffects;
/* 0x07C */ EffectRelated mEffectRelated;
/* 0x080 */ u8 field_0x80[0xC8 - 0x80];
/* 0x07C */ dEmitterCallbackCursorTrail_c mTrailCb;
/* 0x0B0 */ mVec3_c mPositionThisFrame;
/* 0x0BC */ mVec3_c mPositionLastFrame;
/* 0x0C8 */ m2d::ResAccIf_c *mpResAcc;
/* 0x0CC */ d2d::LytBase_c mLyt;
/* 0x15C */ dCsGameAnmGroups_c mAnmGroups;
@@ -354,33 +399,55 @@ public:
/* 0x8C8 */ lytCrawShotCsr_c mCrawShot;
/* 0x934 */ lytVacuumCsr_c mVacuum;
/* 0x994 */ u8 field_0x994[0x99C - 0x994]; // seemingly not used
/* 0x99C */ bool mCursorTrail;
/* 0x99C */ bool mDrawCursorTrailThisFrame;
/* 0x99D */ u8 field_0x99D[0x9A0 - 0x99D]; // Havent seen this range be set
/* 0x9A0 */ bool mCursorActive;
/* 0x9A1 */ bool field_0x9A1; // Compares to mCursorActive to change state
/* 0x9A2 */ bool field_0x9A2; // A way of signalling Lyt non-normal state.
/* 0x9A4 */ CursorType_e mActiveCursorType;
/* 0x9A8 */ bool mNextCursor;
/* 0x9AC */ CursorType_e mNextCursorType;
};
void setNextCursorType(lytItemCursor_c::CursorType_e);
void setCursorTypeNoneMaybe();
void setCursorTypePointer();
void setNextCursorType(CursorType_e);
void noneSet();
void pointerDefSet();
void pointerCatSet();
void offNextCursor() {
mCursor.offNextCursor();
void pachinkoSetCharging(bool charging, f32 progress);
void dowsingSetParams(const mAng &rot, f32 v1, f32 v2);
void dowsingSetUnkWord(UNKWORD v);
void vacuumSetNotLocked(f32 v);
void vacuumSetLocked();
void clawshotsSetLocked(bool locked);
void bowStartDrawOrCharge(f32 f1, f32 f2);
void bowAimStart();
void bowReady();
void setCursorTypePlayerCam();
bool isCursorActive() const {
return mCursorActive;
}
void setField0x9A0(u8 val) {
mCursorActive = val;
}
void offNextCursor() {
mNextCursorActive = false;
}
private:
static dCsGame_c *sInstance;
bool isForcedHidden() const;
/* 0x068 */ m2d::ResAccIf_c mCursorResAcc;
/* 0x11C */ m2d::ResAccIf_c mMain2DResAcc;
/* 0x1D0 */ dCursorInterfaceGame_c mCursorIf;
/* 0x1EC */ s32 mCursorType;
/* 0x1EC */ CursorType_e mCursorType;
/* 0x1F0 */ dCsGameLyt1_c mLyt1;
/* 0x290 */ dCsGameLyt2_c mLyt2;
/* 0x330 */ lytItemCursor_c mCursor;
/* 0xCD0 */ bool mCursorActive;
/* 0xCD1 */ bool field_0x9A1; // Compares to mCursorActive to change state
/* 0xCD2 */ bool field_0x9A2; // A way of signalling Lyt non-normal state.
/* 0xCD4 */ CursorType_e mActiveCursorType;
/* 0xCD8 */ bool mNextCursorActive;
/* 0xCDC */ CursorType_e mNextCursorType;
};
#endif
-11
View File
@@ -130,17 +130,6 @@ private:
/* 0x10 */ dCursorHitCheck_c *mpHit;
};
/** A variant of the cursor position getter for dCsGame_c */
class dCursorInterfaceGame_c : public dCursorInterface_c {
public:
dCursorInterfaceGame_c() {}
virtual ~dCursorInterfaceGame_c() {}
virtual mVec2_c &getCursorPos();
private:
/* 0x14 */ u8 _0x14[8];
};
/**
* The cursor manager. Cursors and hit targets are registered here,
* and this manager will track the target of each pointer.
+4 -10
View File
@@ -227,6 +227,10 @@ struct AnmGroupBase_c {
return mpFrameCtrl->getAnimDuration();
}
inline f32 getLastFrame() const {
return mpFrameCtrl->getAnimDuration() - 1.0f;
}
inline f32 getFrame() const {
return mpFrameCtrl->getFrame();
}
@@ -292,20 +296,10 @@ struct AnmGroupBase_c {
syncAnmFrame();
}
inline void setRatio(f32 ratio) {
mpFrameCtrl->setRatio(ratio);
syncAnmFrame();
}
inline f32 getRatio() const {
return mpFrameCtrl->getRatio();
}
inline void setBackwardsRatio(f32 ratio) {
mpFrameCtrl->setBackwardsRatio(ratio);
syncAnmFrame();
}
inline f32 getNextFrame() const {
return mpFrameCtrl->getNextFrame();
}
+14
View File
@@ -0,0 +1,14 @@
#ifndef D_LYT_DEPOSIT_H
#define D_LYT_DEPOSIT_H
class dLytDeposit_c {
public:
static dLytDeposit_c *GetInstance() {
return sInstance;
}
private:
static dLytDeposit_c *sInstance;
};
#endif
+8 -10
View File
@@ -268,6 +268,7 @@ private:
class dLytMapMain_c : public m2d::Base_c {
friend class dLytMap_c;
public:
dLytMapMain_c();
virtual ~dLytMapMain_c();
@@ -342,7 +343,7 @@ private:
/* 0x8904 */ mVec3_c field_0x8904;
/* 0x8910 */ mVec3_c field_0x8910;
/* 0x891C */ mVec3_c field_0x891C;
/* 0x8928 */ u8 _0x8928[0x8930 - 0x8928];
/* 0x8930 */ mVec3_c field_0x8930;
@@ -350,7 +351,7 @@ private:
/* 0x8948 */ u8 idkfixmelater[0x4BC0];
/* 0x8C94 */ s32 field_0x8C94;
// ...
/* 0x8CC4 */ mVec3_c field_0x8CC4;
@@ -411,16 +412,13 @@ public:
void build();
static bool isValid(s32 val) {
if (val >= 2 && val < 7) {
return true;
}
return false;
bool isSomeMapFieldEq2Or4Or5Or6() const {
return mMapMain.field_0x8C94 == 2 || mMapMain.field_0x8C94 == 4 || mMapMain.field_0x8C94 == 5 ||
mMapMain.field_0x8C94 == 6;
}
bool unkMeterCheck() const {
s32 val = mMapMain.field_0x8C94;
return isValid(val) && ((1 << (val - 2)) & 0x1D);
bool isSomeMapFieldEq10() const {
return mMapMain.field_0x8C94 == 10;
}
void lightPillarRelated(s32 p1, s32 p2, s32 p3) {
+14
View File
@@ -0,0 +1,14 @@
#ifndef D_LYT_SHOP_H
#define D_LYT_SHOP_H
class dLytShop_c {
public:
static dLytShop_c *GetInstance() {
return sInstance;
}
private:
static dLytShop_c *sInstance;
};
#endif
-10
View File
@@ -97,21 +97,11 @@ public:
mFlags = mFlags | FLAG_BACKWARDS;
}
inline void setRatio(f32 ratio) {
f32 actualEnd = mEndFrame - 1.0f;
setFrame(actualEnd * ratio);
}
inline f32 getRatio() const {
f32 actualEnd = mEndFrame - 1.0f;
return mCurrFrame / actualEnd;
}
inline void setBackwardsRatio(f32 ratio) {
f32 actualEnd = mEndFrame - 1.0f;
setFrame(actualEnd - (ratio * actualEnd));
}
inline f32 getNextFrame() const {
f32 end = mEndFrame;
f32 f = mCurrFrame + 1.0f;
+4
View File
@@ -71,6 +71,10 @@ public:
mTranslate = value;
}
const math::VEC3 &GetRotate() const {
return mRotate;
}
void SetRotate(const nw4r::math::VEC3 &value) {
mRotate = value;
}
+3 -3
View File
@@ -43,15 +43,15 @@ public:
return mpEmitterCallback;
}
void setEmitterCallback(dEmitterCallback_c *cb);
void setParticleCallback(dParticleCallback_c *cb);
protected:
void deactivateEmitters();
void stopCalcEmitters();
void playCalcEmitters();
static void loadColors(JPABaseEmitter *emitter, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2);
void setEmitterCallback(dEmitterCallback_c *cb);
void setParticleCallback(dParticleCallback_c *cb);
void setImmortal();
static JPABaseEmitter *GetNextEmitter(JPABaseEmitter *head);
+28
View File
@@ -0,0 +1,28 @@
#ifndef D_EMITTER_CALLBACKS_H
#define D_EMITTER_CALLBACKS_H
#include "m/m_vec.h"
#include "toBeSorted/d_emitter.h"
/**
* A callback responsible for emitting the trail left by the red item cursor dot.
* Used by Bow, Gust Bellows, Clawshots, Slingshot.
*/
class dEmitterCallbackCursorTrail_c : public dEmitterCallback_c {
public:
dEmitterCallbackCursorTrail_c(u32 x = 0x28, f32 y = 3.5f);
virtual ~dEmitterCallbackCursorTrail_c() {}
virtual void executeAfter(JPABaseEmitter *) override;
virtual void create(JPABaseEmitter *) override;
virtual void vt_0x20(f32, f32) override;
private:
/* 0x10 */ f32 field_0x10;
/* 0x14 */ u16 field_0x14;
/* 0x16 */ u8 _0x16[0x1C - 0x16];
/* 0x1C */ mVec3_c posNMinus1;
/* 0x28 */ mVec3_c posNMinus2;
};
#endif
+1 -3
View File
@@ -1,14 +1,13 @@
#ifndef EVENT_MANAGER_H
#define EVENT_MANAGER_H
#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "f/f_base.h"
#include "sized_string.h"
#include "toBeSorted/event.h"
class dAcBase_c;
class dAcObjBase_c;
class EventManager {
public:
@@ -53,7 +52,6 @@ public:
static bool FUN_800a0ba0();
private:
/* 0x000 */ u8 _000[0x084 - 0x000];
/* 0x084 */ Event mCurrentEvent;
/* 0x0C4 */ u8 _0C4[0x184 - 0x0C4];
+46
View File
@@ -0,0 +1,46 @@
#ifndef EVENT_MANAGER_UTIL_H
#define EVENT_MANAGER_UTIL_H
#include "d/d_base.h"
#include "d/d_message.h"
#include "d/lyt/d_lyt_deposit.h"
#include "d/lyt/d_lyt_map.h"
#include "d/lyt/d_lyt_shop.h"
#include "toBeSorted/event_manager.h"
#include "toBeSorted/misc_actor.h"
// Pulling these functions out into a separate file to avoid circular dependencies
inline bool EventManagerNotDrawControl0x80() {
return EventManager::isInEvent() && (dBase_c::s_DrawControlFlags & 0x80) == 0;
}
inline bool EventManagerNotSkyKeepPuzzle() {
return EventManager::isInEvent() && !checkIsInSkykeepPuzzle();
}
inline bool EventManagerNotInShop() {
return EventManager::isInEvent() && dLytShop_c::GetInstance() == nullptr;
}
inline bool EventManagerNotInDeposit() {
return EventManager::isInEvent() && dLytDeposit_c::GetInstance() == nullptr;
}
inline bool EventManagerIsInMap() {
return EventManager::isInEvent() && dLytMap_c::GetInstance() != nullptr;
}
inline bool EventManagerIsMapOpen() {
return EventManagerIsInMap() && dLytMap_c::GetInstance()->isOpenMaybe();
}
inline bool EventManagerIsMapOpenAndMessage() {
return EventManagerIsMapOpen() && !dMessage_c::getInstance()->getField_0x328();
}
inline bool EventManagerIsMapOpenAnd0x9008Eq10() {
return EventManagerIsMapOpen() && dLytMap_c::GetInstance()->isSomeMapFieldEq10();
}
#endif