mirror of
https://github.com/zeldaret/mm.git
synced 2024-11-23 04:49:45 +00:00
Use more TRUNCF_BINANG
for f32 -> s16 casts (#1503)
* TRUNCF_BINANG * brackets * extra cast
This commit is contained in:
parent
ed4da0ecef
commit
5607eec18b
@ -401,9 +401,9 @@ s16 CutsceneCamera_Interp_Linear(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmd
|
||||
|
||||
targetRoll = CAM_DEG_TO_BINANG(miscCmd->roll);
|
||||
|
||||
rollDiffToTarget = (s16)(targetRoll - (s16)interpState->initRoll);
|
||||
rollDiffToTarget = (s16)(targetRoll - TRUNCF_BINANG(interpState->initRoll));
|
||||
|
||||
*camRoll = (s16)interpState->initRoll + (s16)(rollDiffToTarget * lerp);
|
||||
*camRoll = TRUNCF_BINANG(interpState->initRoll) + TRUNCF_BINANG(rollDiffToTarget * lerp);
|
||||
}
|
||||
|
||||
if (interpState->curFrame >= pointCmd->duration) {
|
||||
@ -467,9 +467,9 @@ s16 CutsceneCamera_Interp_Scale(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdC
|
||||
|
||||
targetRoll = CAM_DEG_TO_BINANG(miscCmd->roll);
|
||||
|
||||
rollDiffToTarget = (s16)(targetRoll - (s16)interpState->initRoll);
|
||||
rollDiffToTarget = (s16)(targetRoll - TRUNCF_BINANG(interpState->initRoll));
|
||||
|
||||
*camRoll += (s16)(rollDiffToTarget * lerp);
|
||||
*camRoll += TRUNCF_BINANG(rollDiffToTarget * lerp);
|
||||
}
|
||||
|
||||
if (interpState->curFrame >= pointCmd->duration) {
|
||||
@ -532,9 +532,9 @@ s16 CutsceneCamera_Interp_Geo(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCam
|
||||
|
||||
targetRoll = CAM_DEG_TO_BINANG(miscCmd->roll);
|
||||
|
||||
rollDiffToTarget = (s16)(targetRoll - (s16)interpState->initRoll);
|
||||
rollDiffToTarget = (s16)(targetRoll - TRUNCF_BINANG(interpState->initRoll));
|
||||
|
||||
*camRoll += (s16)(rollDiffToTarget * lerp);
|
||||
*camRoll += TRUNCF_BINANG(rollDiffToTarget * lerp);
|
||||
}
|
||||
|
||||
if (interpState->curFrame >= pointCmd->duration) {
|
||||
|
@ -3570,17 +3570,17 @@ s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32*
|
||||
continue;
|
||||
}
|
||||
|
||||
bgActor->boundingSphere.radius += (s16)radius;
|
||||
bgActor->boundingSphere.radius += TRUNCF_BINANG(radius);
|
||||
|
||||
r = bgActor->boundingSphere.radius;
|
||||
dx = bgActor->boundingSphere.center.x - resultPos.x;
|
||||
dz = bgActor->boundingSphere.center.z - resultPos.z;
|
||||
if ((SQ(r) < SQ(dx) + SQ(dz)) || (!Math3D_XYInSphere(&bgActor->boundingSphere, resultPos.x, resultPos.y) &&
|
||||
!Math3D_YZInSphere(&bgActor->boundingSphere, resultPos.y, resultPos.z))) {
|
||||
bgActor->boundingSphere.radius -= (s16)radius;
|
||||
bgActor->boundingSphere.radius -= TRUNCF_BINANG(radius);
|
||||
continue;
|
||||
}
|
||||
bgActor->boundingSphere.radius -= (s16)radius;
|
||||
bgActor->boundingSphere.radius -= TRUNCF_BINANG(radius);
|
||||
if (BgCheck_SphVsDynaWallInBgActor(colCtx, xpFlags, &colCtx->dyna,
|
||||
&(colCtx->dyna.bgActors + i)->dynaLookup.wall, outX, outZ, outPoly, outBgId,
|
||||
&resultPos, radius, i, actor)) {
|
||||
|
@ -695,7 +695,7 @@ s16 func_800CC260(Camera* camera, Vec3f* arg1, Vec3f* arg2, VecGeo* arg3, Actor*
|
||||
|
||||
sp90.yaw = D_801B9E18[i] + arg3->yaw;
|
||||
rand = Rand_ZeroOne();
|
||||
sp90.pitch = D_801B9E34[i] + (s16)(arg3->pitch * rand);
|
||||
sp90.pitch = D_801B9E34[i] + TRUNCF_BINANG(arg3->pitch * rand);
|
||||
|
||||
if (sp90.pitch > 0x36B0) { // 76.9 degrees
|
||||
sp90.pitch -= 0x3E80; // -87.9 degrees
|
||||
@ -1752,7 +1752,8 @@ s16 Camera_CalcDefaultPitch(Camera* camera, s16 pitch, s16 flatSurfacePitchTarge
|
||||
s16 pitchTarget;
|
||||
|
||||
// if slopePitchAdj is positive, then it is attenuated by a factor of Math_CosS(slopePitchAdj)
|
||||
slopePitchAdjAttenuated = (slopePitchAdj > 0) ? (s16)(Math_CosS(slopePitchAdj) * slopePitchAdj) : slopePitchAdj;
|
||||
slopePitchAdjAttenuated =
|
||||
(slopePitchAdj > 0) ? TRUNCF_BINANG(Math_CosS(slopePitchAdj) * slopePitchAdj) : slopePitchAdj;
|
||||
pitchTarget = flatSurfacePitchTarget - slopePitchAdjAttenuated;
|
||||
|
||||
if (ABS(pitchTarget) < pitchMag) {
|
||||
@ -1801,7 +1802,7 @@ s16 Camera_CalcDefaultYaw(Camera* camera, s16 yaw, s16 target, f32 attenuationYa
|
||||
attenuationSpeedRatio = Camera_QuadraticAttenuation(0.5f, camera->speedRatio);
|
||||
|
||||
yawUpdRate = 1.0f / camera->yawUpdateRateInv;
|
||||
return yaw + (s16)(yawDiffToTarget * attenuationYawDiffAdj * attenuationSpeedRatio * yawUpdRate);
|
||||
return yaw + TRUNCF_BINANG(yawDiffToTarget * attenuationYawDiffAdj * attenuationSpeedRatio * yawUpdRate);
|
||||
}
|
||||
|
||||
void Camera_CalcDefaultSwing(Camera* camera, VecGeo* arg1, VecGeo* arg2, f32 arg3, f32 arg4, SwingAnimation* swing2,
|
||||
@ -2218,14 +2219,14 @@ s32 Camera_Normal1(Camera* camera) {
|
||||
}
|
||||
|
||||
if (!(roData->interfaceFlags & NORMAL1_FLAG_3) || !func_800CB924(camera)) {
|
||||
spB4.yaw = Camera_CalcDefaultYaw(camera, sp9C.yaw, (s16)(focalActorPosRot->rot.y - (s16)(sp72 * sp6C)),
|
||||
roData->unk_14, spC0);
|
||||
spB4.yaw = Camera_CalcDefaultYaw(
|
||||
camera, sp9C.yaw, (s16)(focalActorPosRot->rot.y - TRUNCF_BINANG(sp72 * sp6C)), roData->unk_14, spC0);
|
||||
}
|
||||
|
||||
if (!(roData->interfaceFlags & NORMAL1_FLAG_3) || (camera->speedRatio < 0.01f)) {
|
||||
spB4.pitch = Camera_CalcDefaultPitch(camera, sp9C.pitch,
|
||||
roData->unk_20 + (s16)((roData->unk_20 - sp74.pitch) * sp6C * 0.75f),
|
||||
rwData->unk_08);
|
||||
spB4.pitch = Camera_CalcDefaultPitch(
|
||||
camera, sp9C.pitch, roData->unk_20 + TRUNCF_BINANG((roData->unk_20 - sp74.pitch) * sp6C * 0.75f),
|
||||
rwData->unk_08);
|
||||
}
|
||||
} else if (roData->interfaceFlags & NORMAL1_FLAG_1) {
|
||||
VecGeo sp64;
|
||||
@ -3747,14 +3748,14 @@ s32 Camera_Battle1(Camera* camera) {
|
||||
} else {
|
||||
sp104 = (1.0f - camera->speedRatio) * 0.05f;
|
||||
sp88 = (sp8A >= 0) ? CAM_DEG_TO_BINANG(spFC) : -CAM_DEG_TO_BINANG(spFC);
|
||||
spBC.yaw = atToEyeNextDir.yaw - (s16)((sp88 - sp8A) * sp104);
|
||||
spBC.yaw = atToEyeNextDir.yaw - TRUNCF_BINANG((sp88 - sp8A) * sp104);
|
||||
}
|
||||
|
||||
if (!skipEyeAtCalc) {
|
||||
spF8 = atToTargetDir.pitch * roData->swingPitchAdj;
|
||||
var2 = swingPitchInitial + ((swingPitchFinal - swingPitchInitial) * distRatio);
|
||||
sp8A = CAM_DEG_TO_BINANG(var2) - (s16)((spA4.pitch * (0.5f + (distRatio * (1.0f - 0.5f)))) + 0.5f);
|
||||
sp8A += (s16)spF8;
|
||||
sp8A = CAM_DEG_TO_BINANG(var2) - TRUNCF_BINANG((spA4.pitch * (0.5f + (distRatio * (1.0f - 0.5f)))) + 0.5f);
|
||||
sp8A += TRUNCF_BINANG(spF8);
|
||||
|
||||
if (sp8A < -0x2AA8) {
|
||||
sp8A = -0x2AA8;
|
||||
@ -4101,15 +4102,15 @@ s32 Camera_KeepOn1(Camera* camera) {
|
||||
sp104 = (1.0f - camera->speedRatio) * 0.05f;
|
||||
spF0 = (spF2 >= 0) ? CAM_DEG_TO_BINANG(spFC) : -CAM_DEG_TO_BINANG(spFC);
|
||||
|
||||
spE8.yaw = atToEyeNext.yaw - (s16)((spF0 - spF2) * sp104);
|
||||
spE8.yaw = atToEyeNext.yaw - TRUNCF_BINANG((spF0 - spF2) * sp104);
|
||||
}
|
||||
|
||||
if (!skipEyeAtCalc) {
|
||||
spF2 = CAM_DEG_TO_BINANG(F32_LERPIMP(roData->unk_14, roData->unk_18, sp74));
|
||||
spF2 -= (s16)((spD0.pitch * (0.5f + (sp74 * 0.5f))) + 0.5f);
|
||||
spF2 -= TRUNCF_BINANG((spD0.pitch * (0.5f + (sp74 * 0.5f))) + 0.5f);
|
||||
|
||||
spF8 = spD8.pitch * roData->unk_1C;
|
||||
spF2 += (s16)spF8;
|
||||
spF2 += TRUNCF_BINANG(spF8);
|
||||
|
||||
if (spF2 < -0x3200) {
|
||||
spF2 = -0x3200;
|
||||
@ -4316,7 +4317,7 @@ s32 Camera_KeepOn3(Camera* camera) {
|
||||
}
|
||||
|
||||
swingAngle = LERPIMP(roData->unk_14, roData->unk_18, phi_f14);
|
||||
sp98.pitch = CAM_DEG_TO_BINANG(swingAngle) + ((s16) - (spA0.pitch * roData->unk_1C));
|
||||
sp98.pitch = CAM_DEG_TO_BINANG(swingAngle) + TRUNCF_BINANG(-(spA0.pitch * roData->unk_1C));
|
||||
swingAngle = LERPIMP(roData->unk_0C, roData->unk_10, phi_f14);
|
||||
|
||||
phi_a3 = CAM_DEG_TO_BINANG(swingAngle);
|
||||
@ -4424,8 +4425,8 @@ s32 Camera_KeepOn3(Camera* camera) {
|
||||
at->z += (rwData->unk_10.z - at->z) / timer;
|
||||
|
||||
sp98.r = (rwData->unk_00 * timer) + sp80.r + 1.0f;
|
||||
sp98.yaw = sp80.yaw + (s16)(rwData->unk_04 * timer);
|
||||
sp98.pitch = sp80.pitch + (s16)(rwData->unk_08 * timer);
|
||||
sp98.yaw = sp80.yaw + TRUNCF_BINANG(rwData->unk_04 * timer);
|
||||
sp98.pitch = sp80.pitch + TRUNCF_BINANG(rwData->unk_08 * timer);
|
||||
*eyeNext = OLib_AddVecGeoToVec3f(at, &sp98);
|
||||
*eye = *eyeNext;
|
||||
camera->fov = Camera_ScaledStepToCeilF(roData->unk_20, camera->fov, 0.5f, 0.1f);
|
||||
@ -4704,8 +4705,8 @@ s32 Camera_KeepOn4(Camera* camera) {
|
||||
|
||||
if (rwData->timer != 0) {
|
||||
Camera_SetStateFlag(camera, CAM_STATE_DISABLE_MODE_CHANGE);
|
||||
rwData->unk_10 += (s16)rwData->unk_00;
|
||||
rwData->unk_12 += (s16)rwData->unk_04;
|
||||
rwData->unk_10 += TRUNCF_BINANG(rwData->unk_00);
|
||||
rwData->unk_12 += TRUNCF_BINANG(rwData->unk_04);
|
||||
rwData->timer--;
|
||||
} else {
|
||||
Camera_SetStateFlag(camera, CAM_STATE_10 | CAM_STATE_4);
|
||||
@ -6635,9 +6636,9 @@ s32 Camera_Special5(Camera* camera) {
|
||||
spA4 = BINANG_SUB(focalActorPosRot->rot.y, sp6C.yaw);
|
||||
sp74.r = roData->eyeDist;
|
||||
rand = Rand_ZeroOne();
|
||||
sp74.yaw =
|
||||
BINANG_ROT180(focalActorPosRot->rot.y) +
|
||||
(s16)((spA4 < 0) ? -(s16)(0x1553 + (s16)(rand * 2730.0f)) : (s16)(0x1553 + (s16)(rand * 2730.0f)));
|
||||
sp74.yaw = BINANG_ROT180(focalActorPosRot->rot.y) +
|
||||
(s16)((spA4 < 0) ? -(s16)(0x1553 + TRUNCF_BINANG(rand * 2730.0f))
|
||||
: (s16)(0x1553 + TRUNCF_BINANG(rand * 2730.0f)));
|
||||
sp74.pitch = roData->pitch;
|
||||
*eyeNext = OLib_AddVecGeoToVec3f(&spA8.pos, &sp74);
|
||||
*eye = *eyeNext;
|
||||
@ -6839,8 +6840,8 @@ s32 Camera_Special9(Camera* camera) {
|
||||
s16 camEyeSide;
|
||||
s16 randFloat;
|
||||
|
||||
spB0.pitch = ((s16)(Rand_ZeroOne() * 0x280) + 0xBB8);
|
||||
randFloat = ((s16)(Rand_ZeroOne() * 0x4CE) + 0x5DC);
|
||||
spB0.pitch = TRUNCF_BINANG(Rand_ZeroOne() * 0x280) + 0xBB8;
|
||||
randFloat = TRUNCF_BINANG(Rand_ZeroOne() * 0x4CE) + 0x5DC;
|
||||
|
||||
// The camera will either position itself either to the left or to the right
|
||||
// of the door when it jumps behind it. It's effectively 50/50 percent chance
|
||||
|
@ -415,7 +415,7 @@ void func_800A6780(EnItem00* this, PlayState* play) {
|
||||
if (this->actor.velocity.y < -1.5f) {
|
||||
this->actor.velocity.y = -1.5f;
|
||||
}
|
||||
this->actor.home.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f);
|
||||
this->actor.home.rot.z += TRUNCF_BINANG((this->actor.velocity.y + 3.0f) * 1000.0f);
|
||||
this->actor.world.pos.x +=
|
||||
(Math_CosS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z)));
|
||||
this->actor.world.pos.z +=
|
||||
|
@ -76,7 +76,7 @@ s32 Math_ScaledStepToS(s16* pValue, s16 target, s16 step) {
|
||||
step = -step;
|
||||
}
|
||||
|
||||
*pValue += (s16)(step * f0);
|
||||
*pValue += TRUNCF_BINANG(step * f0);
|
||||
|
||||
if (((s16)(*pValue - target) * step) >= 0) {
|
||||
*pValue = target;
|
||||
|
@ -1457,16 +1457,16 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) {
|
||||
switch (character) {
|
||||
case 0x8169:
|
||||
case 0x8175:
|
||||
msgCtx->textPosX -= (s16)(6.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX -= TRUNCF_BINANG(6.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8145:
|
||||
msgCtx->textPosX -= (s16)(3.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX -= TRUNCF_BINANG(3.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8148:
|
||||
case 0x8149:
|
||||
msgCtx->textPosX -= (s16)(2.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX -= TRUNCF_BINANG(2.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1494,34 +1494,34 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) {
|
||||
charTexIndex += FONT_CHAR_TEX_SIZE;
|
||||
switch (character) {
|
||||
case 0x8144:
|
||||
msgCtx->textPosX += (s16)(8.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(8.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x816A:
|
||||
case 0x8176:
|
||||
msgCtx->textPosX += (s16)(10.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(10.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8141:
|
||||
case 0x8142:
|
||||
case 0x8168:
|
||||
msgCtx->textPosX += (s16)(12.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(12.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8194:
|
||||
msgCtx->textPosX += (s16)(14.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(14.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8145:
|
||||
msgCtx->textPosX += (s16)(15.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(15.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
default:
|
||||
if ((msgCtx->msgMode >= MSGMODE_SCENE_TITLE_CARD_FADE_IN_BACKGROUND) &&
|
||||
(msgCtx->msgMode <= MSGMODE_SCENE_TITLE_CARD_FADE_OUT_BACKGROUND)) {
|
||||
msgCtx->textPosX += (s16)((16.0f * msgCtx->textCharScale) - 1.0f);
|
||||
msgCtx->textPosX += TRUNCF_BINANG((16.0f * msgCtx->textCharScale) - 1.0f);
|
||||
} else {
|
||||
msgCtx->textPosX += (s16)(16.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(16.0f * msgCtx->textCharScale);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -2200,7 +2200,7 @@ void Message_Decode(PlayState* play) {
|
||||
msgCtx->unk11FFA = msgCtx->textboxY + 6;
|
||||
msgCtx->unk11F1A[spD2] = 0;
|
||||
if (msgCtx->unk11F18 == 0) {
|
||||
msgCtx->unk11F1A[spD2] = (s16)((msgCtx->textCharScale * 16.0f * 16.0f) - spC0) / 2;
|
||||
msgCtx->unk11F1A[spD2] = TRUNCF_BINANG((msgCtx->textCharScale * 16.0f * 16.0f) - spC0) / 2;
|
||||
}
|
||||
spC0 = 0.0f;
|
||||
if (curChar == 0xB) {
|
||||
|
@ -825,16 +825,16 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
|
||||
switch (character) {
|
||||
case 0x8169:
|
||||
case 0x8175:
|
||||
msgCtx->textPosX -= (s16)(6.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX -= TRUNCF_BINANG(6.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8145:
|
||||
msgCtx->textPosX -= (s16)(3.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX -= TRUNCF_BINANG(3.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8148:
|
||||
case 0x8149:
|
||||
msgCtx->textPosX -= (s16)(2.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX -= TRUNCF_BINANG(2.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -866,26 +866,26 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
|
||||
//! @TODO: u8 character but > 0x255 cases
|
||||
switch (character) {
|
||||
case 0x8144:
|
||||
msgCtx->textPosX += (s16)(8.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(8.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x816A:
|
||||
case 0x8176:
|
||||
msgCtx->textPosX += (s16)(10.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(10.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8141:
|
||||
case 0x8142:
|
||||
case 0x8168:
|
||||
msgCtx->textPosX += (s16)(12.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(12.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8194:
|
||||
msgCtx->textPosX += (s16)(14.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(14.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
case 0x8145:
|
||||
msgCtx->textPosX += (s16)(15.0f * msgCtx->textCharScale);
|
||||
msgCtx->textPosX += TRUNCF_BINANG(15.0f * msgCtx->textCharScale);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -998,7 +998,7 @@ void Message_DecodeNES(PlayState* play) {
|
||||
}
|
||||
msgCtx->unk11F1A[spC6] = 0;
|
||||
if (msgCtx->unk11F18 != 0) {
|
||||
msgCtx->unk11F1A[spC6] = (s16)((msgCtx->textCharScale * 16.0f * 16.0f) - spA4) / 2;
|
||||
msgCtx->unk11F1A[spC6] = TRUNCF_BINANG((msgCtx->textCharScale * 16.0f * 16.0f) - spA4) / 2;
|
||||
}
|
||||
|
||||
spA4 = 0.0f;
|
||||
|
@ -4601,7 +4601,7 @@ void Interface_DrawClock(PlayState* play) {
|
||||
}
|
||||
|
||||
timeInSeconds = TIME_TO_SECONDS_F(CURRENT_TIME);
|
||||
timeInSeconds -= ((s16)(timeInSeconds / 3600.0f)) * 3600.0f;
|
||||
timeInSeconds -= TRUNCF_BINANG(timeInSeconds / 3600.0f) * 3600.0f;
|
||||
|
||||
Gfx_SetupDL42_Overlay(play->state.gfxCtx);
|
||||
|
||||
|
@ -1895,8 +1895,8 @@ void func_80124F18(s16* arg0, f32* arg1, s16 arg2, f32 arg3, f32 arg4) {
|
||||
}
|
||||
|
||||
*arg1 = CLAMP(*arg1, -arg4, arg4);
|
||||
*arg0 += (s16)*arg1;
|
||||
if (((arg2 - *arg0) * (s16)*arg1) < 0) {
|
||||
*arg0 += TRUNCF_BINANG(*arg1);
|
||||
if (((arg2 - *arg0) * TRUNCF_BINANG(*arg1)) < 0) {
|
||||
*arg0 = arg2;
|
||||
}
|
||||
}
|
||||
@ -2168,7 +2168,7 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
|
||||
rotX = player->upperLimbRot.x;
|
||||
if ((player->transformation == PLAYER_FORM_DEKU) && (player->stateFlags3 & PLAYER_STATE3_40)) {
|
||||
if (player->heldActor != NULL) {
|
||||
rotX += (s16)(((EnArrow*)(player->heldActor))->bubble.unk_144 * -470.0f);
|
||||
rotX += TRUNCF_BINANG(((EnArrow*)(player->heldActor))->bubble.unk_144 * -470.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ QuakeRequest* Quake_RequestImpl(Camera* camera, u32 type) {
|
||||
|
||||
// Add a unique random identifier to the upper bits of the index
|
||||
// The `~3` assumes there are only 4 requests
|
||||
req->index = index + ((s16)(Rand_ZeroOne() * 0x10000) & ~3);
|
||||
req->index = index + (TRUNCF_BINANG(Rand_ZeroOne() * 0x10000) & ~3);
|
||||
|
||||
sQuakeRequestCount++;
|
||||
|
||||
|
@ -944,13 +944,13 @@ void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s*
|
||||
for (i = 0; i < limbCount; i++, dst++, start++, target++) {
|
||||
base = start->x;
|
||||
diff = target->x - base;
|
||||
dst->x = (s16)(diff * weight) + base;
|
||||
dst->x = TRUNCF_BINANG(diff * weight) + base;
|
||||
base = start->y;
|
||||
diff = target->y - base;
|
||||
dst->y = (s16)(diff * weight) + base;
|
||||
dst->y = TRUNCF_BINANG(diff * weight) + base;
|
||||
base = start->z;
|
||||
diff = target->z - base;
|
||||
dst->z = (s16)(diff * weight) + base;
|
||||
dst->z = TRUNCF_BINANG(diff * weight) + base;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < limbCount; i++, dst++, target++) {
|
||||
|
@ -171,8 +171,8 @@ s32 Snap_ValidatePictograph(PlayState* play, Actor* actor, s32 flag, Vec3f* pos,
|
||||
// Check in capture region
|
||||
Actor_GetProjectedPos(play, pos, &projectedPos, &distance);
|
||||
// Convert to projected position to device coordinates, shift to be relative to the capture region's top-left corner
|
||||
x = (s16)PROJECTED_TO_SCREEN_X(projectedPos, distance) - PICTO_VALID_TOPLEFT_X;
|
||||
y = (s16)PROJECTED_TO_SCREEN_Y(projectedPos, distance) - PICTO_VALID_TOPLEFT_Y;
|
||||
x = TRUNCF_BINANG(PROJECTED_TO_SCREEN_X(projectedPos, distance)) - PICTO_VALID_TOPLEFT_X;
|
||||
y = TRUNCF_BINANG(PROJECTED_TO_SCREEN_Y(projectedPos, distance)) - PICTO_VALID_TOPLEFT_Y;
|
||||
|
||||
// checks if the coordinates are within the capture region
|
||||
if ((x < 0) || (x > PICTO_VALID_WIDTH) || (y < 0) || (y > PICTO_VALID_HEIGHT)) {
|
||||
|
@ -589,8 +589,8 @@ s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex) {
|
||||
Path* SubS_GetDayDependentPath(PlayState* play, u8 pathIndex, u8 pathIndexNone, s32* startPointIndex) {
|
||||
Path* path = NULL;
|
||||
s32 found = false;
|
||||
s16 time1 = TIME_TO_MINUTES_F(CURRENT_TIME);
|
||||
s16 time2 = TIME_TO_MINUTES_F(CURRENT_TIME);
|
||||
s16 time1 = TRUNCF_BINANG(TIME_TO_MINUTES_F(CURRENT_TIME));
|
||||
s16 time2 = TRUNCF_BINANG(TIME_TO_MINUTES_F(CURRENT_TIME));
|
||||
s32 time = ((time1 % 60) + (time2 / 60) * 60) / 30;
|
||||
s32 day = CURRENT_DAY;
|
||||
|
||||
|
@ -133,7 +133,7 @@ void BgNumaHana_UpdatePetalPosRots(BgNumaHana* this) {
|
||||
void BgNumaHana_UpdateSettleRotation(s16* settleRotZ, s16* settleAngle, f32* settleScale, f32 scaleStep) {
|
||||
*settleAngle += 0x32C8;
|
||||
Math_StepToF(settleScale, 0.0f, scaleStep);
|
||||
*settleRotZ += (s16)(Math_SinS(*settleAngle) * *settleScale);
|
||||
*settleRotZ += TRUNCF_BINANG(Math_SinS(*settleAngle) * *settleScale);
|
||||
}
|
||||
|
||||
void BgNumaHana_Init(Actor* thisx, PlayState* play) {
|
||||
|
@ -1574,11 +1574,13 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
|
||||
this->actor.speed = ((Rand_ZeroFloat(5.0f) + 2.5f) * sp64) + 2.5f;
|
||||
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
this->shapeRotTargetX = ((s16)(s32)Rand_CenteredFloat(0x1F4) + this->shapeRotTargetX) + 0x8000;
|
||||
this->shapeRotTargetX =
|
||||
(TRUNCF_BINANG(Rand_CenteredFloat(0x1F4)) + this->shapeRotTargetX) + 0x8000;
|
||||
}
|
||||
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
this->shapeRotTargetZ = ((s16)(s32)Rand_CenteredFloat(0x1F4) + this->shapeRotTargetZ) + 0x8000;
|
||||
this->shapeRotTargetZ =
|
||||
(TRUNCF_BINANG(Rand_CenteredFloat(0x1F4)) + this->shapeRotTargetZ) + 0x8000;
|
||||
}
|
||||
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
@ -2488,8 +2490,8 @@ void Boss03_DrawEffects(PlayState* play) {
|
||||
flag++;
|
||||
}
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s16)eff->unk_40, ((void)0, ((s16)eff->unk_40) + 55), 225,
|
||||
eff->alpha);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, TRUNCF_BINANG(eff->unk_40),
|
||||
((void)0, TRUNCF_BINANG(eff->unk_40) + 55), 225, eff->alpha);
|
||||
|
||||
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
|
||||
|
||||
|
@ -475,7 +475,7 @@ void func_809ECF58(Boss04* this, PlayState* play) {
|
||||
this->unk_2D0 = 10000.0f;
|
||||
this->unk_2C8 = 100;
|
||||
} else {
|
||||
this->actor.world.rot.y = BINANG_ROT180((s16)Rand_ZeroFloat(8000.0f) + this->actor.world.rot.y);
|
||||
this->actor.world.rot.y = BINANG_ROT180(TRUNCF_BINANG(Rand_ZeroFloat(8000.0f)) + this->actor.world.rot.y);
|
||||
}
|
||||
|
||||
this->actor.speed = 0.0f;
|
||||
@ -784,15 +784,15 @@ s32 Boss04_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
}
|
||||
|
||||
if ((limbIndex == WART_LIMB_TOP_EYELID_ROOT) || (limbIndex == WART_LIMB_BOTTOM_EYELID_ROOT)) {
|
||||
rot->y = (rot->y + (s16)this->unk_2CC) - 0x500;
|
||||
rot->y = (rot->y + TRUNCF_BINANG(this->unk_2CC)) - 0x500;
|
||||
}
|
||||
|
||||
if (limbIndex == WART_LIMB_EYE) {
|
||||
rot->y += this->unk_2D8;
|
||||
rot->z += this->unk_2D4;
|
||||
if (this->unk_2DA != 0) {
|
||||
rot->y = (s16)(Math_SinS(this->unk_1F4 * 0x3000) * (this->unk_2DA * 500)) + rot->y;
|
||||
rot->z = (s16)(Math_SinS(this->unk_1F4 * 0x3500) * (this->unk_2DA * 300)) + rot->z;
|
||||
rot->y = TRUNCF_BINANG(Math_SinS(this->unk_1F4 * 0x3000) * (this->unk_2DA * 500)) + rot->y;
|
||||
rot->z = TRUNCF_BINANG(Math_SinS(this->unk_1F4 * 0x3500) * (this->unk_2DA * 300)) + rot->z;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -527,16 +527,16 @@ void Boss06_Draw(Actor* thisx, PlayState* play2) {
|
||||
temp_f10 = (Math_CosS(D_809F4970->unk_144) * -2000.0f) - 2000.0f;
|
||||
temp_v0_2 = SEGMENTED_TO_K0(&object_knight_Vtx_018BD0);
|
||||
|
||||
temp_v0_2[0].v.ob[1] = (s16)this->unk_1A0 + 0xE92;
|
||||
temp_v0_2[3].v.ob[1] = (s16)this->unk_1A0 + 0xE92;
|
||||
temp_v0_2[4].v.ob[1] = (s16)this->unk_1A0 + 0xE92;
|
||||
temp_v0_2[7].v.ob[1] = (s16)this->unk_1A0 + 0xE92;
|
||||
temp_v0_2[0].v.ob[1] = TRUNCF_BINANG(this->unk_1A0) + 0xE92;
|
||||
temp_v0_2[3].v.ob[1] = TRUNCF_BINANG(this->unk_1A0) + 0xE92;
|
||||
temp_v0_2[4].v.ob[1] = TRUNCF_BINANG(this->unk_1A0) + 0xE92;
|
||||
temp_v0_2[7].v.ob[1] = TRUNCF_BINANG(this->unk_1A0) + 0xE92;
|
||||
|
||||
temp_v0_2[5].v.ob[0] = temp_s0 + 0x2A3;
|
||||
temp_v0_2[5].v.ob[2] = (temp_f10 + (s16)this->unk_1A4) - 0x708;
|
||||
temp_v0_2[5].v.ob[2] = (temp_f10 + TRUNCF_BINANG(this->unk_1A4)) - 0x708;
|
||||
|
||||
temp_v0_2[6].v.ob[0] = temp_s0 - 0x2A3;
|
||||
temp_v0_2[6].v.ob[2] = (temp_f10 + (s16)this->unk_1A4) - 0x708;
|
||||
temp_v0_2[6].v.ob[2] = (temp_f10 + TRUNCF_BINANG(this->unk_1A4)) - 0x708;
|
||||
|
||||
temp_v0_2[9].v.ob[0] = temp_s0 + 0x2A3;
|
||||
temp_v0_2[9].v.ob[2] = temp_f10 - 0x1C2;
|
||||
|
@ -122,11 +122,11 @@ void DemoKakyo_LostWoodsSparkleActionFunc(DemoKankyo* this, PlayState* play) {
|
||||
// This block is also init code and only runs once
|
||||
if (i < 32) {
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
this->effects[i].LostWoodsSkyFishSpeedXZ = (s16)(Rand_ZeroOne() * 200.0f) + 200;
|
||||
this->effects[i].LostWoodsSkyFishSpeedXZ = TRUNCF_BINANG(Rand_ZeroOne() * 200.0f) + 200;
|
||||
} else {
|
||||
this->effects[i].LostWoodsSkyFishSpeedXZ = -200 - (s16)(Rand_ZeroOne() * 200.0f);
|
||||
this->effects[i].LostWoodsSkyFishSpeedXZ = -200 - TRUNCF_BINANG(Rand_ZeroOne() * 200.0f);
|
||||
}
|
||||
this->effects[i].LostWoodsSkyFishPosOffsetMax = (s16)(Rand_ZeroOne() * 50.0f) + 15;
|
||||
this->effects[i].LostWoodsSkyFishPosOffsetMax = TRUNCF_BINANG(Rand_ZeroOne() * 50.0f) + 15;
|
||||
this->effects[i].LostWoodsSkyFishSpeedY = ((Rand_ZeroOne() * 10.0f) + 10.0f) * 0.01f;
|
||||
|
||||
// Only the 31st particle matters as sLostWoodsSkyFishParticleNum will be overwritten
|
||||
|
@ -529,13 +529,13 @@ void DmChar01_Draw(Actor* thisx, PlayState* play) {
|
||||
sp44.x = (Rand_ZeroOne() - 0.5f) * (2.0f * phi_f2);
|
||||
sp44.y = D_80AAAAB8;
|
||||
sp44.z = (Rand_ZeroOne() * D_80AAAAC4) + phi_f2;
|
||||
temp = (s16)spBC + D_80AAAACC;
|
||||
temp = TRUNCF_BINANG(spBC) + D_80AAAACC;
|
||||
EffectSsGSplash_Spawn(play, &sp44, NULL, NULL, 0, temp);
|
||||
} else {
|
||||
sp44.x = -phi_f2 - (Rand_ZeroOne() * D_80AAAAC4);
|
||||
sp44.y = D_80AAAAB8;
|
||||
sp44.z = (Rand_ZeroOne() - 0.5f) * (2.0f * phi_f2);
|
||||
temp = (s16)spBC + D_80AAAACC;
|
||||
temp = TRUNCF_BINANG(spBC) + D_80AAAACC;
|
||||
EffectSsGSplash_Spawn(play, &sp44, NULL, NULL, 0, temp);
|
||||
}
|
||||
}
|
||||
|
@ -986,8 +986,9 @@ void func_808BAE9C(DoorWarp1* this, PlayState* play) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x0A, Matrix_NewMtx(play->state.gfxCtx));
|
||||
Matrix_Push();
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, sp94 & 0xFF, -((s16)(2.0f * this->unk_1AC) & 0x1FF), 0x100,
|
||||
0x100, 1, sp94 & 0xFF, -((s16)(2.0f * this->unk_1AC) & 0x1FF), 0x100, 0x100));
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, sp94 & 0xFF, -(TRUNCF_BINANG(2.0f * this->unk_1AC) & 0x1FF),
|
||||
0x100, 0x100, 1, sp94 & 0xFF, -(TRUNCF_BINANG(2.0f * this->unk_1AC) & 0x1FF), 0x100,
|
||||
0x100));
|
||||
|
||||
Matrix_Translate(0.0f, this->unk_1A4 * 230.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(((this->unk_1C6 * sp90) / 100.0f) + 1.0f, 1.0f, ((this->unk_1C6 * sp90) / 100.0f) + 1.0f,
|
||||
@ -1004,8 +1005,8 @@ void func_808BAE9C(DoorWarp1* this, PlayState* play) {
|
||||
|
||||
sp94 *= 2;
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, sp94 & 0xFF, -((s16)this->unk_1AC & 0x1FF), 0x100, 0x100, 1,
|
||||
sp94 & 0xFF, -((s16)this->unk_1AC & 0x1FF), 0x100, 0x100));
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, sp94 & 0xFF, -(TRUNCF_BINANG(this->unk_1AC) & 0x1FF), 0x100,
|
||||
0x100, 1, sp94 & 0xFF, -(TRUNCF_BINANG(this->unk_1AC) & 0x1FF), 0x100, 0x100));
|
||||
|
||||
Matrix_Translate(0.0f, this->unk_1A8 * 60.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(((this->unk_1C8 * sp8C) / 100.0f) + 1.0f, 1.0f, ((this->unk_1C8 * sp8C) / 100.0f) + 1.0f,
|
||||
|
@ -1189,8 +1189,8 @@ s32 EnAob01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
|
||||
if ((limbIndex == MAMAMU_YAN_LIMB_TORSO) || (limbIndex == MAMAMU_YAN_LIMB_LEFT_UPPER_ARM) ||
|
||||
(limbIndex == MAMAMU_YAN_LIMB_RIGHT_UPPER_ARM)) {
|
||||
rot->y += (s16)Math_SinS(this->fidgetTableY[limbIndex]) * 200;
|
||||
rot->z += (s16)Math_CosS(this->fidgetTableZ[limbIndex]) * 200;
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[limbIndex])) * 200;
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[limbIndex])) * 200;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -383,7 +383,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
|
||||
(this->collider.base.atFlags & AT_BOUNCED)) {
|
||||
if ((this->collider.base.at != NULL) && (this->collider.base.at->id != ACTOR_OBJ_SYOKUDAI)) {
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos);
|
||||
this->actor.world.rot.y += BINANG_ROT180((s16)(s32)Rand_CenteredFloat(0x1F40));
|
||||
this->actor.world.rot.y += BINANG_ROT180(TRUNCF_BINANG(Rand_CenteredFloat(0x1F40)));
|
||||
this->actor.velocity.y = -this->actor.velocity.y;
|
||||
this->bubble.unk_149 = -1;
|
||||
return;
|
||||
@ -485,12 +485,12 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
|
||||
if (Math_StepToF(&this->bubble.unk_144, 1.0f, 0.4f)) {
|
||||
this->unk_260 = 0;
|
||||
} else {
|
||||
this->bubble.unk_14A += (s16)(this->bubble.unk_144 * (500.0f + Rand_ZeroFloat(1400.0f)));
|
||||
this->actor.world.rot.x += (s16)(500.0f * Math_SinS(this->bubble.unk_14A));
|
||||
this->bubble.unk_14A += TRUNCF_BINANG(this->bubble.unk_144 * (500.0f + Rand_ZeroFloat(1400.0f)));
|
||||
this->actor.world.rot.x += TRUNCF_BINANG(500.0f * Math_SinS(this->bubble.unk_14A));
|
||||
this->actor.shape.rot.x = this->actor.world.rot.x;
|
||||
|
||||
this->bubble.unk_14C += (s16)(this->bubble.unk_144 * (500.0f + Rand_ZeroFloat(1400.0f)));
|
||||
this->actor.world.rot.y += (s16)(500.0f * Math_SinS(this->bubble.unk_14C));
|
||||
this->bubble.unk_14C += TRUNCF_BINANG(this->bubble.unk_144 * (500.0f + Rand_ZeroFloat(1400.0f)));
|
||||
this->actor.world.rot.y += TRUNCF_BINANG(500.0f * Math_SinS(this->bubble.unk_14C));
|
||||
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
|
||||
|
@ -425,23 +425,23 @@ s32 EnAttackNiw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve
|
||||
EnAttackNiw* this = THIS;
|
||||
|
||||
if (limbIndex == NIW_LIMB_UPPER_BODY) {
|
||||
rot->y += (s16)this->upperBodyRotY;
|
||||
rot->y += TRUNCF_BINANG(this->upperBodyRotY);
|
||||
}
|
||||
|
||||
if (limbIndex == NIW_LIMB_HEAD) {
|
||||
rot->z += (s16)this->headRotZ;
|
||||
rot->z += TRUNCF_BINANG(this->headRotZ);
|
||||
}
|
||||
|
||||
if (limbIndex == NIW_LIMB_RIGHT_WING_ROOT) {
|
||||
rot->x += (s16)this->rightWingRotX;
|
||||
rot->y += (s16)this->rightWingRotY;
|
||||
rot->z += (s16)this->rightWingRotZ;
|
||||
rot->x += TRUNCF_BINANG(this->rightWingRotX);
|
||||
rot->y += TRUNCF_BINANG(this->rightWingRotY);
|
||||
rot->z += TRUNCF_BINANG(this->rightWingRotZ);
|
||||
}
|
||||
|
||||
if (limbIndex == NIW_LIMB_LEFT_WING_ROOT) {
|
||||
rot->x += (s16)this->leftWingRotX;
|
||||
rot->y += (s16)this->leftWingRotY;
|
||||
rot->z += (s16)this->leftWingRotZ;
|
||||
rot->x += TRUNCF_BINANG(this->leftWingRotX);
|
||||
rot->y += TRUNCF_BINANG(this->leftWingRotY);
|
||||
rot->z += TRUNCF_BINANG(this->leftWingRotZ);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -785,8 +785,8 @@ s32 EnBaba_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
|
||||
if ((limbIndex == BBA_LIMB_UPPER_ROOT) || (limbIndex == BBA_LIMB_LEFT_UPPER_ARM) ||
|
||||
(limbIndex == BBA_LIMB_RIGHT_UPPER_ARM)) {
|
||||
rot->y += (s16)(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f);
|
||||
}
|
||||
|
||||
if (((this->animIndex == BOMB_SHOP_LADY_ANIM_IDLE) || (this->animIndex == BOMB_SHOP_LADY_ANIM_KNOCKED_OVER) ||
|
||||
|
@ -256,13 +256,13 @@ void EnBaguo_Roll(EnBaguo* this, PlayState* play) {
|
||||
Math_ApproachF(&this->currentRotation.x, this->targetRotation.x, 0.2f, 1000.0f);
|
||||
Math_ApproachF(&this->currentRotation.z, this->targetRotation.z, 0.2f, 1000.0f);
|
||||
Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 0.5f);
|
||||
this->actor.world.rot.x += (s16)this->currentRotation.x;
|
||||
this->actor.world.rot.x += TRUNCF_BINANG(this->currentRotation.x);
|
||||
|
||||
if (this->currentRotation.z != 0.0f) {
|
||||
if (this->zRollDirection == NEJIRON_DIRECTION_RIGHT) {
|
||||
this->actor.world.rot.z += (s16)this->currentRotation.z;
|
||||
this->actor.world.rot.z += TRUNCF_BINANG(this->currentRotation.z);
|
||||
} else {
|
||||
this->actor.world.rot.z -= (s16)this->currentRotation.z;
|
||||
this->actor.world.rot.z -= TRUNCF_BINANG(this->currentRotation.z);
|
||||
}
|
||||
}
|
||||
|
||||
@ -450,9 +450,9 @@ void EnBaguo_InitializeEffect(EnBaguo* this, Vec3f* pos, Vec3f* velocity, Vec3f*
|
||||
effect->accel = *accel;
|
||||
effect->scale = scale;
|
||||
effect->timer = timer;
|
||||
effect->rot.x = (s16)(s32)Rand_CenteredFloat(0x7530);
|
||||
effect->rot.y = (s16)(s32)Rand_CenteredFloat(0x7530);
|
||||
effect->rot.z = (s16)(s32)Rand_CenteredFloat(0x7530);
|
||||
effect->rot.x = TRUNCF_BINANG(Rand_CenteredFloat(0x7530));
|
||||
effect->rot.y = TRUNCF_BINANG(Rand_CenteredFloat(0x7530));
|
||||
effect->rot.z = TRUNCF_BINANG(Rand_CenteredFloat(0x7530));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -289,8 +289,8 @@ s32 EnBba01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
}
|
||||
|
||||
if ((limbIndex == BBA_LIMB_BAG) || (limbIndex == BBA_LIMB_TORSO) || (limbIndex == BBA_LIMB_LEFT_FOREARM)) {
|
||||
rot->y += (s16)(Math_SinS(this->enHy.fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->enHy.fidgetTableZ[limbIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->enHy.fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->enHy.fidgetTableZ[limbIndex]) * 200.0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -325,7 +325,7 @@ void EnBbfall_Fly(EnBbfall* this, PlayState* play) {
|
||||
// Bounce upwards off the ground
|
||||
this->actor.velocity.y *= -1.2f;
|
||||
this->actor.velocity.y = CLAMP(this->actor.velocity.y, 8.0f, 12.0f);
|
||||
this->actor.shape.rot.y += (s16)(s32)Rand_CenteredFloat(0x12000);
|
||||
this->actor.shape.rot.y += TRUNCF_BINANG(Rand_CenteredFloat(0x12000));
|
||||
}
|
||||
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
|
@ -575,7 +575,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
|
||||
gDPSetEnvColor((*gfx)++, envColor, envColor, envColor, envColor);
|
||||
|
||||
if (this->actionFunc == EnBigokuta_SuckInPlayer) {
|
||||
rotX = (s16)(this->timer * 6144.0f * (1 / 9.0f));
|
||||
rotX = TRUNCF_BINANG(this->timer * 6144.0f * (1 / 9.0f));
|
||||
rot->x -= rotX;
|
||||
} else if (this->actionFunc == EnBigokuta_HoldPlayer) {
|
||||
if (this->timer == 1) {
|
||||
|
@ -1435,7 +1435,7 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, PlayState* play) {
|
||||
fireRadius = 500;
|
||||
} else {
|
||||
Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY);
|
||||
fireRadius = (s16)(thisx->scale.x * 500.0f * 100.0f);
|
||||
fireRadius = TRUNCF_BINANG(thisx->scale.x * 500.0f * 100.0f);
|
||||
}
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (play->gameplayFrames * -20) % 512, 0x20,
|
||||
|
@ -1325,7 +1325,7 @@ void EnBigslime_SetTargetVtxToThinCone(EnBigslime* this) {
|
||||
targetVtx = &sBigslimeTargetVtx[j];
|
||||
targetVtx->n.ob[0] = staticVtx->n.ob[0];
|
||||
targetVtx->n.ob[2] = staticVtx->n.ob[2];
|
||||
targetVtxY = (s16)(((lowerSphereCos * 0.05f) + -1.0f) * BIGSLIME_RADIUS_F);
|
||||
targetVtxY = TRUNCF_BINANG(((lowerSphereCos * 0.05f) + -1.0f) * BIGSLIME_RADIUS_F);
|
||||
targetVtx->n.ob[1] = targetVtxY;
|
||||
}
|
||||
}
|
||||
@ -1368,7 +1368,7 @@ void EnBigslime_SetTargetVtxToInverseCone(EnBigslime* this) {
|
||||
targetVtx = &sBigslimeTargetVtx[j];
|
||||
targetVtx->n.ob[0] = staticVtx->n.ob[0];
|
||||
targetVtx->n.ob[2] = staticVtx->n.ob[2];
|
||||
vtxY = (s16)(((upperSphereCos * 0.1f) + 0.9f) * BIGSLIME_RADIUS_F);
|
||||
vtxY = TRUNCF_BINANG(((upperSphereCos * 0.1f) + 0.9f) * BIGSLIME_RADIUS_F);
|
||||
targetVtx->n.ob[1] = vtxY;
|
||||
}
|
||||
}
|
||||
@ -1550,7 +1550,7 @@ void EnBigslime_CutsceneGrabPlayer(EnBigslime* this, PlayState* play) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
// Linearly interpolate dynamicVtx --> staticVtx
|
||||
dynamicVtx->n.ob[j] +=
|
||||
(s16)((sBigslimeStaticVtx[i].n.ob[j] - dynamicVtx->n.ob[j]) * invgrabPlayerTimer);
|
||||
TRUNCF_BINANG((sBigslimeStaticVtx[i].n.ob[j] - dynamicVtx->n.ob[j]) * invgrabPlayerTimer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1697,7 +1697,7 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) {
|
||||
player->actor.world.pos.y = this->actor.world.pos.y + (this->actor.scale.y * -500.0f);
|
||||
|
||||
// Linearly interpolate gekkoRot.y --> this->actor.world.rot.y
|
||||
this->gekkoRot.y += (s16)((s16)(this->actor.world.rot.y - this->gekkoRot.y) * invWindupPunchTimer);
|
||||
this->gekkoRot.y += TRUNCF_BINANG((s16)(this->actor.world.rot.y - this->gekkoRot.y) * invWindupPunchTimer);
|
||||
this->gekkoPosOffset.x = Math_SinS(this->gekkoRot.y) * -50.0f;
|
||||
this->gekkoPosOffset.z = Math_CosS(this->gekkoRot.y) * -50.0f;
|
||||
} else {
|
||||
@ -1741,10 +1741,10 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) {
|
||||
// loop over x, y, z
|
||||
for (j = 0; j < 3; j++) {
|
||||
// Linearly interpolate dynamicVtx --> staticVtx * (1 - scale * vtxSurfacePerturbation)
|
||||
dynamicVtx->n.ob[j] += (s16)(((staticVtx->n.ob[j] - (s32)(scale * staticVtx->n.ob[j] *
|
||||
this->vtxSurfacePerturbation[i])) -
|
||||
dynamicVtx->n.ob[j]) *
|
||||
invWindupPunchTimer);
|
||||
dynamicVtx->n.ob[j] += TRUNCF_BINANG(
|
||||
((staticVtx->n.ob[j] - (s32)(scale * staticVtx->n.ob[j] * this->vtxSurfacePerturbation[i])) -
|
||||
dynamicVtx->n.ob[j]) *
|
||||
invWindupPunchTimer);
|
||||
}
|
||||
} else {
|
||||
// loop over x, y, z
|
||||
@ -1759,7 +1759,8 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) {
|
||||
// loop over x, y, z
|
||||
for (j = 0; j < 3; j++) {
|
||||
// Linearly interpolate dynamicVtx --> staticVtx
|
||||
dynamicVtx->n.ob[j] += (s16)((staticVtx->n.ob[j] - dynamicVtx->n.ob[j]) * invWindupPunchTimer);
|
||||
dynamicVtx->n.ob[j] +=
|
||||
TRUNCF_BINANG((staticVtx->n.ob[j] - dynamicVtx->n.ob[j]) * invWindupPunchTimer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1794,7 +1795,7 @@ void EnBigslime_SetDynamicVtxThrowPlayer(EnBigslime* this, PlayState* play) {
|
||||
// loop over x, y, z
|
||||
for (j = 0; j < 3; j++) {
|
||||
// Linearly interpolate dynamicVtx --> targetVtx
|
||||
dynamicVtx->n.ob[j] += (s16)((targetVtx->n.ob[j] - dynamicVtx->n.ob[j]) * invThrowPlayerTimer);
|
||||
dynamicVtx->n.ob[j] += TRUNCF_BINANG((targetVtx->n.ob[j] - dynamicVtx->n.ob[j]) * invThrowPlayerTimer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1881,9 +1882,9 @@ void EnBigslime_Freeze(EnBigslime* this, PlayState* play) {
|
||||
dynamicVtx = &sBigslimeDynamicVtx[this->dynamicVtxState][vtxIceSeed];
|
||||
targetVtx = &sBigslimeTargetVtx[vtxIceSeed];
|
||||
randFloat = Rand_CenteredFloat(40.0f);
|
||||
dynamicVtx->n.ob[0] += (s16)(randFloat / this->actor.scale.x);
|
||||
dynamicVtx->n.ob[1] += (s16)(randFloat / this->actor.scale.y);
|
||||
dynamicVtx->n.ob[2] += (s16)(randFloat / this->actor.scale.z);
|
||||
dynamicVtx->n.ob[0] += TRUNCF_BINANG(randFloat / this->actor.scale.x);
|
||||
dynamicVtx->n.ob[1] += TRUNCF_BINANG(randFloat / this->actor.scale.y);
|
||||
dynamicVtx->n.ob[2] += TRUNCF_BINANG(randFloat / this->actor.scale.z);
|
||||
if (((dynamicVtx->n.ob[1] * this->actor.scale.y) + this->actor.world.pos.y) < GBT_ROOM_5_MIN_Y) {
|
||||
dynamicVtx->n.ob[1] = ((GBT_ROOM_5_MIN_Y - this->actor.world.pos.y) / this->actor.scale.y) - 1.0f;
|
||||
}
|
||||
@ -2843,8 +2844,8 @@ void EnBigslime_UpdateGekko(Actor* thisx, PlayState* play) {
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 40.0f, 80.0f,
|
||||
UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_4 |
|
||||
UPDBGCHECKINFO_FLAG_8 | UPDBGCHECKINFO_FLAG_10);
|
||||
this->gekkoCollider.dim.pos.x = (s16)this->actor.world.pos.x;
|
||||
this->gekkoCollider.dim.pos.z = (s16)this->actor.world.pos.z;
|
||||
this->gekkoCollider.dim.pos.x = TRUNCF_BINANG(this->actor.world.pos.x);
|
||||
this->gekkoCollider.dim.pos.z = TRUNCF_BINANG(this->actor.world.pos.z);
|
||||
if (this->gekkoCollider.base.acFlags & AC_ON) {
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->gekkoCollider.base);
|
||||
}
|
||||
@ -2856,7 +2857,7 @@ void EnBigslime_UpdateGekko(Actor* thisx, PlayState* play) {
|
||||
EnBigslime_UpdateEffects(this);
|
||||
|
||||
if ((this->actionFunc != EnBigslime_StunGekko) &&
|
||||
(this->gekkoCollider.dim.pos.y < (s16)(3.0f + GBT_ROOM_5_MIN_Y))) {
|
||||
(this->gekkoCollider.dim.pos.y < TRUNCF_BINANG(3.0f + GBT_ROOM_5_MIN_Y))) {
|
||||
Vec3f vtxNorm;
|
||||
|
||||
if (((play->gameplayFrames % 4) == 0) || !isGekkoOnGround) {
|
||||
|
@ -281,7 +281,7 @@ void EnBom_Move(EnBom* this, PlayState* play) {
|
||||
temp = BINANG_ROT180(temp);
|
||||
}
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, temp, this->actor.speed * 100.0f);
|
||||
this->unk_1FA += (s16)(this->actor.speed * 800.0f);
|
||||
this->unk_1FA += TRUNCF_BINANG(this->actor.speed * 800.0f);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
|
@ -545,7 +545,7 @@ void EnBombers_Update(Actor* thisx, PlayState* play) {
|
||||
this->unk_2B8++;
|
||||
if (this->unk_2B8 >= 3) {
|
||||
this->unk_2B8 = 0;
|
||||
this->unk_2BA = (s16)Rand_ZeroFloat(60.0f) + 20;
|
||||
this->unk_2BA = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 20;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -418,7 +418,7 @@ void EnBombers2_Update(Actor* thisx, PlayState* play) {
|
||||
this->eyeIndex += 1;
|
||||
if (this->eyeIndex >= 3) {
|
||||
this->eyeIndex = 0;
|
||||
this->unk_2BE = (s16)Rand_ZeroFloat(60.0f) + 0x14;
|
||||
this->unk_2BE = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 0x14;
|
||||
}
|
||||
}
|
||||
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
|
||||
|
@ -488,7 +488,7 @@ void func_80BFEB64(EnBomjima* this, PlayState* play) {
|
||||
EffectSsHitmark_SpawnFixedScale(play, 0, &sp40);
|
||||
this->unk_2BC++;
|
||||
|
||||
if (((s16)Rand_ZeroFloat(2.0f) + 3) < this->unk_2BC) {
|
||||
if ((TRUNCF_BINANG(Rand_ZeroFloat(2.0f)) + 3) < this->unk_2BC) {
|
||||
EnBomjima_ChangeAnim(this, ENBOMJIMA_ANIM_5, 1.0f);
|
||||
this->unk_29A = 0;
|
||||
Math_Vec3f_Copy(&this->unk_2A4, &this->actor.home.pos);
|
||||
@ -1105,7 +1105,7 @@ void EnBomjima_Update(Actor* thisx, PlayState* play) {
|
||||
this->unk_2E0++;
|
||||
if (this->unk_2E0 >= 3) {
|
||||
this->unk_2E0 = 0;
|
||||
this->unk_2E2 = (s16)Rand_ZeroFloat(60.0f) + 20;
|
||||
this->unk_2E2 = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 20;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -924,7 +924,7 @@ void EnBomjimb_Update(Actor* thisx, PlayState* play2) {
|
||||
this->unk_2C2++;
|
||||
if (this->unk_2C2 > 2) {
|
||||
this->unk_2C2 = 0;
|
||||
this->unk_2C4 = (s16)Rand_ZeroFloat(60.0f) + 20;
|
||||
this->unk_2C4 = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 20;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ void func_808A2918(EnBoom* this, PlayState* play) {
|
||||
}
|
||||
|
||||
Math_ScaledStepToS(&this->actor.world.rot.y, sp72,
|
||||
(this->unk_1CF > 0) ? 0x3E8 : (s16)(ABS_ALT(sp70) * sp64));
|
||||
(this->unk_1CF > 0) ? 0x3E8 : TRUNCF_BINANG(ABS_ALT(sp70) * sp64));
|
||||
}
|
||||
|
||||
Math_ScaledStepToS(&this->actor.world.rot.x, sp6E, ABS_ALT(sp6C) * sp64);
|
||||
|
@ -238,7 +238,7 @@ void EnBubble_Fly(EnBubble* this, PlayState* play) {
|
||||
this->bounceDirection = bounceDirection;
|
||||
bounceCount = this->bounceCount;
|
||||
this->bounceCount = ++bounceCount;
|
||||
if (bounceCount > (s16)(Rand_ZeroOne() * 10.0f)) {
|
||||
if (bounceCount > TRUNCF_BINANG(Rand_ZeroOne() * 10.0f)) {
|
||||
this->bounceCount = 0;
|
||||
}
|
||||
bounceSpeed = (this->bounceCount == 0) ? 3.6000001f : 3.0f;
|
||||
@ -257,7 +257,7 @@ void EnBubble_Fly(EnBubble* this, PlayState* play) {
|
||||
this->bounceDirection = bounceDirection;
|
||||
bounceCount = this->bounceCount;
|
||||
this->bounceCount = ++bounceCount;
|
||||
if (bounceCount > (s16)(Rand_ZeroOne() * 10.0f)) {
|
||||
if (bounceCount > TRUNCF_BINANG(Rand_ZeroOne() * 10.0f)) {
|
||||
this->bounceCount = 0;
|
||||
}
|
||||
bounceSpeed = (this->bounceCount == 0) ? 3.6000001f : 3.0f;
|
||||
|
@ -221,7 +221,7 @@ void func_8091C6B4(EnButte* this) {
|
||||
s16 temp_v0 = temp_a1 - this->actor.shape.rot.y;
|
||||
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, temp_a1, ABS_ALT(temp_v0) >> 3);
|
||||
this->actor.shape.rot.x = (s16)(Math_SinS(this->unk_258) * 600.0f) - 0x2320;
|
||||
this->actor.shape.rot.x = TRUNCF_BINANG(Math_SinS(this->unk_258) * 600.0f) - 0x2320;
|
||||
}
|
||||
|
||||
void func_8091C748(EnButte* this) {
|
||||
@ -272,7 +272,7 @@ void func_8091C794(EnButte* this, PlayState* play) {
|
||||
sp38 = 0.4f;
|
||||
}
|
||||
} else {
|
||||
this->actor.world.rot.y += (s16)(Math_SinS(this->unk_254) * 100.0f);
|
||||
this->actor.world.rot.y += TRUNCF_BINANG(Math_SinS(this->unk_254) * 100.0f);
|
||||
}
|
||||
|
||||
func_8091C6B4(this);
|
||||
@ -329,7 +329,7 @@ void func_8091CBB4(EnButte* this, PlayState* play) {
|
||||
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &sp48);
|
||||
if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw + (s32)(Rand_ZeroOne() * D_8091D3F0), 0x7D0)) {
|
||||
if ((play->gameplayFrames & 0x30) == 0x30) {
|
||||
this->actor.world.rot.y += (s16)(Math_SinS(this->unk_254) * 60.0f);
|
||||
this->actor.world.rot.y += TRUNCF_BINANG(Math_SinS(this->unk_254) * 60.0f);
|
||||
}
|
||||
} else {
|
||||
sp40 = 0.3f;
|
||||
|
@ -97,7 +97,7 @@ void EnCha_Idle(EnCha* this, PlayState* play) {
|
||||
}
|
||||
}
|
||||
this->actor.home.rot.x += this->actor.home.rot.z;
|
||||
this->actor.home.rot.z -= (s16)(this->actor.home.rot.x * 0.1f);
|
||||
this->actor.home.rot.z -= TRUNCF_BINANG(this->actor.home.rot.x * 0.1f);
|
||||
this->actor.home.rot.z *= 0.96f;
|
||||
}
|
||||
|
||||
|
@ -280,8 +280,8 @@ s32 EnCne01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
|
||||
if ((limbIndex == CNE_LIMB_TORSO) || (limbIndex == CNE_LIMB_LEFT_UPPER_ARM) ||
|
||||
(limbIndex == CNE_LIMB_RIGHT_UPPER_ARM)) {
|
||||
rot->y += (s16)(Math_SinS(this->enHy.fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->enHy.fidgetTableZ[limbIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->enHy.fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->enHy.fidgetTableZ[limbIndex]) * 200.0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -549,9 +549,9 @@ s32 EnCrow_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
|
||||
if (this->actor.colChkInfo.health != 0) {
|
||||
if (limbIndex == OBJECT_CROW_LIMB_UPPER_TAIL) {
|
||||
rot->y += (s16)(0xC00 * Math_SinF(this->skelAnime.curFrame * (M_PI / 4)));
|
||||
rot->y += TRUNCF_BINANG(0xC00 * Math_SinF(this->skelAnime.curFrame * (M_PI / 4)));
|
||||
} else if (limbIndex == OBJECT_CROW_LIMB_TAIL) {
|
||||
rot->y += (s16)(0x1400 * Math_SinF((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
|
||||
rot->y += TRUNCF_BINANG(0x1400 * Math_SinF((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -108,8 +108,8 @@ void EnDs2n_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
|
||||
|
||||
if ((limbIndex == DS2N_LIMB_HIPS) || (limbIndex == DS2N_LIMB_LEFT_UPPER_ARM) ||
|
||||
(limbIndex == DS2N_LIMB_RIGHT_UPPER_ARM)) {
|
||||
rot->y += (s16)Math_SinS(this->fidgetTableY[limbIndex]) * 200;
|
||||
rot->z += (s16)Math_CosS(this->fidgetTableZ[limbIndex]) * 200;
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[limbIndex])) * 200;
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[limbIndex])) * 200;
|
||||
}
|
||||
|
||||
if (limbIndex == DS2N_LIMB_HEAD) {
|
||||
|
@ -62,7 +62,7 @@ void EnEndingHero_Update(Actor* thisx, PlayState* play) {
|
||||
this->unk242++;
|
||||
if (this->unk242 > 2) {
|
||||
this->unk242 = 0;
|
||||
this->unk240 = (s16)Rand_ZeroFloat(60.0f) + 0x14;
|
||||
this->unk240 = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 0x14;
|
||||
}
|
||||
}
|
||||
this->actionFunc(this, play);
|
||||
|
@ -125,7 +125,7 @@ void EnEndingHero6_Update(Actor* thisx, PlayState* play) {
|
||||
this->eyeState++;
|
||||
if (this->eyeState >= 3) {
|
||||
this->eyeState = 0;
|
||||
this->blinkTimer = (s16)Rand_ZeroFloat(60.0f) + 20;
|
||||
this->blinkTimer = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 20;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ void EnEstone_Init(Actor* thisx, PlayState* play) {
|
||||
this->rotVel.x = this->rotVel.y = this->rotVel.z = Rand_CenteredFloat(1.0f) * 20.0f;
|
||||
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
this->actor.world.rot.y += (s16)(s32)Rand_CenteredFloat(0x2710);
|
||||
this->actor.world.rot.y += TRUNCF_BINANG(Rand_CenteredFloat(0x2710));
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
|
||||
if (this->actor.params == ENESTONE_TYPE_LARGE) {
|
||||
|
@ -301,7 +301,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y,
|
||||
Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300);
|
||||
} else if (rand < 0.8f) {
|
||||
this->actor.shape.rot.y += (s16)(s32)Rand_CenteredFloat(0x600);
|
||||
this->actor.shape.rot.y += TRUNCF_BINANG(Rand_CenteredFloat(0x600));
|
||||
}
|
||||
|
||||
// Climb if too close to ground
|
||||
|
@ -563,7 +563,7 @@ void func_8091EAF0(Actor* thisx, PlayState* play) {
|
||||
s16 phi_v1;
|
||||
|
||||
Math_SmoothStepToF(&this->actor.speed, Rand_ZeroOne() * 0.2f, 0.1f, 0.1f, 0.0f);
|
||||
phi_v1 = (s16)((((sp40 >> 5) & 2) | ((sp40 >> 2) & 1)) << 0xB) * 0.3f;
|
||||
phi_v1 = TRUNCF_BINANG((s16)((((sp40 >> 5) & 2) | ((sp40 >> 2) & 1)) << 0xB) * 0.3f);
|
||||
if (sp40 & 4) {
|
||||
phi_v1 *= -1;
|
||||
}
|
||||
|
@ -3365,7 +3365,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||
this->unk_149 = 6;
|
||||
sp134 = 2;
|
||||
|
||||
if (((s16)player->actor.world.pos.x + D_80917268) & 1) {
|
||||
if ((TRUNCF_BINANG(player->actor.world.pos.x) + D_80917268) & 1) {
|
||||
sp10C.x = 30.0f;
|
||||
} else {
|
||||
sp10C.x = -30.0f;
|
||||
@ -3874,7 +3874,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||
D_809171D2 = D_80917206;
|
||||
Actor_Kill(&this->actor);
|
||||
} else if ((this->unk_148 == 0) && (D_809171D0 == 0) &&
|
||||
((s16)this->unk_1A4 < (s16)D_8090CCF0)) {
|
||||
(TRUNCF_BINANG(this->unk_1A4) < TRUNCF_BINANG(D_8090CCF0))) {
|
||||
this->unk_1CD = 1;
|
||||
this->unk_172[0] = 0x3C;
|
||||
Message_StartTextbox(play, 0x4098, NULL);
|
||||
@ -4074,7 +4074,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||
func_80903C60(this, 1);
|
||||
this->unk_17C = this->actor.velocity.y;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->unk_162 = (s16)(s32)Rand_CenteredFloat(0x8000);
|
||||
this->unk_162 = TRUNCF_BINANG(Rand_CenteredFloat(0x8000));
|
||||
} else if ((this->actor.world.pos.y < WATER_SURFACE_Y(play)) &&
|
||||
(this->actor.prevPos.y >= WATER_SURFACE_Y(play))) {
|
||||
if (this->unk_17C < -5.0f) {
|
||||
@ -4135,10 +4135,10 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
this->unk_15E = 0;
|
||||
} else {
|
||||
this->unk_15E = (s16)(s32)Rand_CenteredFloat(0x20) + 0x8000;
|
||||
this->unk_15E = TRUNCF_BINANG(Rand_CenteredFloat(0x20)) + 0x8000;
|
||||
}
|
||||
|
||||
this->unk_160 = (s16)(s32)Rand_CenteredFloat(0x4000);
|
||||
this->unk_160 = TRUNCF_BINANG(Rand_CenteredFloat(0x4000));
|
||||
this->unk_188 = 1.0f;
|
||||
this->unk_18C = 5000.0f;
|
||||
this->unk_194 = 5000.0f;
|
||||
@ -4842,7 +4842,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, PlayState* play) {
|
||||
this->unk_154 = 20;
|
||||
} else if (D_809171D0 == 0) {
|
||||
D_8090CCF8 = D_8090CCF0;
|
||||
if ((s16)D_809171CC < (s16)D_8090CCF0) {
|
||||
if (TRUNCF_BINANG(D_809171CC) < TRUNCF_BINANG(D_8090CCF0)) {
|
||||
if (D_809171D2 == 2) {
|
||||
this->actor.textId = 0x40B0;
|
||||
} else {
|
||||
@ -4924,11 +4924,11 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, PlayState* play) {
|
||||
f32 temp;
|
||||
|
||||
HIGH_SCORE(HS_FISHING) &= 0xFFFFFF00;
|
||||
HIGH_SCORE(HS_FISHING) |= ((s16)D_809171CC & 0x7F);
|
||||
HIGH_SCORE(HS_FISHING) |= (TRUNCF_BINANG(D_809171CC) & 0x7F);
|
||||
temp = (HIGH_SCORE(HS_FISHING) & 0x7F000000) >> 0x18;
|
||||
if (temp < D_809171CC) {
|
||||
HIGH_SCORE(HS_FISHING) &= 0xFFFFFF;
|
||||
HIGH_SCORE(HS_FISHING) |= ((s16)D_809171CC & 0x7F) << 0x18;
|
||||
HIGH_SCORE(HS_FISHING) |= (TRUNCF_BINANG(D_809171CC) & 0x7F) << 0x18;
|
||||
|
||||
if (D_809171D2 == 2) {
|
||||
HIGH_SCORE(HS_FISHING) |= 0x80000000;
|
||||
@ -4942,7 +4942,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, PlayState* play) {
|
||||
}
|
||||
} else {
|
||||
HIGH_SCORE(HS_FISHING) &= 0xFFFFFF;
|
||||
HIGH_SCORE(HS_FISHING) |= ((s16)D_809171CC & 0x7F) << 0x18;
|
||||
HIGH_SCORE(HS_FISHING) |= (TRUNCF_BINANG(D_809171CC) & 0x7F) << 0x18;
|
||||
|
||||
if (D_809171D2 == 2) {
|
||||
HIGH_SCORE(HS_FISHING) |= 0x80000000;
|
||||
|
@ -1657,8 +1657,8 @@ s32 EnFsn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
break;
|
||||
}
|
||||
if (fidgetIndex < 9) {
|
||||
rot->y += (s16)(Math_SinS(this->fidgetTableY[fidgetIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->fidgetTableZ[fidgetIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[fidgetIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[fidgetIndex]) * 200.0f);
|
||||
}
|
||||
}
|
||||
if (limbIndex == FSN_LIMB_TOUPEE) {
|
||||
|
@ -414,8 +414,8 @@ s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
// Make small fidgeting movements if in standing animation.
|
||||
if ((limbIndex == GERUDO_WHITE_LIMB_TORSO) || (limbIndex == GERUDO_WHITE_LIMB_LEFT_FOREARM) ||
|
||||
(limbIndex == GERUDO_WHITE_LIMB_RIGHT_FOREARM)) {
|
||||
rot->y += (s16)(Math_SinS(play->state.frames * (limbIndex * 50 + 0x814)) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(play->state.frames * (limbIndex * 50 + 0x940)) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(play->state.frames * (limbIndex * 50 + 0x814)) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(play->state.frames * (limbIndex * 50 + 0x940)) * 200.0f);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -240,7 +240,7 @@ void func_80BB178C(EnGeg* this, PlayState* play) {
|
||||
if (this->unk_230 & 1) {
|
||||
this->colliderSphere.dim.worldSphere.center.x = sp34.x;
|
||||
this->colliderSphere.dim.worldSphere.center.y = sp34.y;
|
||||
this->colliderSphere.dim.worldSphere.center.y += (s16)this->actor.shape.yOffset;
|
||||
this->colliderSphere.dim.worldSphere.center.y += TRUNCF_BINANG(this->actor.shape.yOffset);
|
||||
this->colliderSphere.dim.worldSphere.center.z = sp34.z;
|
||||
this->colliderSphere.dim.modelSphere.radius = 20;
|
||||
this->colliderSphere.dim.worldSphere.radius =
|
||||
|
@ -1782,8 +1782,8 @@ s32 EnGm_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
||||
}
|
||||
|
||||
if ((this->unk_3A4 & 0x2000) && (fidgetIndex < 9)) {
|
||||
rot->y += (s16)(Math_SinS(this->fidgetTableY[fidgetIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->fidgetTableZ[fidgetIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[fidgetIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[fidgetIndex]) * 200.0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -793,7 +793,7 @@ void EnGo_UpdateSnowballCollider(EnGo* this, PlayState* play) {
|
||||
|
||||
this->colliderSphere.dim.worldSphere.center.x = worldPos.x;
|
||||
this->colliderSphere.dim.worldSphere.center.y = worldPos.y;
|
||||
this->colliderSphere.dim.worldSphere.center.y += (s16)this->actor.shape.yOffset;
|
||||
this->colliderSphere.dim.worldSphere.center.y += TRUNCF_BINANG(this->actor.shape.yOffset);
|
||||
this->colliderSphere.dim.worldSphere.center.z = worldPos.z;
|
||||
|
||||
this->colliderSphere.dim.modelSphere.radius = 48;
|
||||
@ -826,7 +826,7 @@ void EnGo_UpdateRolledUpCollider(EnGo* this, PlayState* play) {
|
||||
Math_Vec3f_Copy(&worldPos, &this->actor.world.pos);
|
||||
this->colliderSphere.dim.worldSphere.center.x = worldPos.x;
|
||||
this->colliderSphere.dim.worldSphere.center.y = worldPos.y;
|
||||
this->colliderSphere.dim.worldSphere.center.y += (s16)this->actor.shape.yOffset;
|
||||
this->colliderSphere.dim.worldSphere.center.y += TRUNCF_BINANG(this->actor.shape.yOffset);
|
||||
this->colliderSphere.dim.worldSphere.center.z = worldPos.z;
|
||||
this->colliderSphere.dim.modelSphere.radius = 20;
|
||||
this->colliderSphere.dim.worldSphere.radius =
|
||||
@ -1339,7 +1339,7 @@ s32 EnGo_HandleGatekeeperPoundCutscene(EnGo* this, f32 initialVelocity, f32 maxD
|
||||
if (velocity > 0.0f) {
|
||||
// PHASE 1: Goron is rising
|
||||
rotAndDistortFactor = velocity / initialVelocity;
|
||||
this->actor.shape.rot.x += (s16)(0x238C * rotAndDistortFactor);
|
||||
this->actor.shape.rot.x += TRUNCF_BINANG(0x238C * rotAndDistortFactor);
|
||||
this->elapsedHangtime = 0;
|
||||
} else if ((s32)this->actor.velocity.y == 0) {
|
||||
if (maxHangtime >= this->elapsedHangtime) {
|
||||
@ -2309,7 +2309,7 @@ void EnGo_Snowball(EnGo* this, PlayState* play) {
|
||||
}
|
||||
|
||||
this->actor.speed = 4.0f;
|
||||
this->actor.shape.rot.x += (s16)(this->actor.speed * 546.0f);
|
||||
this->actor.shape.rot.x += TRUNCF_BINANG(this->actor.speed * 546.0f);
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
}
|
||||
}
|
||||
@ -2528,8 +2528,8 @@ s32 EnGo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
||||
}
|
||||
|
||||
if ((this->actionFlags & ENGO_FLAG_STANDING) && (fidgetIndex < 9)) {
|
||||
rot->y += (s16)(Math_SinS(this->fidgetTableY[fidgetIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->fidgetTableZ[fidgetIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[fidgetIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[fidgetIndex]) * 200.0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -707,7 +707,7 @@ s32 func_80998F9C(EnGs* this, PlayState* play) {
|
||||
|
||||
if (this->unk_19D == 4) {
|
||||
sp48 = Math_SmoothStepToF(&this->unk_1DC, this->unk_1E0, 0.8f, 16384.0f, 3640.0f);
|
||||
this->unk_19E[0].y += (s16)this->unk_1DC;
|
||||
this->unk_19E[0].y += TRUNCF_BINANG(this->unk_1DC);
|
||||
if (sp48 == 0.0f) {
|
||||
phi_v0_2 = this->unk_19E[0].y;
|
||||
if (phi_v0_2 > 0) {
|
||||
@ -888,7 +888,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) {
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
Math_SmoothStepToF(&this->unk_1DC, this->unk_1E0, 0.5f, 364.0f, 0.0f);
|
||||
|
||||
this->unk_19E[1].y += (s16)this->unk_1DC;
|
||||
this->unk_19E[1].y += TRUNCF_BINANG(this->unk_1DC);
|
||||
|
||||
if ((this->actor.world.pos.y - this->actor.home.pos.y) >= 4000.0f) {
|
||||
this->unk_216 = 0;
|
||||
|
@ -332,7 +332,7 @@ void EnGuardNuts_Update(Actor* thisx, PlayState* play) {
|
||||
this->eyeState++;
|
||||
if (this->eyeState >= 3) {
|
||||
this->eyeState = 0;
|
||||
this->blinkTimer = (s16)Rand_ZeroFloat(60.0f) + 20;
|
||||
this->blinkTimer = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 20;
|
||||
}
|
||||
}
|
||||
if ((this->animIndex == GUARD_NUTS_ANIM_WALK) &&
|
||||
|
@ -297,7 +297,7 @@ void func_80B236C8(EnHanabi* this, PlayState* play) {
|
||||
sp28 = func_80B22C80(&sp34, this->unk_148, 1.0f);
|
||||
}
|
||||
|
||||
this->actor.home.rot.y += (s16)((Rand_ZeroFloat(40.0f) + 80.0f) * 256.0f);
|
||||
this->actor.home.rot.y += TRUNCF_BINANG((Rand_ZeroFloat(40.0f) + 80.0f) * 256.0f);
|
||||
this->unk_144 = (s32)Rand_ZeroFloat(5.0f) + 20;
|
||||
Actor_PlaySfx(&this->actor, NA_SE_OC_FIREWORKS);
|
||||
func_80B235CC(this, &sp34, sp28);
|
||||
|
@ -880,7 +880,7 @@ s32 EnHintSkb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
|
||||
temp_f10 = fabsf(Math_SinS(play->state.frames * 6000) * 95.0f) + 160.0f;
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, (s16)temp_f10, (s16)temp_f10, (s16)temp_f10, 255);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, TRUNCF_BINANG(temp_f10), TRUNCF_BINANG(temp_f10), TRUNCF_BINANG(temp_f10), 255);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
} else if (limbIndex == STALCHILD_LIMB_RIBCAGE) {
|
||||
|
@ -639,7 +639,7 @@ void EnHonotrap_FlameGroup(EnHonotrap* this, PlayState* play) {
|
||||
flameElem->pos.y = this->actor.world.pos.y;
|
||||
flameElem->pos.z = (sp84 * var_fs0) + this->actor.world.pos.z;
|
||||
|
||||
flameElem->unkC = Math_SinS((s16)(s32)(var_fs0 * 25486.223f)) * 1.6f;
|
||||
flameElem->unkC = Math_SinS(TRUNCF_BINANG(var_fs0 * 25486.223f)) * 1.6f;
|
||||
if (flameElem->unkC > 1.0f) {
|
||||
flameElem->unkC = 1.0f;
|
||||
} else if (flameElem->unkC < 0.0f) {
|
||||
@ -666,19 +666,19 @@ void EnHonotrap_FlameGroup(EnHonotrap* this, PlayState* play) {
|
||||
sp68.z = temp_fs0;
|
||||
}
|
||||
|
||||
var_fs0_2 = Math_SinS((s16)(s32)(sp68.z * 212.3852f)) * 1.6f;
|
||||
var_fs0_2 = Math_SinS(TRUNCF_BINANG(sp68.z * 212.3852f)) * 1.6f;
|
||||
if (var_fs0_2 > 1.0f) {
|
||||
var_fs0_2 = 1.0f;
|
||||
}
|
||||
sp80 *= ((1.0f - flameGroup->unk4) * 0.8f) + 0.2f;
|
||||
if (sp80 > 0.2f) {
|
||||
this->collider.cyl.dim.pos.x =
|
||||
(s16)(s32)((Math_SinS(this->actor.shape.rot.y) * sp68.z) + this->actor.world.pos.x);
|
||||
this->collider.cyl.dim.pos.y = (s16)(s32)(this->actor.world.pos.y - (24.0f * var_fs0_2));
|
||||
TRUNCF_BINANG((Math_SinS(this->actor.shape.rot.y) * sp68.z) + this->actor.world.pos.x);
|
||||
this->collider.cyl.dim.pos.y = TRUNCF_BINANG(this->actor.world.pos.y - (24.0f * var_fs0_2));
|
||||
this->collider.cyl.dim.pos.z =
|
||||
(s16)(s32)((Math_CosS(this->actor.shape.rot.y) * sp68.z) + this->actor.world.pos.z);
|
||||
this->collider.cyl.dim.radius = (s16)(s32)(15.0f * var_fs0_2);
|
||||
this->collider.cyl.dim.height = (s16)(s32)(37.5f * var_fs0_2);
|
||||
TRUNCF_BINANG((Math_CosS(this->actor.shape.rot.y) * sp68.z) + this->actor.world.pos.z);
|
||||
this->collider.cyl.dim.radius = TRUNCF_BINANG(15.0f * var_fs0_2);
|
||||
this->collider.cyl.dim.height = TRUNCF_BINANG(37.5f * var_fs0_2);
|
||||
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.tris.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.tris.base);
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.tris.base);
|
||||
|
@ -4121,7 +4121,7 @@ void EnHorse_TiltBody(EnHorse* this, PlayState* play) {
|
||||
|
||||
speed = this->actor.speed / this->boostSpeed;
|
||||
turnVel = this->actor.shape.rot.y - this->lastYaw;
|
||||
targetRoll = -((s16)((2730.0f * speed) * (turnVel / 960.00006f)));
|
||||
targetRoll = -TRUNCF_BINANG((2730.0f * speed) * (turnVel / 960.00006f));
|
||||
rollDiff = targetRoll - this->actor.world.rot.z;
|
||||
|
||||
if (fabsf(targetRoll) < 100.0f) {
|
||||
@ -4316,22 +4316,22 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
|
||||
|
||||
if (this->type == HORSE_TYPE_2) {
|
||||
this->colliderCylinder1.dim.pos.x =
|
||||
(s16)(Math_SinS(thisx->shape.rot.y) * 11.0f) + this->colliderCylinder1.dim.pos.x;
|
||||
TRUNCF_BINANG(Math_SinS(thisx->shape.rot.y) * 11.0f) + this->colliderCylinder1.dim.pos.x;
|
||||
this->colliderCylinder1.dim.pos.z =
|
||||
(s16)(Math_CosS(thisx->shape.rot.y) * 11.0f) + this->colliderCylinder1.dim.pos.z;
|
||||
TRUNCF_BINANG(Math_CosS(thisx->shape.rot.y) * 11.0f) + this->colliderCylinder1.dim.pos.z;
|
||||
this->colliderCylinder2.dim.pos.x =
|
||||
(s16)(Math_SinS(thisx->shape.rot.y) * -18.0f) + this->colliderCylinder2.dim.pos.x;
|
||||
TRUNCF_BINANG(Math_SinS(thisx->shape.rot.y) * -18.0f) + this->colliderCylinder2.dim.pos.x;
|
||||
this->colliderCylinder2.dim.pos.z =
|
||||
(s16)(Math_CosS(thisx->shape.rot.y) * -18.0f) + this->colliderCylinder2.dim.pos.z;
|
||||
TRUNCF_BINANG(Math_CosS(thisx->shape.rot.y) * -18.0f) + this->colliderCylinder2.dim.pos.z;
|
||||
} else {
|
||||
this->colliderCylinder1.dim.pos.x =
|
||||
(s16)(Math_SinS(thisx->shape.rot.y) * 6.6000004f) + this->colliderCylinder1.dim.pos.x;
|
||||
TRUNCF_BINANG(Math_SinS(thisx->shape.rot.y) * 6.6000004f) + this->colliderCylinder1.dim.pos.x;
|
||||
this->colliderCylinder1.dim.pos.z =
|
||||
(s16)(Math_CosS(thisx->shape.rot.y) * 6.6000004f) + this->colliderCylinder1.dim.pos.z;
|
||||
TRUNCF_BINANG(Math_CosS(thisx->shape.rot.y) * 6.6000004f) + this->colliderCylinder1.dim.pos.z;
|
||||
this->colliderCylinder2.dim.pos.x =
|
||||
(s16)(Math_SinS(thisx->shape.rot.y) * -10.8f) + this->colliderCylinder2.dim.pos.x;
|
||||
TRUNCF_BINANG(Math_SinS(thisx->shape.rot.y) * -10.8f) + this->colliderCylinder2.dim.pos.x;
|
||||
this->colliderCylinder2.dim.pos.z =
|
||||
(s16)(Math_CosS(thisx->shape.rot.y) * -10.8f) + this->colliderCylinder2.dim.pos.z;
|
||||
TRUNCF_BINANG(Math_CosS(thisx->shape.rot.y) * -10.8f) + this->colliderCylinder2.dim.pos.z;
|
||||
}
|
||||
|
||||
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder1.base);
|
||||
|
@ -1693,8 +1693,8 @@ s32 EnIn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
||||
}
|
||||
|
||||
if ((limbIndex == OBJECT_IN_LIMB_09) || (limbIndex == OBJECT_IN_LIMB_0A) || (limbIndex == OBJECT_IN_LIMB_0D)) {
|
||||
rot->y += (s16)(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f);
|
||||
}
|
||||
|
||||
if (this->unk4AC & 0x40) {
|
||||
|
@ -129,7 +129,7 @@ void func_80BC1984(EnJa* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
this->collider.dim.height = (s16)fabsf(this->actor.focus.pos.y - this->actor.world.pos.y) + 5;
|
||||
this->collider.dim.height = TRUNCF_BINANG(fabsf(this->actor.focus.pos.y - this->actor.world.pos.y)) + 5;
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
|
||||
|
@ -1357,9 +1357,9 @@ void func_80B887AC(EnKaizoku* this, PlayState* play) {
|
||||
if (!func_80B85858(this, play) && !func_80B85A00(this, play, false)) {
|
||||
temp_v0 = this->picto.actor.yawTowardsPlayer - this->picto.actor.shape.rot.y;
|
||||
if (temp_v0 > 0) {
|
||||
var_a2 = (s16)(temp_v0 * 0.25f) + 0x7D0;
|
||||
var_a2 = TRUNCF_BINANG(temp_v0 * 0.25f) + 0x7D0;
|
||||
} else {
|
||||
var_a2 = (s16)(temp_v0 * 0.25f) - 0x7D0;
|
||||
var_a2 = TRUNCF_BINANG(temp_v0 * 0.25f) - 0x7D0;
|
||||
}
|
||||
this->picto.actor.shape.rot.y += var_a2;
|
||||
this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y;
|
||||
|
@ -714,7 +714,7 @@ void EnKame_Dead(EnKame* this, PlayState* play) {
|
||||
}
|
||||
|
||||
this->actor.shape.rot.x += Rand_S16Offset(0x700, 0x1400);
|
||||
this->actor.shape.rot.y += (s16)Rand_ZeroFloat(5120.0f);
|
||||
this->actor.shape.rot.y += TRUNCF_BINANG(Rand_ZeroFloat(0x1400));
|
||||
this->actor.shape.rot.z += Rand_S16Offset(0x700, 0x1400);
|
||||
}
|
||||
}
|
||||
|
@ -535,7 +535,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
} else {
|
||||
this->actor.velocity.y *= -0.3f;
|
||||
this->actor.world.rot.y += (s16)(s32)Rand_CenteredFloat(0x4000);
|
||||
this->actor.world.rot.y += TRUNCF_BINANG(Rand_CenteredFloat(0x4000));
|
||||
}
|
||||
bounced = true;
|
||||
} else {
|
||||
|
@ -321,7 +321,7 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) {
|
||||
this->eyeState++;
|
||||
if (this->eyeState >= 3) {
|
||||
this->eyeState = 0;
|
||||
this->blinkTimer = (s16)Rand_ZeroFloat(60.0f) + 20;
|
||||
this->blinkTimer = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 20;
|
||||
}
|
||||
}
|
||||
this->actionFunc(this, play);
|
||||
@ -339,9 +339,9 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) {
|
||||
Vec3f effectVelocity;
|
||||
|
||||
Math_Vec3f_Copy(&effectPos, &this->actor.world.pos);
|
||||
effectPos.x += Math_SinS(this->actor.world.rot.y + (s16)this->headRot.y) * 10.0f;
|
||||
effectPos.x += Math_SinS(this->actor.world.rot.y + TRUNCF_BINANG(this->headRot.y)) * 10.0f;
|
||||
effectPos.y += 30.0f;
|
||||
effectPos.z += Math_CosS(this->actor.world.rot.y + (s16)this->headRot.y) * 10.0f;
|
||||
effectPos.z += Math_CosS(this->actor.world.rot.y + TRUNCF_BINANG(this->headRot.y)) * 10.0f;
|
||||
Matrix_Push();
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW);
|
||||
effectVelocityOffset.z = 20.0f;
|
||||
|
@ -344,8 +344,8 @@ void EnMinifrog_SetupNextFrogInit(EnMinifrog* this, PlayState* play) {
|
||||
if (nextFrog != NULL) {
|
||||
missingFrog = nextFrog->frog;
|
||||
if (nextFrog->frog != NULL) {
|
||||
this->actor.home.rot.y =
|
||||
(s16)Actor_WorldYawTowardActor(&this->actor, &missingFrog->actor); // Set home to missing frog
|
||||
// Set home to missing frog
|
||||
this->actor.home.rot.y = Actor_WorldYawTowardActor(&this->actor, &missingFrog->actor);
|
||||
EnMinifrog_TurnToMissingFrog(this);
|
||||
} else {
|
||||
EnMinifrog_TurnToPlayer(this);
|
||||
|
@ -161,7 +161,7 @@ void func_80965DB4(EnMm* this, PlayState* play) {
|
||||
direction = BINANG_ROT180(direction);
|
||||
}
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, direction, this->actor.speed * 100.0f);
|
||||
this->unk_190 += (s16)(this->actor.speed * 800.0f);
|
||||
this->unk_190 += TRUNCF_BINANG(this->actor.speed * 800.0f);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
|
@ -624,7 +624,7 @@ void func_80A69ADC(Actor* thisx) {
|
||||
} else {
|
||||
this->unk_366 = ((s32)Rand_Next() > 0) ? 2000 : -2000;
|
||||
}
|
||||
this->unk_366 += (s16)(((Rand_ZeroOne() * (1.0f - this->unk_358)) - 0.5f) * 0x400);
|
||||
this->unk_366 += TRUNCF_BINANG(((Rand_ZeroOne() * (1.0f - this->unk_358)) - 0.5f) * 0x400);
|
||||
} else {
|
||||
this->unk_360 = 0.0f;
|
||||
this->unk_364 = -0x8000;
|
||||
@ -1033,7 +1033,7 @@ void func_80A6AE7C(EnMushi2* this, PlayState* play) {
|
||||
this->actor.shape.rot.y += 0xC8;
|
||||
this->actor.speed += (Rand_ZeroOne() - 0.5f) * 0.16f;
|
||||
this->actor.speed *= 0.9f;
|
||||
this->actor.world.rot.y += (s16)((Rand_ZeroOne() - 0.5f) * 2000.0f);
|
||||
this->actor.world.rot.y += TRUNCF_BINANG((Rand_ZeroOne() - 0.5f) * 2000.0f);
|
||||
this->actor.gravity = -0.04f - (Rand_ZeroOne() * 0.02f);
|
||||
this->actor.velocity.y *= 0.95f;
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
|
@ -325,7 +325,7 @@ s32 func_80BC01DC(Actor* thisx, PlayState* play) {
|
||||
|
||||
case ENNB_BEHAVIOUR_2:
|
||||
// Slowly increase alpha to fill the screen with a black rectangle
|
||||
R_PLAY_FILL_SCREEN_ALPHA = (s16)(s32)(255.0f - (((f32)ABS_ALT(20 - this->storyTimer) / 20.0f) * 255.0f));
|
||||
R_PLAY_FILL_SCREEN_ALPHA = TRUNCF_BINANG(255.0f - (((f32)ABS_ALT(20 - this->storyTimer) / 20.0f) * 255.0f));
|
||||
|
||||
if (this->storyTimer == 20) {
|
||||
if (CHECK_EVENTINF(EVENTINF_42)) {
|
||||
|
@ -721,8 +721,8 @@ s32 EnNeoReeba_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
|
||||
EnNeoReeba* this = THIS;
|
||||
|
||||
if ((limbIndex == OBJECT_RB_LIMB_03) && (this->rotationSpeed != 0.0f)) {
|
||||
rot->y += (s16)(this->rotationSpeed * Math_SinS(this->rotationAngle));
|
||||
rot->z += (s16)(this->rotationSpeed * Math_CosS(this->rotationAngle));
|
||||
rot->y += TRUNCF_BINANG(this->rotationSpeed * Math_SinS(this->rotationAngle));
|
||||
rot->z += TRUNCF_BINANG(this->rotationSpeed * Math_CosS(this->rotationAngle));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -434,9 +434,9 @@ void EnNiw_Held(EnNiw* this, PlayState* play) {
|
||||
this->heldTimer = (s32)(Rand_ZeroFloat(1.0f) * 10.0f) + 10;
|
||||
}
|
||||
|
||||
this->actor.shape.rot.x = (s16)(s32)Rand_CenteredFloat(0x1388) + this->actor.world.rot.x;
|
||||
this->actor.shape.rot.y = (s16)(s32)Rand_CenteredFloat(0x1388) + this->actor.world.rot.y;
|
||||
this->actor.shape.rot.z = (s16)(s32)Rand_CenteredFloat(0x1388) + this->actor.world.rot.z;
|
||||
this->actor.shape.rot.x = TRUNCF_BINANG(Rand_CenteredFloat(0x1388)) + this->actor.world.rot.x;
|
||||
this->actor.shape.rot.y = TRUNCF_BINANG(Rand_CenteredFloat(0x1388)) + this->actor.world.rot.y;
|
||||
this->actor.shape.rot.z = TRUNCF_BINANG(Rand_CenteredFloat(0x1388)) + this->actor.world.rot.z;
|
||||
if (this->niwType == NIW_TYPE_REGULAR) {
|
||||
if (Actor_HasNoParent(&this->actor, play)) {
|
||||
this->actor.shape.rot.z = 0;
|
||||
@ -908,20 +908,20 @@ s32 EnNiw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
EnNiw* this = THIS;
|
||||
|
||||
if (limbIndex == NIW_LIMB_UPPER_BODY) {
|
||||
rot->y += (s16)this->upperBodyRotY;
|
||||
rot->y += TRUNCF_BINANG(this->upperBodyRotY);
|
||||
}
|
||||
if (limbIndex == NIW_LIMB_HEAD) {
|
||||
rot->y += (s16)this->headRotY;
|
||||
rot->y += TRUNCF_BINANG(this->headRotY);
|
||||
}
|
||||
if (limbIndex == NIW_LIMB_RIGHT_WING_ROOT) {
|
||||
rot->x += (s16)this->rightWingRotX;
|
||||
rot->y += (s16)this->rightWingRotY;
|
||||
rot->z += (s16)this->rightWingRotZ;
|
||||
rot->x += TRUNCF_BINANG(this->rightWingRotX);
|
||||
rot->y += TRUNCF_BINANG(this->rightWingRotY);
|
||||
rot->z += TRUNCF_BINANG(this->rightWingRotZ);
|
||||
}
|
||||
if (limbIndex == NIW_LIMB_LEFT_WING_ROOT) {
|
||||
rot->x += (s16)this->leftWingRotX;
|
||||
rot->y += (s16)this->leftWingRotY;
|
||||
rot->z += (s16)this->leftWingRotZ;
|
||||
rot->x += TRUNCF_BINANG(this->leftWingRotX);
|
||||
rot->y += TRUNCF_BINANG(this->leftWingRotY);
|
||||
rot->z += TRUNCF_BINANG(this->leftWingRotZ);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ void EnNwc_ChangeState(EnNwc* this, s16 newState) {
|
||||
case NWC_STATE_TURNING:
|
||||
this->stateTimer = Rand_ZeroFloat(20.0f) + 15.0f;
|
||||
this->actionFunc = EnNwc_Turn;
|
||||
this->fallingRotY = (s16)(s32)Rand_CenteredFloat(0x10000);
|
||||
this->fallingRotY = TRUNCF_BINANG(Rand_CenteredFloat(0x10000));
|
||||
break;
|
||||
|
||||
case NWC_STATE_HOPPING_FORWARD:
|
||||
@ -190,7 +190,7 @@ void EnNwc_ChangeState(EnNwc* this, s16 newState) {
|
||||
case NWC_STATE_FOLLOWING:
|
||||
this->actionFunc = EnNwc_Follow;
|
||||
this->transformTimer = 0;
|
||||
this->randomRot = (s16)(s32)Rand_CenteredFloat(0x2710);
|
||||
this->randomRot = TRUNCF_BINANG(Rand_CenteredFloat(0x2710));
|
||||
break;
|
||||
|
||||
case NWC_STATE_RUNNING:
|
||||
@ -305,7 +305,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) {
|
||||
if ((this->grog->actor.home.rot.z >= 20) && // all 10 chicks have been found
|
||||
!(this->hasGrownUp & 1)) {
|
||||
this->transformTimer += 2;
|
||||
if (this->transformTimer >= (s32)(s16)((this->actor.home.rot.z * 0x1E) + 0x1E)) {
|
||||
if (this->transformTimer >= (s16)((this->actor.home.rot.z * 0x1E) + 0x1E)) {
|
||||
// it is our turn to transform
|
||||
this->hasGrownUp |= 1;
|
||||
this->grog->actor.home.rot.x += 2; // increment grog's adult tranformation counter
|
||||
@ -328,7 +328,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) {
|
||||
}
|
||||
|
||||
} else { // not too close: keep moving
|
||||
this->randomRot += (s16)(s32)Rand_CenteredFloat(0x5DC);
|
||||
this->randomRot += TRUNCF_BINANG(Rand_CenteredFloat(0x5DC));
|
||||
if (this->randomRot > 0x1388) {
|
||||
this->randomRot = 0x1388;
|
||||
} else if (this->randomRot < -0x1388) {
|
||||
|
@ -1745,8 +1745,8 @@ void EnOssan_CuriosityShopMan_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx**
|
||||
|
||||
if ((limbIndex == FSN_LIMB_PELVIS) || (limbIndex == FSN_LIMB_LEFT_UPPER_ARM) ||
|
||||
(limbIndex == FSN_LIMB_RIGHT_UPPER_ARM)) {
|
||||
rot->y += (s16)Math_SinS(this->fidgetTableY[limbIndex]) * 200;
|
||||
rot->z += (s16)Math_CosS(this->fidgetTableZ[limbIndex]) * 200;
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[limbIndex])) * 200;
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[limbIndex])) * 200;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1145,13 +1145,13 @@ s32 EnOwl_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
|
||||
case OWL_FLYING_LIMB_RIGHT_EYEBROW: // OWL_PERCHING_LIMB_RIGHT_EYEBROW
|
||||
if (!(this->actionFlags & 8)) {
|
||||
rot->y -= (s16)(this->unk_3D8 * 1.5f);
|
||||
rot->y -= TRUNCF_BINANG(this->unk_3D8 * 1.5f);
|
||||
}
|
||||
break;
|
||||
|
||||
case OWL_FLYING_LIMB_LEFT_EYEBROW: // OWL_PERCHING_LIMB_LEFT_EYEBROW
|
||||
if (!(this->actionFlags & 8)) {
|
||||
rot->y += (s16)(this->unk_3D8 * 1.5f);
|
||||
rot->y += TRUNCF_BINANG(this->unk_3D8 * 1.5f);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -43,7 +43,7 @@ void func_80865390(EnPart* this, PlayState* play) {
|
||||
switch (this->actor.params) {
|
||||
case ENPART_TYPE_1:
|
||||
case ENPART_TYPE_4:
|
||||
this->unk146 += (s16)(Rand_ZeroOne() * 17.0f) + 5;
|
||||
this->unk146 += TRUNCF_BINANG(Rand_ZeroOne() * 17.0f) + 5;
|
||||
this->actor.velocity.y = Rand_ZeroOne() * 5.0f + 4.0f;
|
||||
this->actor.gravity = -0.6f - (Rand_ZeroOne() * 0.5f);
|
||||
this->unk14C = 0.15f;
|
||||
|
@ -774,7 +774,7 @@ void EnPeehat_Update(Actor* thisx, PlayState* play2) {
|
||||
}
|
||||
|
||||
Collider_UpdateCylinder(thisx, &this->colliderCylinder);
|
||||
this->colliderCylinder.dim.pos.y += (s16)(thisx->shape.yOffset * thisx->scale.y);
|
||||
this->colliderCylinder.dim.pos.y += TRUNCF_BINANG(thisx->shape.yOffset * thisx->scale.y);
|
||||
if (this->colliderCylinder.base.ocFlags1 & OC1_ON) {
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base);
|
||||
}
|
||||
|
@ -735,9 +735,9 @@ void EnPoComposer_Draw(Actor* thisx, PlayState* play) {
|
||||
Matrix_Put(&play->billboardMtxF);
|
||||
Matrix_MultVecZ(15.0f, &lightOffset);
|
||||
lightPos = this->lanternCollider.elements[0].dim.worldSphere.center;
|
||||
lightPos.x += (s16)lightOffset.x;
|
||||
lightPos.y += (s16)lightOffset.y;
|
||||
lightPos.z += (s16)lightOffset.z;
|
||||
lightPos.x += TRUNCF_BINANG(lightOffset.x);
|
||||
lightPos.y += TRUNCF_BINANG(lightOffset.y);
|
||||
lightPos.z += TRUNCF_BINANG(lightOffset.z);
|
||||
|
||||
Lights_PointGlowSetInfo(&this->lightInfo, lightPos.x, lightPos.y, lightPos.z, this->envColor.r, this->envColor.g,
|
||||
this->envColor.b, this->envColor.a * (200.0f / 255.0f));
|
||||
|
@ -301,8 +301,8 @@ s32 EnPoFusen_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
|
||||
} else if (limbIndex == POE_BALLOON_LEFT_HAND) {
|
||||
rot->z += this->limbRotLeftHand;
|
||||
} else if (limbIndex == POE_BALLOON_LIMB_CHAIN_AND_LANTERN) {
|
||||
rot->y += (s16)(this->limbRotChainAndLantern * Math_SinS(this->randBaseRotChange));
|
||||
rot->z += (s16)(this->limbRotChainAndLantern * Math_CosS(this->randBaseRotChange));
|
||||
rot->y += TRUNCF_BINANG(this->limbRotChainAndLantern * Math_SinS(this->randBaseRotChange));
|
||||
rot->z += TRUNCF_BINANG(this->limbRotChainAndLantern * Math_CosS(this->randBaseRotChange));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ void EnPoSisters_SetupAttackConnect(EnPoSisters* this) {
|
||||
|
||||
void EnPoSisters_AttackConnectDrift(EnPoSisters* this, PlayState* play) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->actor.shape.rot.y -= (s16)(this->actor.speed * 10.0f * 128.0f);
|
||||
this->actor.shape.rot.y -= TRUNCF_BINANG(this->actor.speed * 10.0f * 128.0f);
|
||||
|
||||
if (Math_StepToF(&this->actor.speed, 0.0f, 0.1f)) { // wait to stop moving
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
@ -823,8 +823,8 @@ void EnPoSisters_MegSurroundPlayer(EnPoSisters* this, PlayState* play) {
|
||||
if (this->megCloneId == POE_SISTERS_MEG_REAL) {
|
||||
if (ABS_ALT(16 - this->floatingBobbingTimer) < 14) {
|
||||
// Every N frames rotate around player. The fewer Meg clones remaining the faster they spin.
|
||||
this->actor.shape.rot.y += (s16)((0x580 - (this->megClonesRemaining * 0x180)) *
|
||||
fabsf(Math_SinS(this->floatingBobbingTimer * 0x800)));
|
||||
this->actor.shape.rot.y += TRUNCF_BINANG((0x580 - (this->megClonesRemaining * 0x180)) *
|
||||
fabsf(Math_SinS(this->floatingBobbingTimer * 0x800)));
|
||||
}
|
||||
|
||||
// Twirl the real Meg backwards for a bit for a visual tell to player.
|
||||
|
@ -1481,9 +1481,9 @@ s32 EnPp_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
||||
}
|
||||
|
||||
if (limbIndex == HIPLOOP_LIMB_MASK) {
|
||||
rot->x += (s16)this->maskRot.x;
|
||||
rot->y += (s16)this->maskRot.y;
|
||||
rot->z += (s16)this->maskRot.z;
|
||||
rot->x += TRUNCF_BINANG(this->maskRot.x);
|
||||
rot->y += TRUNCF_BINANG(this->maskRot.y);
|
||||
rot->z += TRUNCF_BINANG(this->maskRot.z);
|
||||
pos->x += this->maskPos.x;
|
||||
pos->y += this->maskPos.y;
|
||||
pos->z += this->maskPos.z;
|
||||
|
@ -716,7 +716,7 @@ s32 EnPr2_OverrideLimbDrawOpa(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f
|
||||
|
||||
if (this->unk_1E0 < 10) {
|
||||
if (limbIndex == OBJECT_PR_2_LIMB_02) {
|
||||
rot->y += (s16)this->unk_1FC * -1;
|
||||
rot->y += TRUNCF_BINANG(this->unk_1FC) * -1;
|
||||
}
|
||||
} else if ((limbIndex + 10) != this->unk_1E0) {
|
||||
*dList = NULL;
|
||||
@ -742,7 +742,7 @@ s32 EnPr2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
|
||||
if (this->unk_1E0 < 10) {
|
||||
if (limbIndex == OBJECT_PR_2_LIMB_02) {
|
||||
rot->y += (s16)this->unk_1FC * -1;
|
||||
rot->y += TRUNCF_BINANG(this->unk_1FC) * -1;
|
||||
}
|
||||
} else if ((limbIndex + 10) != this->unk_1E0) {
|
||||
*dList = NULL;
|
||||
|
@ -306,7 +306,7 @@ void func_80A76634(EnPrz* this, PlayState* play) {
|
||||
if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->unk_1E4)) < 0x100) {
|
||||
if (func_80A762C0(this, play) != 0) {
|
||||
this->unk_1E4 += 0x1500;
|
||||
this->unk_1E4 += (s16)Rand_ZeroFloat(5000.0f);
|
||||
this->unk_1E4 += TRUNCF_BINANG(Rand_ZeroFloat(5000.0f));
|
||||
} else if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (player->actor.floorHeight < 30.0f)) {
|
||||
this->actionFunc = func_80A763E8;
|
||||
} else {
|
||||
@ -502,7 +502,7 @@ s32 EnPrz_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
EnPrz* this = THIS;
|
||||
|
||||
if (limbIndex == OBJECT_PR_2_LIMB_02) {
|
||||
rot->y += (s16)this->unk_218 * -100;
|
||||
rot->y += TRUNCF_BINANG(this->unk_218) * -100;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ void EnRacedog_Init(Actor* thisx, PlayState* play) {
|
||||
// meaning that the IDs are just whatever their default values in sDogInfo are. As a result,
|
||||
// the blue dog, one beige dog, one white dog, one brown dog, and two gray dogs never bother
|
||||
// to do the random 1/20 check here, regardless of anything else.
|
||||
if ((sDogInfo[this->index].textId > 0x353E) && (this->index == (s16)Rand_ZeroFloat(20.0f))) {
|
||||
if ((sDogInfo[this->index].textId > 0x353E) && (this->index == TRUNCF_BINANG(Rand_ZeroFloat(20.0f)))) {
|
||||
this->extraTimeBeforeRaceStart = 5;
|
||||
} else {
|
||||
this->extraTimeBeforeRaceStart = 0;
|
||||
|
@ -820,7 +820,7 @@ void EnRaf_TransformLimbDraw(PlayState* play2, s32 limbIndex, Actor* thisx) {
|
||||
(limbIndex == CARNIVOROUS_LILY_PAD_LIMB_TRAP_3_MIDDLE_SEGMENT) ||
|
||||
(limbIndex == CARNIVOROUS_LILY_PAD_LIMB_TRAP_2_MIDDLE_SEGMENT)) {
|
||||
for (i = 0; i < ARRAY_COUNT(sGrabAnimationCheckFrames); i++) {
|
||||
if ((s16)this->skelAnime.curFrame == sGrabAnimationCheckFrames[i]) {
|
||||
if (TRUNCF_BINANG(this->skelAnime.curFrame) == sGrabAnimationCheckFrames[i]) {
|
||||
Math_Vec3f_Copy(&this->targetLimbScale[limbIndex], &sMiddleSegmentTargetScaleDuringGrab[i]);
|
||||
}
|
||||
}
|
||||
@ -830,7 +830,7 @@ void EnRaf_TransformLimbDraw(PlayState* play2, s32 limbIndex, Actor* thisx) {
|
||||
(limbIndex == CARNIVOROUS_LILY_PAD_LIMB_TRAP_3_UPPER_SEGMENT) ||
|
||||
(limbIndex == CARNIVOROUS_LILY_PAD_LIMB_TRAP_2_UPPER_SEGMENT)) {
|
||||
for (i = 0; i < ARRAY_COUNT(sGrabAnimationCheckFrames); i++) {
|
||||
if ((s16)this->skelAnime.curFrame == sGrabAnimationCheckFrames[i]) {
|
||||
if (TRUNCF_BINANG(this->skelAnime.curFrame) == sGrabAnimationCheckFrames[i]) {
|
||||
Math_Vec3f_Copy(&this->targetLimbScale[limbIndex], &sUpperSegmentTargetScaleDuringGrab[i]);
|
||||
}
|
||||
}
|
||||
@ -866,7 +866,7 @@ void EnRaf_TransformLimbDraw(PlayState* play2, s32 limbIndex, Actor* thisx) {
|
||||
(limbIndex == CARNIVOROUS_LILY_PAD_LIMB_TRAP_3_MIDDLE_SEGMENT) ||
|
||||
(limbIndex == CARNIVOROUS_LILY_PAD_LIMB_TRAP_2_MIDDLE_SEGMENT)) {
|
||||
for (i = 0; i < ARRAY_COUNT(sSpitAnimationCheckFrames); i++) {
|
||||
if ((s16)this->skelAnime.curFrame == sSpitAnimationCheckFrames[i]) {
|
||||
if (TRUNCF_BINANG(this->skelAnime.curFrame) == sSpitAnimationCheckFrames[i]) {
|
||||
Math_Vec3f_Copy(&this->targetLimbScale[limbIndex], &sMiddleSegmentTargetScaleDuringSpit[i]);
|
||||
}
|
||||
}
|
||||
@ -876,7 +876,7 @@ void EnRaf_TransformLimbDraw(PlayState* play2, s32 limbIndex, Actor* thisx) {
|
||||
(limbIndex == CARNIVOROUS_LILY_PAD_LIMB_TRAP_3_UPPER_SEGMENT) ||
|
||||
(limbIndex == CARNIVOROUS_LILY_PAD_LIMB_TRAP_2_UPPER_SEGMENT)) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
if ((s16)this->skelAnime.curFrame == sSpitAnimationCheckFrames[i]) {
|
||||
if (TRUNCF_BINANG(this->skelAnime.curFrame) == sSpitAnimationCheckFrames[i]) {
|
||||
Math_Vec3f_Copy(&this->targetLimbScale[limbIndex], &sUpperSegmentTargetScaleDuringSpit[i]);
|
||||
}
|
||||
}
|
||||
|
@ -700,8 +700,8 @@ void EnRailgibud_SpawnDust(PlayState* play, Vec3f* basePos, f32 randomnessScale,
|
||||
|
||||
dustVelocity.x *= 0.5f;
|
||||
dustVelocity.z *= 0.5f;
|
||||
func_800B1210(play, &dustPos, &dustVelocity, &dustAccel, (s16)(Rand_ZeroOne() * dustScale * 0.2f) + dustScale,
|
||||
scaleStep);
|
||||
func_800B1210(play, &dustPos, &dustVelocity, &dustAccel,
|
||||
TRUNCF_BINANG(Rand_ZeroOne() * dustScale * 0.2f) + dustScale, scaleStep);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,9 +335,9 @@ void EnRat_ChooseDirection(EnRat* this) {
|
||||
angle -= 0x8000;
|
||||
}
|
||||
|
||||
angle += (s16)(s32)Rand_CenteredFloat(0x800);
|
||||
angle += TRUNCF_BINANG(Rand_CenteredFloat(0x800));
|
||||
} else {
|
||||
angle = (Rand_ZeroOne() < 0.1f) ? (s16)(s32)Rand_CenteredFloat(0x800) : 0;
|
||||
angle = (Rand_ZeroOne() < 0.1f) ? TRUNCF_BINANG(Rand_CenteredFloat(0x800)) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,7 @@ s32 func_80BF42BC(EnRg* this, f32 arg1) {
|
||||
|
||||
this->actor.shape.yOffset = this->actor.scale.y * 100.0f * 14.0f;
|
||||
if (!(this->unk_310 & 0x1000)) {
|
||||
this->actor.shape.rot.x += (s16)(13650.0f * sp2C);
|
||||
this->actor.shape.rot.x += TRUNCF_BINANG(0x3552 * sp2C);
|
||||
}
|
||||
|
||||
this->actor.world.rot.x = this->actor.shape.rot.x;
|
||||
@ -851,8 +851,8 @@ s32 EnRg_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
||||
}
|
||||
|
||||
if ((this->unk_310 & 8) && (fidgetIndex < 9)) {
|
||||
rot->y += (s16)(Math_SinS(this->fidgetTableY[fidgetIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->fidgetTableZ[fidgetIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[fidgetIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[fidgetIndex]) * 200.0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -335,8 +335,8 @@ s32 EnRu_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
||||
|
||||
if ((limbIndex == RU2_LIMB_TORSO) || (limbIndex == RU2_LIMB_LEFT_UPPER_ARM) ||
|
||||
(limbIndex == RU2_LIMB_RIGHT_UPPER_ARM)) {
|
||||
rot->y += (s16)(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -739,7 +739,7 @@ void EnSob1_EndWalk(EnSob1* this, PlayState* play) {
|
||||
s32 pad;
|
||||
f32 distSq;
|
||||
s16 curFrame = this->skelAnime.curFrame / this->skelAnime.playSpeed;
|
||||
s16 animLastFrame = Animation_GetLastFrame(&gBombShopkeeperWalkAnim) / (s16)this->skelAnime.playSpeed;
|
||||
s16 animLastFrame = Animation_GetLastFrame(&gBombShopkeeperWalkAnim) / TRUNCF_BINANG(this->skelAnime.playSpeed);
|
||||
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y,
|
||||
EnSob1_GetDistSqAndOrient(this->path, this->waypoint - 1, &this->actor.world.pos, &distSq), 4,
|
||||
|
@ -310,7 +310,7 @@ void EnSsh_Turn(EnSsh* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (DECR(this->spinTimer) != 0) {
|
||||
this->actor.world.rot.y += (s16)(0x2710 * (this->spinTimer / 30.0f));
|
||||
this->actor.world.rot.y += TRUNCF_BINANG(0x2710 * (this->spinTimer / 30.0f));
|
||||
} else if ((this->swayTimer == 0) && (this->stunTimer == 0)) {
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 4, 0x2710, 1);
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ void func_808A54B0(EnSt* this, PlayState* play) {
|
||||
|
||||
s32 func_808A576C(EnSt* this) {
|
||||
s32 i;
|
||||
s16 phi_s2 = (s16)((s16)(Rand_ZeroOne() * 1000.0f) % 12) * 0x1555;
|
||||
s16 phi_s2 = (s16)(TRUNCF_BINANG(Rand_ZeroOne() * 1000.0f) % 12) * 0x1555;
|
||||
|
||||
for (i = 0; i < ENST_BODYPART_MAX; i++, phi_s2 += 0x1555) {
|
||||
if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
|
||||
|
@ -708,8 +708,8 @@ s32 EnSth_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
|
||||
if ((limbIndex == STH_LIMB_CHEST) || (limbIndex == STH_LIMB_LEFT_FOREARM) ||
|
||||
(limbIndex == STH_LIMB_RIGHT_FOREARM)) {
|
||||
rot->y += (s16)(Math_SinS(play->state.frames * ((limbIndex * 50) + 0x814)) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(play->state.frames * ((limbIndex * 50) + 0x940)) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(play->state.frames * ((limbIndex * 50) + 0x814)) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(play->state.frames * ((limbIndex * 50) + 0x940)) * 200.0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -85,8 +85,8 @@ s32 EnSth2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
}
|
||||
if ((limbIndex == STH_LIMB_CHEST) || (limbIndex == STH_LIMB_LEFT_FOREARM) ||
|
||||
(limbIndex == STH_LIMB_RIGHT_FOREARM)) {
|
||||
rot->y += (s16)(Math_SinS(play->state.frames * ((limbIndex * 50) + 0x814)) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(play->state.frames * ((limbIndex * 50) + 0x940)) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(play->state.frames * ((limbIndex * 50) + 0x814)) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(play->state.frames * ((limbIndex * 50) + 0x940)) * 200.0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ void func_80AE7F34(EnStopheishi* this, PlayState* play) {
|
||||
f32 zDiff;
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if ((this->currentAnim == SOLDIER_ANIM_5) && (((s16)this->skelAnime.curFrame % 2) != 0)) {
|
||||
if ((this->currentAnim == SOLDIER_ANIM_5) && ((TRUNCF_BINANG(this->skelAnime.curFrame) % 2) != 0)) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_SOLDIER_WALK);
|
||||
}
|
||||
if (gSaveContext.save.day != 3) {
|
||||
|
@ -1577,8 +1577,8 @@ s32 EnSuttari_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
|
||||
Matrix_RotateZS(-this->torsoRot.x, MTXMODE_APPLY);
|
||||
}
|
||||
if ((limbIndex == 8) || (limbIndex == 9) || (limbIndex == 0xC)) {
|
||||
rot->y += (s16)(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += (s16)(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f);
|
||||
rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f);
|
||||
rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -756,7 +756,7 @@ void func_808DA3F4(EnSw* this, PlayState* play) {
|
||||
|
||||
if (!Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
temp_f16 = this->skelAnime.endFrame - this->skelAnime.curFrame;
|
||||
temp_s1 = (s16)(80.0f * temp_f16);
|
||||
temp_s1 = TRUNCF_BINANG(80.0f * temp_f16);
|
||||
Math_Vec3f_Copy(&sp38, &this->unk_374);
|
||||
func_808D9894(this, &sp38);
|
||||
|
||||
|
@ -292,9 +292,9 @@ s32 EnSyatekiCrow_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList,
|
||||
EnSyatekiCrow* this = THIS;
|
||||
|
||||
if (limbIndex == OBJECT_CROW_LIMB_UPPER_TAIL) {
|
||||
rot->y += (s16)(0xC00 * Math_SinF(this->skelAnime.curFrame * (M_PI / 4)));
|
||||
rot->y += TRUNCF_BINANG(0xC00 * Math_SinF(this->skelAnime.curFrame * (M_PI / 4)));
|
||||
} else if (limbIndex == OBJECT_CROW_LIMB_TAIL) {
|
||||
rot->y += (s16)(0x1400 * Math_SinF((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
|
||||
rot->y += TRUNCF_BINANG(0x1400 * Math_SinF((this->skelAnime.curFrame + 2.5f) * (M_PI / 4)));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -254,7 +254,7 @@ void func_80BB6BD8(EnTanron2* this, PlayState* play) {
|
||||
case 2:
|
||||
sp32 = Math_Atan2S(player->actor.world.pos.x - this->actor.world.pos.x,
|
||||
player->actor.world.pos.z - this->actor.world.pos.z) +
|
||||
(s16)Rand_ZeroFloat(20000.0f);
|
||||
TRUNCF_BINANG(Rand_ZeroFloat(20000.0f));
|
||||
this->actor.speed = Rand_ZeroFloat(7.0f) + 7.0f;
|
||||
if ((this->unk_152 == 0) && (D_80BB8450->unk_1F6 == 0)) {
|
||||
this->unk_158 = 1;
|
||||
|
@ -297,17 +297,17 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) {
|
||||
this->actor.speed = Rand_ZeroFloat(2.0f) + 2.0f;
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
this->targetShapeRotation.x =
|
||||
(s16)(s32)Rand_CenteredFloat(0x1F4) + this->targetShapeRotation.x + 0x8000;
|
||||
TRUNCF_BINANG(Rand_CenteredFloat(0x1F4)) + this->targetShapeRotation.x + 0x8000;
|
||||
}
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
this->targetShapeRotation.z =
|
||||
(s16)(s32)Rand_CenteredFloat(0x1F4) + this->targetShapeRotation.z + 0x8000;
|
||||
TRUNCF_BINANG(Rand_CenteredFloat(0x1F4)) + this->targetShapeRotation.z + 0x8000;
|
||||
}
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
this->targetShapeRotation.y = (s16)Rand_ZeroFloat(0x10000);
|
||||
this->targetShapeRotation.y = TRUNCF_BINANG(Rand_ZeroFloat(0x10000));
|
||||
}
|
||||
this->actor.world.rot.y = Math_Atan2S_XY(this->actor.world.pos.z, this->actor.world.pos.x) +
|
||||
(s16)(s32)Rand_CenteredFloat(0xCE20);
|
||||
TRUNCF_BINANG(Rand_CenteredFloat(0xCE20));
|
||||
}
|
||||
|
||||
Math_ApproachS(&this->actor.shape.rot.y, this->targetShapeRotation.y, 3, 0x500);
|
||||
|
@ -1219,8 +1219,8 @@ void EnTest6_DrawThreeDayResetSoTCutscene(EnTest6* this, PlayState* play) {
|
||||
// The `& 0x3C` ensures the angle only updates once every 4 frames
|
||||
angle = (play->state.frames & 0x3C) * 1024;
|
||||
angle *= this->clockSpeed / 200.0f;
|
||||
this->clockAngle += (s16)this->clockSpeed;
|
||||
this->clockRingRotZ = (s16)((this->clockSpeed / 200.0f) * 256.0f);
|
||||
this->clockAngle += TRUNCF_BINANG(this->clockSpeed);
|
||||
this->clockRingRotZ = TRUNCF_BINANG((this->clockSpeed / 200.0f) * 256.0f);
|
||||
|
||||
// Draw 2 clocks per loop
|
||||
for (i = 0; i < (SOTCS_RESET_NUM_CLOCKS / 2); i++) {
|
||||
@ -1284,7 +1284,7 @@ void EnTest6_DrawDoubleSoTCutscene(EnTest6* this, PlayState* play) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
this->gfx = POLY_OPA_DISP;
|
||||
this->clockAngle += (s16)this->clockSpeed;
|
||||
this->clockAngle += TRUNCF_BINANG(this->clockSpeed);
|
||||
this->clockRingRotZ = this->clockAngle * 2;
|
||||
|
||||
// The `& 0x3C` ensures the clock only turns once every 4 frames.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user