More General Cleanup (#1638)

* LINKER_FILES in makefile

* COLPOLY_GET_NORMAL

* math header

* libc

* M_PI for cosf and sinf files

* MAXFLOAT

* Revert "MAXFLOAT"

This reverts commit 96b75ffaa8.

* Remove SHT_MINV

* SHRT_MAX

* Add M_PI

* Angle macros

* f suffix

* Format
This commit is contained in:
Derek Hensley
2024-06-03 11:33:03 -07:00
committed by GitHub
parent 312b65d5e3
commit f26e77ba40
144 changed files with 372 additions and 369 deletions
+9 -9
View File
@@ -4064,7 +4064,7 @@ void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type) {
if ((i % 2) != 0) {
rotZStep = 2.0f * entry->chainAngle;
} else {
rotZStep = M_PI - (2.0f * entry->chainAngle);
rotZStep = M_PIf - (2.0f * entry->chainAngle);
}
chainRotZ += rotZStep;
@@ -4902,11 +4902,11 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
Matrix_Scale(frozenScale, frozenScale, frozenScale, MTXMODE_APPLY);
if (bodyPartIndex & 1) {
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
Matrix_RotateYF(M_PIf, MTXMODE_APPLY);
}
if (bodyPartIndex & 2) {
Matrix_RotateZF(M_PI, MTXMODE_APPLY);
Matrix_RotateZF(M_PIf, MTXMODE_APPLY);
}
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
@@ -4984,7 +4984,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0,
((bodyPartIndex * 10 + gameplayFrames) * -20) & 0x1FF, 32, 128));
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
Matrix_RotateYF(M_PIf, MTXMODE_APPLY);
currentMatrix->mf[3][0] = bodyPartsPos->x;
currentMatrix->mf[3][1] = bodyPartsPos->y;
currentMatrix->mf[3][2] = bodyPartsPos->z;
@@ -5026,7 +5026,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
// Apply and draw a light orb over each body part of frozen actor
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
Matrix_RotateZF(Rand_CenteredFloat(2 * M_PI), MTXMODE_APPLY);
Matrix_RotateZF(Rand_CenteredFloat(2 * M_PIf), MTXMODE_APPLY);
currentMatrix->mf[3][0] = bodyPartsPos->x;
currentMatrix->mf[3][1] = bodyPartsPos->y;
currentMatrix->mf[3][2] = bodyPartsPos->z;
@@ -5065,8 +5065,8 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
// Every body part draws two electric sparks at random orientations
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
// first electric spark
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PIf));
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PIf), MTXMODE_APPLY);
currentMatrix->mf[3][0] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->x;
currentMatrix->mf[3][1] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->y;
currentMatrix->mf[3][2] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->z;
@@ -5077,8 +5077,8 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
gSPDisplayList(POLY_XLU_DISP++, gElectricSparkModelDL);
// second electric spark
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PIf));
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PIf), MTXMODE_APPLY);
currentMatrix->mf[3][0] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->x;
currentMatrix->mf[3][1] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->y;
currentMatrix->mf[3][2] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->z;