mirror of https://github.com/zeldaret/tp.git
Match d_a_obj_ice_s rideCallBack
Co-authored-by: Cuyler36 <Cuyler36@users.noreply.github.com>
This commit is contained in:
parent
bd0c601a52
commit
1aa0e36881
|
|
@ -2429,7 +2429,7 @@ config.libs = [
|
|||
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_hfuta"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_hsTarget"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_ice_l"),
|
||||
ActorRel(NonMatching, "d_a_obj_ice_s"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_ice_s"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_iceblock"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_iceleaf"),
|
||||
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_ihasi"),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public:
|
|||
void initBaseMtx();
|
||||
void setBaseMtx();
|
||||
inline int create();
|
||||
inline int CreateHeap();
|
||||
int CreateHeap();
|
||||
int Create();
|
||||
int Execute(Mtx**);
|
||||
int Draw();
|
||||
|
|
|
|||
|
|
@ -12,10 +12,16 @@
|
|||
|
||||
#define FP_NAN FP_QNAN
|
||||
|
||||
#if __REVOLUTION_SDK__
|
||||
#define fpclassify(x) \
|
||||
((sizeof(x) == sizeof(float)) ? __fpclassifyf((float)(x)) : \
|
||||
(sizeof(x) == sizeof(double)) ? __fpclassifyd((double)(x)) : \
|
||||
__fpclassifyl((long double)(x)) )
|
||||
#else
|
||||
#define fpclassify(x) \
|
||||
((sizeof(x) == sizeof(float)) ? __fpclassifyf((float)(x)) : \
|
||||
__fpclassifyd((double)(x)) )
|
||||
#endif
|
||||
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x))
|
||||
#define isfinite(x) ((fpclassify(x) > FP_INFINITE))
|
||||
#define isnan(x) (fpclassify(x) == FP_NAN)
|
||||
|
|
@ -26,27 +32,25 @@
|
|||
// TODO: OK?
|
||||
#define __signbitd(x) ((int)(__HI(x) & 0x80000000))
|
||||
|
||||
extern unsigned long __float_nan[];
|
||||
extern unsigned long __float_huge[];
|
||||
extern unsigned long __float_max[];
|
||||
extern unsigned long __float_epsilon[];
|
||||
extern int __float_nan[];
|
||||
extern int __float_huge[];
|
||||
extern int __float_max[];
|
||||
extern int __float_epsilon[];
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
inline int __fpclassifyf(float __value) {
|
||||
unsigned long integer = *(unsigned long*)&__value;
|
||||
|
||||
switch (integer & 0x7f800000) {
|
||||
switch (*(int*)&__value & 0x7f800000) {
|
||||
case 0x7f800000:
|
||||
if ((integer & 0x7fffff) != 0) {
|
||||
if ((*(int*)&__value & 0x7fffff) != 0) {
|
||||
return FP_QNAN;
|
||||
}
|
||||
return FP_INFINITE;
|
||||
|
||||
case 0:
|
||||
if ((integer & 0x7fffff) != 0) {
|
||||
if ((*(int*)&__value & 0x7fffff) != 0) {
|
||||
return FP_SUBNORMAL;
|
||||
}
|
||||
return FP_ZERO;
|
||||
|
|
|
|||
|
|
@ -98,11 +98,12 @@ inline float sqrtf(float mag) {
|
|||
static const double _three = 3.0;
|
||||
#endif
|
||||
if (mag > 0.0f) {
|
||||
double tmpd = __frsqrte(mag);
|
||||
tmpd = tmpd * _half * (_three - mag * (tmpd * tmpd));
|
||||
tmpd = tmpd * _half * (_three - mag * (tmpd * tmpd));
|
||||
tmpd = tmpd * _half * (_three - mag * (tmpd * tmpd));
|
||||
return mag * tmpd;
|
||||
double dmag = (double)mag;
|
||||
double tmpd = __frsqrte(dmag);
|
||||
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
|
||||
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
|
||||
tmpd = _half * tmpd * (_three - tmpd * tmpd * dmag);
|
||||
return (float)(dmag * tmpd);
|
||||
} else if (mag < 0.0) {
|
||||
return NAN;
|
||||
} else if (isnan(mag)) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#include "float.h"
|
||||
|
||||
unsigned long __float_nan[] = {0x7FFFFFFF};
|
||||
int __float_nan[] = {0x7FFFFFFF};
|
||||
|
||||
unsigned long __float_huge[] = {0x7F800000};
|
||||
int __float_huge[] = {0x7F800000};
|
||||
|
||||
#if !__REVOLUTION_SDK__
|
||||
unsigned long __float_max[] = {0x7F7FFFFF};
|
||||
int __float_max[] = {0x7F7FFFFF};
|
||||
|
||||
unsigned long __float_epsilon[] = {0x34000000};
|
||||
int __float_epsilon[] = {0x34000000};
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
|
|
|
|||
|
|
@ -67,10 +67,11 @@ void daObjIce_l_c::setBaseMtx() {
|
|||
}
|
||||
|
||||
static void rideCallBack(dBgW* param_0, fopAc_ac_c* param_1, fopAc_ac_c* param_2) {
|
||||
(void)param_0;
|
||||
daObjIce_l_c* ice_p = (daObjIce_l_c*)param_1;
|
||||
daPy_py_c* player_p = daPy_getPlayerActorClass();
|
||||
cXyz* ball_pos = player_p->getIronBallCenterPos();
|
||||
cXyz& player_pos = fopAcM_GetPosition(player_p);
|
||||
daObjIce_l_c* ice_p = static_cast<daObjIce_l_c*>(param_1);
|
||||
|
||||
//!@bug Missing parentheses causes this comparison to always evaluate to false
|
||||
if (!fopAcM_GetName(param_2) == PROC_ALINK) {
|
||||
|
|
@ -81,7 +82,7 @@ static void rideCallBack(dBgW* param_0, fopAc_ac_c* param_1, fopAc_ac_c* param_2
|
|||
ice_p->Check_RideOn(player_pos);
|
||||
}
|
||||
|
||||
cXyz* ice_pos = &fopAcM_GetPosition(ice_p);
|
||||
cXyz* ice_pos = &fopAcM_GetPosition(param_1);
|
||||
if (ball_pos != NULL && ice_pos != NULL &&
|
||||
ice_pos->absXZ(*ball_pos) < ice_p->field_0x5b4.x * 600.0f)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
class daOBJ_ICE_S_HIO_c : public JORReflexible {
|
||||
public:
|
||||
daOBJ_ICE_S_HIO_c();
|
||||
virtual ~daOBJ_ICE_S_HIO_c();
|
||||
virtual ~daOBJ_ICE_S_HIO_c() {}
|
||||
|
||||
void genMessage(JORMContext*);
|
||||
|
||||
|
|
@ -28,8 +28,6 @@ public:
|
|||
|
||||
static char* l_arcName = "V_Ice_s";
|
||||
|
||||
daOBJ_ICE_S_HIO_c::~daOBJ_ICE_S_HIO_c() {}
|
||||
|
||||
daOBJ_ICE_S_HIO_c::daOBJ_ICE_S_HIO_c() {
|
||||
mId = -1;
|
||||
mSlopeMagnitude = 5000.0f;
|
||||
|
|
@ -119,12 +117,11 @@ void daObjIce_s_c::setBaseMtx() {
|
|||
cMtx_copy(mDoMtx_stack_c::get(), mBgMtx);
|
||||
}
|
||||
|
||||
// NONMATCHING - regalloc, equivalent
|
||||
static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3) {
|
||||
(void)param_1;
|
||||
daObjIce_s_c* ice = (daObjIce_s_c*)param_2;
|
||||
daPy_py_c* player = daPy_getPlayerActorClass();
|
||||
cXyz* playerPos = (cXyz*)&fopAcM_GetPosition(player);
|
||||
cXyz* playerPos = &fopAcM_GetPosition(player);
|
||||
cXyz* pBallCenter = player->getIronBallCenterPos();
|
||||
|
||||
// !@bug misplaced ! operator. This condition is probably always false
|
||||
|
|
@ -137,7 +134,7 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3
|
|||
ice->Check_LinkRideOn(*playerPos);
|
||||
}
|
||||
|
||||
cXyz* icePos = (cXyz*)&fopAcM_GetPosition(param_2);
|
||||
cXyz* icePos = &fopAcM_GetPosition(param_2);
|
||||
if (pBallCenter != NULL && icePos != NULL &&
|
||||
icePos->absXZ(*pBallCenter) < ice->field_0x5c8.x * 600.0f)
|
||||
{
|
||||
|
|
@ -230,7 +227,7 @@ inline int daObjIce_s_c::create() {
|
|||
return rv;
|
||||
}
|
||||
|
||||
inline int daObjIce_s_c::CreateHeap() {
|
||||
int daObjIce_s_c::CreateHeap() {
|
||||
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "Ice_s.bmd");
|
||||
JUT_ASSERT(157, modelData != NULL);
|
||||
mModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
|
||||
|
|
|
|||
Loading…
Reference in New Issue