Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added more dMeterDraw2 functions and LockonTarget function from decomp and other things #35

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions include/tp/d_attention.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#ifndef D_D_ATTENTION_H
#define D_D_ATTENTION_H
#include <cstdint>
#include <tp/f_op_actor.h>
#include <tp/m_do_ext.h>
// #include <SSystem/SComponent/c_angle.h>

namespace libtp::tp::d_attention{
// struct dist_entry {
// float field_0x0;
// float field_0x4;
// float field_0x8;
// float field_0xc;
// float field_0x10;
// float field_0x14;
// uint32_t field_0x18;
// }; // Size: 0x1C

// struct type_tbl_entry {
// int16_t field_0x0;
// uint16_t field_0x2;
// };

// class dAttention_c {
// public:
// enum EState {
// ST_NONE,
// ST_LOCK,
// ST_RELEASE,
// };

// /* 80070198 */ dAttention_c(libtp::tp::f_op_actor::fopAc_ac_c*, uint32_t);
// /* 80070A70 */ int chkAttMask(uint32_t, uint32_t);
// /* 80070E90 */ float calcWeight(int, libtp::tp::f_op_actor::fopAc_ac_c*, float, int16_t, int16_t, uint32_t*);
// /* 800710C0 */ void setList(int, libtp::tp::f_op_actor::fopAc_ac_c*, float, float, cSAngle, uint32_t);
// /* 80071240 */ void initList(uint32_t);
// /* 800713CC */ int makeList();
// /* 80071424 */ void setOwnerAttentionPos();
// /* 80071488 */ int SelectAttention(libtp::tp::f_op_actor::fopAc_ac_c*);
// /* 800716B8 */ void sortList();
// /* 800718A4 */ void stockAttention();
// /* 80071960 */ libtp::tp::f_op_actor::fopAc_ac_c* nextAttention();
// /* 80071A68 */ int freeAttention();
// /* 80071A98 */ bool chaseAttention();
// /* 80071CC0 */ float EnemyDistance(libtp::tp::f_op_actor::fopAc_ac_c*);
// /* 80071DEC */ void runSoundProc();
// /* 80071E84 */ void runDrawProc();
// /* 800720F4 */ void runDebugDisp();
// /* 800720F8 */ void checkButton();
// /* 800722A0 */ bool triggerProc();
// /* 800722EC */ int lostCheck();
// /* 80072344 */ void judgementStatus4Hold();
// /* 800725F0 */ void judgementStatus4Switch();
// /* 80072924 */ int Run();
// /* 80072BD4 */ void Draw();
// /* 80072D80 */ void lockSoundStart(uint32_t);
// /* 8007353C */ libtp::tp::f_op_actor::fopAc_ac_c* LockonTarget(int32_t);
// /* 800736CC */ uint32_t LockonTargetPId(int32_t);
// /* 80073734 */ libtp::tp::f_op_actor::fopAc_ac_c* ActionTarget(int32_t);
// /* 8007378C */ libtp::tp::f_op_actor::fopAc_ac_c* CheckObjectTarget(int32_t);
// /* 800737E4 */ bool LockonTruth();
// /* 80073838 */ int checkDistance(cXyz*, int16_t, cXyz*, float, float, float, float);
// /* 8016E424 */ void LockEdge();
// /* 80182994 */ void GetCheckObjectCount();
// /* 80182AD0 */ void keepLock(int);
// /* 8014B010 */ static dist_entry& getDistTable(int);
// };
extern "C"{
/**
* @brief gets the actor that is targeted
* @param dAttentionPointer a pointer to the dAttention instance
* @param attentionIndex the index of the targeted actor
* @return the actor pointer that is targeted
*/
libtp::tp::f_op_actor::fopAc_ac_c* LockonTarget(void* dAttentionPointer, int32_t attentionIndex);
}}
#endif
103 changes: 67 additions & 36 deletions include/tp/d_meter2_draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,17 @@ namespace libtp::tp::d_meter2_draw
/* 0x578 */ float field_0x578;
/* 0x57C */ float field_0x57c;
/* 0x580 */ float field_0x580;
/* 0x584 */ uint8_t field_0x584[0x78];
/* 0x5FC */ float field_0x5fc[3];
/* 0x584 */ float field_0x584[3];
/* 0x590 */ float field_0x590[3];
/* 0x59C */ float field_0x59c[3];
/* 0x5A8 */ float field_0x5a8[3];
/* 0x5B4 */ float field_0x5b4[3];
/* 0x5C0 */ float field_0x5c0[3];
/* 0x5CC */ float field_0x5cc[3];
/* 0x5D8 */ float field_0x5d8[3];
/* 0x5E4 */ float field_0x5e4[3];
/* 0x5F0 */ float field_0x5f0[3];
/* 0x5FC */ float mMeterAlphaRate[3];
/* 0x608 */ float field_0x608;
/* 0x60C */ float field_0x60c;
/* 0x610 */ float field_0x610[3];
Expand Down Expand Up @@ -197,44 +206,43 @@ namespace libtp::tp::d_meter2_draw
/* 0x784 */ float field_0x784;
/* 0x788 */ float field_0x788;
/* 0x78C */ float field_0x78c;
/* 0x790 */ float field_0x790;
/* 0x794 */ float field_0x794;
/* 0x798 */ float field_0x798;
/* 0x79C */ float field_0x79c;
/* 0x7A0 */ float field_0x7a0;
/* 0x790 */ float mLifeParentAlpha;
/* 0x794 */ float mLifeParentHeartAlpha;
/* 0x798 */ float mHeartBaseAlpha;
/* 0x79C */ float mHeartAlpha;
/* 0x7A0 */ float mBigHeartAlpha;
/* 0x7A4 */ float field_0x7a4;
/* 0x7A8 */ float field_0x7a8;
/* 0x7AC */ float field_0x7ac;
/* 0x7A8 */ float mMagicMeterAlpha;
/* 0x7AC */ float mMagicMeterFrameAlpha;
/* 0x7B0 */ float field_0x7b0;
/* 0x7B4 */ float field_0x7b4;
/* 0x7B8 */ float field_0x7b8;
/* 0x7B4 */ float mLanternMeterAlpha;
/* 0x7B8 */ float mLanternMeterFrameAlpha;
/* 0x7BC */ float field_0x7bc;
/* 0x7C0 */ float field_0x7c0;
/* 0x7C4 */ float field_0x7c4;
/* 0x7C0 */ float mOxygenMeterAlpha;
/* 0x7C4 */ float mOxygenMeterFrameAlpha;
/* 0x7C8 */ float field_0x7c8;
/* 0x7CC */ float field_0x7cc;
/* 0x7D0 */ float field_0x7d0;
/* 0x7D4 */ float field_0x7d4;
/* 0x7D8 */ float field_0x7d8;
/* 0x7DC */ float field_0x7dc;
/* 0x7D4 */ float mRupeeAlpha;
/* 0x7D8 */ float mRupeeFrameAlpha;
/* 0x7DC */ float mRupeeCountAlpha;
/* 0x7E0 */ float field_0x7e0;
/* 0x7E4 */ float field_0x7e4;
/* 0x7E8 */ float field_0x7e8;
/* 0x7EC */ float field_0x7ec;
/* 0x7E8 */ float mKeyAlpha;
/* 0x7EC */ float mKeyNumAlpha;
/* 0x7F0 */ float field_0x7f0;
/* 0x7F4 */ float field_0x7f4;
/* 0x7F8 */ float field_0x7f8;
/* 0x7FC */ float field_0x7fc;
/* 0x800 */ float field_0x800;
/* 0x804 */ float field_0x804;
/* 0x808 */ float field_0x808;
/* 0x7F4 */ float mMainHUDButtonsAlpha;
/* 0x7F8 */ float mButtonDisplayBackAlpha;
/* 0x7FC */ float mButtonAAlpha;
/* 0x800 */ float mButtonBAlpha;
/* 0x804 */ float mButtonXAlpha;
/* 0x808 */ float mButtonYAlpha;
/* 0x80C */ float field_0x80c;
/* 0x810 */ float field_0x810;
/* 0x814 */ float field_0x814[2];
/* 0x81C */ float field_0x81c[2];
/* 0x824 */ float field_0x824[2];
/* 0x814 */ float mItemBBaseAlpha[2];
/* 0x81C */ float mButtonXItemBaseAlpha[2];
/* 0x824 */ float mButtonYItemBaseAlpha[2];
/* 0x82C */ float field_0x82c[2];
/* 0x834 */ float field_0x834;
/* 0x838 */ float field_0x838;
/* 0x83C */ float field_0x83c;
/* 0x840 */ float field_0x840;
Expand Down Expand Up @@ -277,31 +285,54 @@ namespace libtp::tp::d_meter2_draw

/**
* @brief Makes the heart UI disappear.
*
*
* @param dMeterDrawPtr A pointer to the current dMeter2Draw structure
*/
*/
void setAlphaLifeAnimeMin(dMeter2Draw_c* dMeterDrawPtr);

/**
* @brief Makes the heart UI appear.
*
*
* @param dMeterDrawPtr A pointer to the current dMeter2Draw structure
*/
*/
void setAlphaLifeAnimeMax(dMeter2Draw_c* dMeterDrawPtr);

/**
* @brief Makes the Oil meter disappear.
*
*
* @param dMeterDrawPtr A pointer to the current dMeter2Draw structure
*/
*/
void setAlphaKanteraAnimeMin(dMeter2Draw_c* dMeterDrawPtr);

/**
* @brief Makes the Oil meter appear.
*
*
* @param dMeterDrawPtr A pointer to the current dMeter2Draw structure
*/
*/
void setAlphaKanteraAnimeMax(dMeter2Draw_c* dMeterDrawPtr);

/**
* @brief Sets variables about the magic bar in the dMeterDraw object
* @param dMeterDrawPtr A pointer to the current dMeter2Draw structure
* @param max the maximum value of the bar (100%)
* @param curr the current value of the bar - how much is filled
* @param posX the X position of the magic meter
* @param posX the Y position of the magic meter
*/
void drawMagic(dMeter2Draw_c* dMeterDrawPtr, int32_t max, int32_t curr, float posX, float posY);

/**
* @brief sets the alpha rate of the bar and it's sides
* @param dMeterDrawPtr A pointer to the current dMeter2Draw structure
* @param forceSet if set to true force the change
*/
void setAlphaMagicChange(dMeter2Draw_c* dMeterDrawPtr, bool forceSet);

/**
* @brief draws the dMeter2Draw on screen
* @param dMeterDrawPtr A pointer to the current dMeter2Draw structure
*/
void draw(dMeter2Draw_c* dMeterDrawPtr);
}
} // namespace libtp::tp::d_meter2_draw
#endif
1 change: 1 addition & 0 deletions include/tp/d_meter2_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ namespace libtp::tp::d_meter2_info
* @param minigameFlag The status of the current minigame
*/
void resetMiniGameItem(G_Meter2_Info* g_meter2_info_ptr, bool minigameFlag);

}
} // namespace libtp::tp::d_meter2_info
#endif
Loading