mirror of
https://github.com/zeldaret/tww.git
synced 2026-09-02 17:53:06 -04:00
+23
-25
@@ -7,6 +7,29 @@
|
||||
|
||||
namespace JGeometry {
|
||||
|
||||
template <typename T>
|
||||
struct TUtil {
|
||||
static inline f32 epsilon() { return 3.81469727e-06f; }
|
||||
|
||||
static inline f32 sqrt(f32 mag) {
|
||||
if (mag <= 0.0f) {
|
||||
return mag;
|
||||
} else {
|
||||
f32 root = __frsqrte(mag);
|
||||
return 0.5f * root * (3.0f - mag * (root * root)) * mag;
|
||||
}
|
||||
}
|
||||
|
||||
static inline f32 inv_sqrt(f32 mag) {
|
||||
if (mag <= 0.0f) {
|
||||
return mag;
|
||||
} else {
|
||||
f32 root = __frsqrte(mag);
|
||||
return 0.5f * root * (3.0f - mag * (root * root));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TVec3 {
|
||||
T x;
|
||||
@@ -358,31 +381,6 @@ struct TBox2 : TBox<TVec2<T> > {
|
||||
void set(f32 x0, f32 y0, f32 x1, f32 y1) { i.set(x0, y0); f.set(x1, y1); }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct TUtil {
|
||||
static inline f32 epsilon() {
|
||||
return 3.81469727e-06f;
|
||||
}
|
||||
|
||||
static inline f32 sqrt(f32 mag) {
|
||||
if (mag <= 0.0f) {
|
||||
return mag;
|
||||
} else {
|
||||
f32 root = __frsqrte(mag);
|
||||
return 0.5f * root * (3.0f - mag * (root * root)) * mag;
|
||||
}
|
||||
}
|
||||
|
||||
static inline f32 inv_sqrt(f32 mag) {
|
||||
if (mag <= 0.0f) {
|
||||
return mag;
|
||||
} else {
|
||||
f32 root = __frsqrte(mag);
|
||||
return 0.5f * root * (3.0f - mag * (root * root));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
} // namespace JGeometry
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
}
|
||||
|
||||
void end() {
|
||||
mCost = ((OSGetTick() - mTick) * 8) / ((*(u32*)0x800000F8 / 4) / 125000);
|
||||
mCost = OSTicksToMicroseconds(OSGetTick() - mTick);
|
||||
if (mCost == 0) {
|
||||
mCost = 1;
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ void JPADraw::setParticleClipBoard() {
|
||||
switch (dc.pbsp->getType()) {
|
||||
case JPABaseShape::JPAType_Billboard:
|
||||
case JPABaseShape::JPAType_DirBillboard:
|
||||
PSMTXIdentity(cb.mDrawMtx);
|
||||
MTXIdentity(cb.mDrawMtx);
|
||||
break;
|
||||
case JPABaseShape::JPAType_YBillboard:
|
||||
loadYBBMtx(cb.mDrawMtxPtr);
|
||||
@@ -732,7 +732,7 @@ void JPADraw::setChildClipBoard() {
|
||||
switch (dc.pssp->getType()) {
|
||||
case JPABaseShape::JPAType_Billboard:
|
||||
case JPABaseShape::JPAType_DirBillboard:
|
||||
PSMTXIdentity(cb.mDrawMtx);
|
||||
MTXIdentity(cb.mDrawMtx);
|
||||
break;
|
||||
case JPABaseShape::JPAType_YBillboard:
|
||||
loadYBBMtx(cb.mDrawMtxPtr);
|
||||
|
||||
@@ -1273,7 +1273,7 @@ BOOL daBomb_c::createHeap() {
|
||||
}
|
||||
|
||||
static BOOL daBomb_createHeap(fopAc_ac_c* i_this) {
|
||||
static_cast<daBomb_c*>(i_this)->createHeap();
|
||||
return static_cast<daBomb_c*>(i_this)->createHeap();
|
||||
}
|
||||
|
||||
int daBomb_c::create() {
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ void dFlower_packet_c::calc() {
|
||||
}
|
||||
|
||||
/* 800C0A88-800C0D38 .text checkGroundY__FR4cXyz */
|
||||
void checkGroundY(cXyz&) {
|
||||
static void checkGroundY(cXyz&) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ void dGrass_packet_c::calc() {
|
||||
}
|
||||
|
||||
/* 80078008-800782B8 .text checkGroundY__FR4cXyz */
|
||||
void checkGroundY(cXyz&) {
|
||||
static void checkGroundY(cXyz&) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ s16 u8_data_ratio_set(u8 param_0, u8 param_1, f32 param_2) {
|
||||
}
|
||||
|
||||
/* 8018F894-8018F8E4 .text s16_data_ratio_set__Fssf */
|
||||
s16 s16_data_ratio_set(s16 param_0, s16 param_1, f32 param_2) {
|
||||
static s16 s16_data_ratio_set(s16 param_0, s16 param_1, f32 param_2) {
|
||||
return param_0 + (s16)(param_2 * (param_1 - param_0));
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ f32 float_kankyo_color_ratio_set(f32 param_0, f32 param_1, f32 param_2, f32 para
|
||||
}
|
||||
|
||||
/* 8018FAE0-8018FB14 .text get_parcent__Ffff */
|
||||
f32 get_parcent(f32 param_0, f32 param_1, f32 param_2) {
|
||||
static f32 get_parcent(f32 param_0, f32 param_1, f32 param_2) {
|
||||
f32 temp_f1;
|
||||
f32 temp_f2;
|
||||
f32 temp_f4 = param_0 - param_1;
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ BOOL dKyeff_Draw(dKyeff_c* i_this) {
|
||||
}
|
||||
|
||||
/* 80198008-8019803C .text get_parcent__Ffff */
|
||||
f32 get_parcent(f32 param_0, f32 param_1, f32 param_2) {
|
||||
static f32 get_parcent(f32 param_0, f32 param_1, f32 param_2) {
|
||||
f32 temp_f1;
|
||||
f32 temp_f2;
|
||||
f32 temp_f4 = param_0 - param_1;
|
||||
@@ -41,7 +41,7 @@ f32 get_parcent(f32 param_0, f32 param_1, f32 param_2) {
|
||||
}
|
||||
|
||||
/* 8019803C-8019808C .text s16_data_ratio_set__Fssf */
|
||||
s16 s16_data_ratio_set(s16 param_0, s16 param_1, f32 param_2) {
|
||||
static s16 s16_data_ratio_set(s16 param_0, s16 param_1, f32 param_2) {
|
||||
return param_0 + (s16)(param_2 * (param_1 - param_0));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ u32 dLib_setFirstMsg(u16 eventBit, u32 firstMsgID, u32 secondMsgID) {
|
||||
/* 80057F30-80057F78 .text dLib_checkPlayerInCircle__F4cXyzff */
|
||||
bool dLib_checkPlayerInCircle(cXyz center, f32 radius, f32 halfHeight) {
|
||||
fopAc_ac_c* link = dComIfGp_getLinkPlayer();
|
||||
dLib_checkActorInCircle(center, link, radius, halfHeight);
|
||||
return dLib_checkActorInCircle(center, link, radius, halfHeight);
|
||||
}
|
||||
|
||||
/* 80057F78-80058098 .text dLib_checkActorInCircle__F4cXyzP10fopAc_ac_cff */
|
||||
|
||||
@@ -62,7 +62,7 @@ s32 fopMsgM_setStageLayer(void* proc) {
|
||||
scene_class* stageProc = fopScnM_SearchByID(g_dComIfG_gameInfo.play.getRoomControl()->mProcID);
|
||||
JUT_ASSERT(0x189, stageProc != 0);
|
||||
u32 layer = fpcM_LayerID(stageProc);
|
||||
fpcM_ChangeLayerID(proc, layer);
|
||||
return fpcM_ChangeLayerID(proc, layer);
|
||||
}
|
||||
|
||||
/* 8002AED4-8002AEF4 .text fopMsgM_SearchByID__FUi */
|
||||
|
||||
@@ -169,7 +169,7 @@ void mDoExt_bpkAnm::entry(J3DMaterialTable* i_matTable, f32 i_frame) {
|
||||
|
||||
/* 8000E32C-8000E358 .text init__13mDoExt_btpAnmFP12J3DModelDataP16J3DAnmTexPatterniifssbi */
|
||||
int mDoExt_btpAnm::init(J3DModelData* i_modelData, J3DAnmTexPattern* i_btp, int i_anmPlay, int i_attribute, f32 i_rate, s16 i_startF, s16 i_endF, bool i_modify, int i_entry) {
|
||||
init(&i_modelData->getMaterialTable(), i_btp, i_anmPlay, i_attribute, i_rate, i_startF, i_endF, i_modify, i_entry);
|
||||
return init(&i_modelData->getMaterialTable(), i_btp, i_anmPlay, i_attribute, i_rate, i_startF, i_endF, i_modify, i_entry);
|
||||
}
|
||||
|
||||
/* 8000E358-8000E37C .text entry__13mDoExt_btpAnmFP12J3DModelDatas */
|
||||
@@ -221,7 +221,7 @@ void mDoExt_btpAnm::entry(J3DMaterialTable* i_matTable, s16 i_frame) {
|
||||
|
||||
/* 8000E6CC-8000E6F8 .text init__13mDoExt_btkAnmFP12J3DModelDataP19J3DAnmTextureSRTKeyiifssbi */
|
||||
int mDoExt_btkAnm::init(J3DModelData* i_modelData, J3DAnmTextureSRTKey* i_btk, int i_anmPlay, int i_attribute, f32 i_rate, s16 i_startF, s16 i_endF, bool i_modify, int i_entry) {
|
||||
init(&i_modelData->getMaterialTable(), i_btk, i_anmPlay, i_attribute, i_rate, i_startF, i_endF, i_modify, i_entry);
|
||||
return init(&i_modelData->getMaterialTable(), i_btk, i_anmPlay, i_attribute, i_rate, i_startF, i_endF, i_modify, i_entry);
|
||||
}
|
||||
|
||||
/* 8000E6F8-8000E71C .text entry__13mDoExt_btkAnmFP12J3DModelDataf */
|
||||
|
||||
Reference in New Issue
Block a user