fix venom andross background

This commit is contained in:
Sonic Dreamcaster 2024-11-17 02:25:42 -03:00
parent 390a3c9975
commit 59e0fda2d1

View File

@ -538,9 +538,21 @@ void Background_DrawBackdrop(void) {
case LEVEL_VENOM_ANDROSS: // WIP
if (gDrawBackdrop != 6) {
sp134 = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.4f);
sp13C =
Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f, 7280.0f);
static f32 bgPrevPosX = 0.0f;
u8 skipInterpolation = (fabsf(sp13C - bgPrevPosX) > 7280.0f / 2.0f);
if (skipInterpolation) {
// @port Skip interpolation
FrameInterpolation_ShouldInterpolateFrame(false);
} else {
// @port: Tag the transform.
FrameInterpolation_RecordOpenChild("Backdrop", 0);
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
}
if ((gDrawBackdrop == 2) || (gDrawBackdrop == 7)) {
Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY);
@ -563,10 +575,6 @@ void Background_DrawBackdrop(void) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, (s32) gAndrossUnkBrightness,
(s32) gAndrossUnkBrightness, (s32) gAndrossUnkAlpha);
sp134 = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.4f);
sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f,
7280.0f);
// Leftmost DL (-2x translation)
Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, sp13C - 2 * 7280.0f, -2000.0f + sp134, -6000.0f, MTXF_APPLY);
@ -618,9 +626,15 @@ void Background_DrawBackdrop(void) {
Matrix_Pop(&gGfxMatrix);
}
}
if (skipInterpolation) {
// @port Skip interpolation
FrameInterpolation_ShouldInterpolateFrame(false);
} else {
// @port Pop the transform id.
FrameInterpolation_RecordCloseChild();
}
bgPrevPosX = sp13C;
}
break;
case LEVEL_AQUAS: