first round of constants cleanup (#3021)

* first round of constants cleanup

* move m_PI_D definition

* remove compatibility comment

* add future version of angle subtracting with/without cast

* whitespace change to run builds again
This commit is contained in:
roeming
2026-01-10 16:38:04 -05:00
committed by GitHub
parent d5e748beaa
commit 37ec227b3f
30 changed files with 81 additions and 59 deletions
+4 -1
View File
@@ -151,7 +151,10 @@ public:
void setAwayFromAxisSpeed(f32 i_speed) { mAwayFromAxisSpeed = i_speed; }
void setSpread(f32 i_spread) { mSpread = i_spread; }
void setLocalTranslation(const JGeometry::TVec3<f32>& i_trans) { mLocalTrs.set(i_trans); }
void setLocalRotation(const JGeometry::TVec3<s16>& i_rot) { mLocalRot.set(i_rot.x * 0.005493248f, i_rot.y * 0.005493248f, i_rot.z * 0.005493248f); }
void setLocalRotation(const JGeometry::TVec3<s16>& i_rot) {
mLocalRot.set(i_rot.x * (360.0f / 0xffff), i_rot.y * (360.0f / 0xffff),
i_rot.z * (360.0f / 0xffff));
}
void setRateStep(u8 i_step) { mRateStep = i_step; }
void setGlobalParticleHeightScale(f32 height) {
@@ -4,6 +4,8 @@
#include "dolphin/mtx.h"
#include <math>
#define m_PI_D 3.141592653589793
namespace JStudio {
namespace math {
void getRotation_xyz(MtxP, f32, f32, f32);
+24 -9
View File
@@ -3,12 +3,27 @@
#include "SSystem/SComponent/c_xyz.h"
#if PLATFORM_SHIELD
#define ADD_ANGLE(x, y) ((x) += (s16)(y))
#define SUB_ANGLE(x, y) ((x) -= (s16)(y))
// There are some angles that weren't sign-extended until the shield version
#if !PLATFORM_SHIELD
#define ADD_ANGLE_2(x, y) ((x) += (y))
#define SUB_ANGLE_2(x, y) ((x) -= (y))
#else
#define ADD_ANGLE(x, y) ((x) += (y))
#define ADD_ANGLE_2(x, y) ADD_ANGLE(x, y)
#define SUB_ANGLE_2(x, y) SUB_ANGLE(x, y)
#endif
#define DEG2S_CONSTANT (0x8000 / 180.0f)
#define S2DEG_CONSTANT (180.0f / 0x8000)
#define S2RAD_CONSTANT (M_PI / 0x8000)
#define RAD2S_CONSTANT (0x8000 / M_PI)
#define DEG2S(x) ((s16)((x) * DEG2S_CONSTANT))
#define S2DEG(x) ((x) * S2DEG_CONSTANT)
#define S2RAD(x) ((x) * S2RAD_CONSTANT)
#define RAD2S(x) ((x) * RAD2S_CONSTANT)
class cSAngle {
private:
@@ -67,13 +82,13 @@ cSAngle operator+(short, const cSAngle&);
cSAngle operator-(short, const cSAngle&);
struct cAngle {
static f32 Radian_to_Degree(f32 rad) { return rad * 57.2957763671875f; }
static f32 Degree_to_Radian(f32 deg) { return deg * 0.017453292f; }
static s16 Degree_to_SAngle(f32 deg) { return deg * 182.04444885253906f; }
static f32 SAngle_to_Degree(s16 angle) { return (360.0f / 65536.0f) * angle; }
static f32 SAngle_to_Radian(s16 angle) { return 9.58738E-5f * angle; }
static f32 SAngle_to_Normal(s16 angle) { return 3.0517578E-5f * angle; }
static s16 Radian_to_SAngle(f32 rad) { return rad * 10430.378f; }
static f32 Radian_to_Degree(f32 rad) { return rad * (180.0f / M_PI); }
static f32 Degree_to_Radian(f32 deg) { return deg * (M_PI / 180.0f); }
static s16 Degree_to_SAngle(f32 deg) { return DEG2S(deg); }
static f32 SAngle_to_Degree(s16 angle) { return S2DEG(angle); }
static f32 SAngle_to_Radian(s16 angle) { return angle * (M_PI / 0x8000); }
static f32 SAngle_to_Normal(s16 angle) { return angle * (1.0f / 0x8000); }
static s16 Radian_to_SAngle(f32 rad) { return rad * (0x8000 / M_PI); }
/* Converts Radian value into Degree value */
static f32 r2d(f32 r) { return Radian_to_Degree(r); }
+3 -3
View File
@@ -119,7 +119,7 @@ inline s16 HIO_jntRX(int param_1, int param_2) {
} else {
rv = l_Cd_HIO.field_0x1648[param_1 - 16].field_0x4[param_2].jntR.x;
}
return 182.04444885253906f * rv;
return DEG2S(rv);
}
inline s16 HIO_jntRY(int param_1, int param_2) {
@@ -129,7 +129,7 @@ inline s16 HIO_jntRY(int param_1, int param_2) {
} else {
rv = l_Cd_HIO.field_0x1648[param_1 - 16].field_0x4[param_2].jntR.y;
}
return 182.04444885253906f * rv;
return DEG2S(rv);
}
inline s16 HIO_jntRZ(int param_1, int param_2) {
@@ -139,7 +139,7 @@ inline s16 HIO_jntRZ(int param_1, int param_2) {
} else {
rv = l_Cd_HIO.field_0x1648[param_1 - 16].field_0x4[param_2].jntR.z;
}
return 182.04444885253906f * rv;
return DEG2S(rv);
}
static inline f32 HIO_jntTX(int param_1, int param_2) {
+4 -3
View File
@@ -10,6 +10,7 @@
#include "SSystem/SComponent/c_xyz.h"
#include "Z2AudioLib/Z2SoundStarter.h"
#include "f_op/f_op_actor_mng.h"
#include "SSystem/SComponent/c_angle.h"
class J3DModel;
class dDemo_actor_c;
@@ -118,9 +119,9 @@ public:
*o_scale = mScale;
}
virtual void JSGGetRotation(Vec* param_0) const {
param_0->x = mRotate.x * 0.005493164f;
param_0->y = mRotate.y * 0.005493164f;
param_0->z = mRotate.z * 0.005493164f;
param_0->x = S2DEG(mRotate.x);
param_0->y = S2DEG(mRotate.y);
param_0->z = S2DEG(mRotate.z);
}
void setModel(J3DModel* p_model) { mModel = p_model; }
+1 -1
View File
@@ -81,7 +81,7 @@ inline void mDoCPd_ANALOG_CONV(u8 analog, f32& param_1) {
}
inline void mDoCPd_TRIGGER_CONV(u8 analog, f32& param_1) {
param_1 = analog * 0.0071428571827709675f;
param_1 = analog * (1.0f / 140.0f);
if (param_1 > 1.0f) {
param_1 = 1.0f;
}
+1 -1
View File
@@ -10,7 +10,7 @@ void J3DUClipper::init() {
void J3DUClipper::calcViewFrustum() {
static const f32 unused[3] = {0.0f};
f32 f0 = tan(0.5f * mFovY * 0.01745329238474369f);
f32 f0 = tan(0.5f * mFovY * (M_PI / 180.0f));
f32 f4 = mNear * f0;
f32 f5 = mAspect * f4;
Vec tmp1 = {-f5, -f4, -mNear};
+1 -1
View File
@@ -62,7 +62,7 @@ void JStudio::math::getFromTransformation_SRxyzT(Vec* param_1, Vec* param_2, Vec
param_4[1][0] * dVar9, param_4[1][1] * dVar8, param_4[1][2] * dVar7,
param_4[2][0] * dVar9, param_4[2][1] * dVar8, param_4[2][2] * dVar7);
aTStack_88.getEulerXYZ(&local_a0);
local_a0 *= 57.29577951308232;
local_a0 *= 180.0 / m_PI_D;
param_2->x = local_a0.x;
param_2->y = local_a0.y;
param_2->z = local_a0.z;
+1 -1
View File
@@ -309,7 +309,7 @@ void Z2AudioCamera::setCameraState(f32 (*param_0)[4], Vec& pos, Vec& param_2, f3
} else {
Vec aTStack_cc = {param_0[0][0], param_0[0][1], param_0[0][2]};
Mtx rotMtx;
MTXRotAxisRad(rotMtx, &aTStack_cc, 0.017453292f * (-1.0f * dVar10));
MTXRotAxisRad(rotMtx, &aTStack_cc, (M_PI / 180.0f) * (-1.0f * dVar10));
JGeometry::TVec3<f32> aTStack_d8;
MTXMultVec(rotMtx, aTStack_c0, aTStack_d8);
aTStack_d8.scale(aTStack_c0.y / aTStack_d8.y);
+1 -1
View File
@@ -2855,7 +2855,7 @@ s16 daAlink_c::getNeckAimAngle(cXyz* param_0, s16* param_1, s16* param_2, s16* p
s16 sp18;
s16 sp16 = field_0x2fe6 + mBodyAngle.y;
if ((mProcID == PROC_GOAT_CATCH && mProcVar1.field_0x300a == 0) || (mProcID == PROC_HAND_PAT && mProcVar2.field_0x300c == 0)) {
ADD_ANGLE(sp16, 0x8000);
ADD_ANGLE_2(sp16, 0x8000);
}
cXyz sp28 = eyePos - field_0x34e0;
+1 -1
View File
@@ -1043,7 +1043,7 @@ void daCstatue_c::initStartBrkBtk() {
for (int iParticle = 0; iParticle < 2; iParticle++) {
dComIfGp_particle_set(0x88bb, &mBallPos, &angle, NULL);
dComIfGp_particle_set(0x88bc, &mBallPos, &angle, NULL);
ADD_ANGLE(angle.y, 0x8000);
ADD_ANGLE_2(angle.y, 0x8000);
}
}
+4 -3
View File
@@ -1174,14 +1174,15 @@ inline int daDemo00_c::execute() {
if (field_0x6ae != 0) {
f32 cutoff = 90.0f;
cutoff = shape_angle.z / 182.04445f;
// converting from short to degrees
cutoff = shape_angle.z / DEG2S_CONSTANT;
GXColor color;
color.r = scale.x;
color.g = scale.y;
color.b = scale.z;
color.a = 0xFF;
f32 f30 = shape_angle.x / 182.04445f;
f32 f29 = shape_angle.y / 182.04445f;
f32 f30 = shape_angle.x / DEG2S_CONSTANT;
f32 f29 = shape_angle.y / DEG2S_CONSTANT;
dKy_BossSpotLight_set(&current.pos, f30, f29 - 90.0f,
cutoff, &color, gravity, field_0x6b0, field_0x6af);
}
+1 -1
View File
@@ -1232,7 +1232,7 @@ static int daE_HZELDA_Execute(e_hzelda_class* i_this) {
sp108.z = player->current.pos.z - i_this->mTrianglePos.z;
cMtx_YrotS(*calc_mtx, -i_this->mTriangleRotY);
MtxPosition(&sp108, &sp114);
// 57.295 is close to 180 / PI, but not quite, probably a hand written constant
f32 var_f31 = fabsf(57.295f * cM_atan2f(sp114.x, sp114.z));
if (var_f31 >= 60.0f && var_f31 <= 120.0f) {
var_f31 = 120.0f - var_f31;
+4 -4
View File
@@ -683,7 +683,7 @@ static BOOL way_check(e_rdy_class* i_this) {
dBgS_LinChk lin_chk;
lin_chk.Set(&start, &end, _this);
if (dComIfG_Bgsp().LineCross(&lin_chk)) {
ADD_ANGLE(angle, 0x1000);
ADD_ANGLE_2(angle, 0x1000);
} else {
i_this->mTargetAngleY = angle;
return TRUE;
@@ -1165,7 +1165,7 @@ static void e_rdy_bow_run(e_rdy_class* i_this) {
case 1:
target_speed = run_speed;
ADD_ANGLE(target_angle, 0x8000);
ADD_ANGLE_2(target_angle, 0x8000);
if (i_this->mPlayerDist > l_HIO.field_0x28 || i_this->mTimer[0] == 0
|| i_this->mAcch.ChkWallHit())
{
@@ -1933,7 +1933,7 @@ static void e_rdy_bomb_action(e_rdy_class* i_this) {
break;
}
}
ADD_ANGLE(target_angle, 0x8000);
ADD_ANGLE_2(target_angle, 0x8000);
target_speed = l_HIO.mRunSpeed;
if (JMAFastSqrt(vec1.x * vec1.x + vec1.z * vec1.z) > 600.0f) {
i_this->mMode = 3;
@@ -2171,7 +2171,7 @@ static void e_rdy_damage(e_rdy_class* i_this) {
i_this->mMode = 10;
a_this->speed.y = 0.0f;
i_this->field_0xabc *= 0.2f;
ADD_ANGLE(i_this->field_0xadc.y, 0x8000);
ADD_ANGLE_2(i_this->field_0xadc.y, 0x8000);
i_this->field_0xbc0 = 5 + BREG_S(7);
i_this->field_0xaf4 = 100.0f + BREG_F(4);
i_this->field_0xafc = 100.0f + BREG_F(5);
+2
View File
@@ -1487,6 +1487,8 @@ static void action(e_s1_class* i_this) {
if (can_bibiri && (daPy_getPlayerActorClass()->checkWolfBark() || daPy_getPlayerActorClass()->checkWolfThreat()) && pl_at_check(i_this, l_HIO.mReactionDist)) {
fopAc_ac_c* player = dComIfGp_getPlayer(0);
s16 angle_to_player = player->shape_angle.y - (fopAcM_searchPlayerAngleY(a_this) + 0x8000);
// 182.04 is close to the degree -> short constant, but not quite,
// maybe someone calculated it on their own and rounded it off?
s16 bibiri_angle = 182.04f * l_HIO.mReactionAngle;
if (angle_to_player < bibiri_angle && angle_to_player > (s16)-bibiri_angle) {
+3 -3
View File
@@ -815,7 +815,7 @@ static inline s16 Cd2_HIO_jntRZ(int param_1, int param_2) {
} else {
rv = l_Cd2_HIO.field_0x20c4[param_1 - 16].field_0x004[param_2].field_0x04.field_0x0C[2];
}
return 182.04444885253906f * rv;
return DEG2S(rv);
}
static inline s16 Cd2_HIO_jntRY(int param_1, int param_2) {
@@ -825,7 +825,7 @@ static inline s16 Cd2_HIO_jntRY(int param_1, int param_2) {
} else {
rv = l_Cd2_HIO.field_0x20c4[param_1 - 16].field_0x004[param_2].field_0x04.field_0x0C[1];
}
return 182.04444885253906f * rv;
return DEG2S(rv);
}
static inline s16 Cd2_HIO_jntRX(int param_1, int param_2) {
@@ -835,7 +835,7 @@ static inline s16 Cd2_HIO_jntRX(int param_1, int param_2) {
} else {
rv = l_Cd2_HIO.field_0x20c4[param_1 - 16].field_0x004[param_2].field_0x04.field_0x0C[0];
}
return 182.04444885253906f * rv;
return DEG2S(rv);
}
int daNpcCd2_c::jntNodeCB(J3DJoint* param_1, J3DModel* param_2) {
+3 -3
View File
@@ -2872,15 +2872,15 @@ inline f32 JntTZ(int type, int jnt_no) {
}
inline s16 JntRX(int type, int jnt_no) {
return (type < 16 ? a_jntTbl_M[type].jntPrm[jnt_no].jntR[0] : a_jntTbl_W[type - 16].jntPrm[jnt_no].jntR[0]) * 182.04445f;
return DEG2S(type < 16 ? a_jntTbl_M[type].jntPrm[jnt_no].jntR[0] : a_jntTbl_W[type - 16].jntPrm[jnt_no].jntR[0]);
}
inline s16 JntRY(int type, int jnt_no) {
return (type < 16 ? a_jntTbl_M[type].jntPrm[jnt_no].jntR[1] : a_jntTbl_W[type - 16].jntPrm[jnt_no].jntR[1]) * 182.04445f;
return DEG2S(type < 16 ? a_jntTbl_M[type].jntPrm[jnt_no].jntR[1] : a_jntTbl_W[type - 16].jntPrm[jnt_no].jntR[1]);
}
inline s16 JntRZ(int type, int jnt_no) {
return (type < 16 ? a_jntTbl_M[type].jntPrm[jnt_no].jntR[2] : a_jntTbl_W[type - 16].jntPrm[jnt_no].jntR[2]) * 182.04445f;
return DEG2S(type < 16 ? a_jntTbl_M[type].jntPrm[jnt_no].jntR[2] : a_jntTbl_W[type - 16].jntPrm[jnt_no].jntR[2]);
}
int daNpcChat_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) {
+2 -2
View File
@@ -199,7 +199,7 @@ void daPropY_c::init_modeMove2() {
void daPropY_c::modeMove2() {
cLib_chaseF(&speedF, l_HIO.max_rot_speed, l_HIO.rot_accel);
s16 temp_r30 = cLib_addCalcAngleS(&shape_angle.y, field_0x5b6, 1, (182.04445f * fopAcM_GetSpeedF(this)), 1);
s16 temp_r30 = cLib_addCalcAngleS(&shape_angle.y, field_0x5b6, 1, DEG2S(fopAcM_GetSpeedF(this)), 1);
field_0x5c4 = 127.0f * (speedF / l_HIO.max_rot_speed);
mDoAud_seStartLevel(Z2SE_OBJ_AMI_ROLL, &current.pos, field_0x5c4, dComIfGp_getReverb(fopAcM_GetRoomNo(this)));
@@ -240,7 +240,7 @@ void daPropY_c::modeStop() {
if (mTurnType == 0) {
var_r30 = cLib_addCalcAngleS(&shape_angle.y, field_0x5b6, 16, fopAcM_GetSpeedF(this), cM_deg2s(0.1f));
} else {
var_r30 = cLib_addCalcAngleS(&shape_angle.y, field_0x5b6, 1, (182.04445f * fopAcM_GetSpeedF(this)), 1);
var_r30 = cLib_addCalcAngleS(&shape_angle.y, field_0x5b6, 1, DEG2S(fopAcM_GetSpeedF(this)), 1);
}
// probably not a real version difference - GCN has fsub for some reason instead of fsubs
+1 -2
View File
@@ -242,8 +242,7 @@ void daMagLiftRot_c::init_modeMove() {
void daMagLiftRot_c::modeMove() {
cLib_chaseF(&speedF, l_HIO.mMaxSpeed, l_HIO.mAcceleration);
if (cLib_addCalcAngleS(&current.angle.z, field_0x5e2, 1, fopAcM_GetSpeedF(this) * 182.04445f,
1) == 0)
if (cLib_addCalcAngleS(&current.angle.z, field_0x5e2, 1, DEG2S(fopAcM_GetSpeedF(this)), 1) == 0)
{
field_0x5e2 += 0x8000;
field_0x5e4 = 0;
+1 -1
View File
@@ -98,7 +98,7 @@ void dScissorBegin_packet_c::draw() {
f32 sp2C = view_p->fovy;
f32 sp28 = view_p->aspect;
f32 sp24 = std::tan(0.017453292f * (0.5f * sp2C));
f32 sp24 = std::tan((M_PI / 180.0f) * (0.5f * sp2C));
f32 sp20, sp1C, sp18, sp14;
view_port_class* viewport_p = dComIfGd_getViewport();
+1 -1
View File
@@ -353,7 +353,7 @@ void daTaFence_c::init_modeMove() {
void daTaFence_c::modeMove() {
cLib_chaseF(&speedF, mFallSpeed, mFallSpeed / 30.0f);
if (cLib_addCalcAngleS(&shape_angle.x, field_0x1384, 1, (182.04445f * fopAcM_GetSpeedF(this)), 1) == 0) {
if (cLib_addCalcAngleS(&shape_angle.x, field_0x1384, 1, DEG2S(fopAcM_GetSpeedF(this)), 1) == 0) {
init_modeMoveEnd();
}
}
+1 -1
View File
@@ -64,7 +64,7 @@ int daObjWPndlm_c::Create() {
if (arg0 == 0 || arg0 == 255) {
arg0 = 0;
}
field_0x958 = arg0 * 182.04445f;
field_0x958 = DEG2S(arg0);
return 1;
}
+2 -2
View File
@@ -8498,7 +8498,7 @@ bool dCamera_c::observeCamera(s32 param_0) {
} else if (mPadInfo.mMainStick.mLastPosX <= -0.75f) {
sp50 = -1.0f;
} else {
sp50 = dCamMath::rationalBezierRatio(mPadInfo.mMainStick.mLastPosX * 1.3333334f, dVar8);
sp50 = dCamMath::rationalBezierRatio(mPadInfo.mMainStick.mLastPosX * (4.0f / 3.0f), dVar8);
}
if (mPadInfo.mMainStick.mLastPosY >= 0.75f) {
@@ -8506,7 +8506,7 @@ bool dCamera_c::observeCamera(s32 param_0) {
} else if (mPadInfo.mMainStick.mLastPosY <= -0.75f) {
sp54 = -1.0f;
} else {
sp54 = dCamMath::rationalBezierRatio(mPadInfo.mMainStick.mLastPosY * 1.3333334f, dVar8);
sp54 = dCamMath::rationalBezierRatio(mPadInfo.mMainStick.mLastPosY * (4.0f / 3.0f), dVar8);
}
if (dComIfGs_getOptCameraControl() != 0) {
+5 -5
View File
@@ -397,9 +397,9 @@ void dDemo_actor_c::JSGSetScaling(Vec const& i_scale) {
}
void dDemo_actor_c::JSGSetRotation(Vec const& i_rotate) {
mRotate.x = i_rotate.x * 182.04444885253906f;
mRotate.y = i_rotate.y * 182.04444885253906f;
mRotate.z = i_rotate.z * 182.04444885253906f;
mRotate.x = DEG2S(i_rotate.x);
mRotate.y = DEG2S(i_rotate.y);
mRotate.z = DEG2S(i_rotate.z);
onEnable(ENABLE_ROTATE_e);
}
@@ -560,8 +560,8 @@ f32 dDemo_camera_c::JSGGetViewRoll() const {
if (view == NULL) {
return 0.0f;
}
return view->bank * 0.0054931640625f;
return S2DEG(view->bank);
}
void dDemo_camera_c::JSGSetViewRoll(f32 i_roll) {
+2 -3
View File
@@ -1544,7 +1544,7 @@ int dDlst_shadowControl_c::setReal(u32 param_1, s8 param_2, J3DModel* param_3, c
};
f32 fVar1;
f32 dVar16 = (param_2 == 0) ? 1.0f : (1.0f - 0.003000000026077032f * param_6);
f32 dVar16 = (param_2 == 0) ? 1.0f : (1.0f - 0.003f * param_6);
if (dVar16 <= 0.0f) {
return 0;
}
@@ -1558,8 +1558,7 @@ int dDlst_shadowControl_c::setReal(u32 param_1, s8 param_2, J3DModel* param_3, c
}
f32 dVar17 = acStack_94.z + param_5;
if (dVar17 < -1000.0f) {
f32 fVar1 = 0.0010000000474974513f *
(-1000.0f - dVar17);
f32 fVar1 = 0.001f * (-1000.0f - dVar17);
if (fVar1 >= 1.0f) {
return 0;
}
+2 -2
View File
@@ -3348,8 +3348,8 @@ bool dCamera_c::possessedEvCamera() {
cXyz sp60;
mDoLib_project(&mEyePos, &sp60);
SetBlurePosition(sp60.x / scissor->width, sp60.y / scissor->height, 0.0f);
SetBlureAlpha((fVar1 * 0.699999988079071f) + 0.5f);
SetBlureScale((fVar1 * 0.09000000357627869f) + 1.1f, 0.98f - (fVar1 * 0.18000000715255737f), 0.0f);
SetBlureAlpha((fVar1 * 0.7f) + 0.5f);
SetBlureScale((fVar1 * 0.09f) + 1.1f, 0.98f - (fVar1 * 0.18f), 0.0f);
}
}
+1 -1
View File
@@ -5439,7 +5439,7 @@ void dFile_select3D_c::toItem3Dpos(f32 param_0, f32 param_1, f32 param_2, cXyz*
param_1 = (2.0f * ((param_1 - -100.0f) / 448.0f) - 1.0f);
calcViewMtx(adStack_98);
cMtx_inverse(adStack_98, auStack_c8);
f32 tangent = std::tan(0.39269909262657166);
f32 tangent = std::tan(M_PI / 8.0f);
f32 dVar12 = -param_2;
cXyz cStack_d4((param_0 * param_2) * (mDoGph_gInf_c::getAspect() * tangent),
(tangent * (param_1 * dVar12)), dVar12);
+1 -1
View File
@@ -117,7 +117,7 @@ void dKyr_lenzflare_move() {
dKyr_get_vectle_calc(&center, &proj, &vect);
lenz_packet->field_0x94 = cM_atan2s(vect.x, vect.y);
lenz_packet->field_0x94 *= 0.0054931640625f; // Maybe 45 / 8192
lenz_packet->field_0x94 *= S2DEG_CONSTANT; // convert from short angle to degrees
lenz_packet->field_0x94 += 180.0f;
dKyr_get_vectle_calc(&camera->lookat.eye, &camera->lookat.center, &camFwd);
+1 -1
View File
@@ -775,7 +775,7 @@ void dMap_c::changeTextureSize(int param_1, int param_2, int param_3) {
mTexSizeH = param_2 >> param_3;
u32 imageSize = GXGetTexBufferSize(mTexSizeW, mTexSizeH, 9, 0, 0);
OS_REPORT("imageSize<%d> <%d kbyte>mTexSizeW<%d>mTexSizeH<%d>\n", imageSize, imageSize * 0.0009765625f, mTexSizeW, mTexSizeH);
OS_REPORT("imageSize<%d> <%d kbyte>mTexSizeW<%d>mTexSizeH<%d>\n", imageSize, imageSize * (1.0f / 1024.f), mTexSizeW, mTexSizeH);
JUT_ASSERT(2682, mImage_p != NULL);
+1 -1
View File
@@ -46,7 +46,7 @@ void mDoLib_clipper::setup(f32 fovy, f32 aspect, f32 near, f32 far) {
mSystemFar = far;
mClipper.calcViewFrustum();
s16 tmp = fovy * 182.04444885253906f;
s16 tmp = DEG2S(fovy);
mFovyRate = cM_scos(tmp) / cM_ssin(tmp);
}