summaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
authorSonic Dreamcaster <alejandro.asenjo88@gmail.com>2024-11-17 02:40:33 -0300
committerSonic Dreamcaster <alejandro.asenjo88@gmail.com>2024-11-17 02:40:33 -0300
commit79cd27cb092a999a0200590e1c6ea016ba808ffe (patch)
tree3c3d4f688305d448c78f8beb242cf541919b64a7 /src/engine
parent59e0fda2d1c2edb8674ae312f2424fa3a1f766d4 (diff)
Fix Corneria and Venom 1 Backgrounds
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/fox_bg.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c
index 2feeda85..df831bbe 100644
--- a/src/engine/fox_bg.c
+++ b/src/engine/fox_bg.c
@@ -501,8 +501,22 @@ void Background_DrawBackdrop(void) {
Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f, 7280.0f);
f32 corneriaCamYawDeg = Math_RadToDeg(gPlayer[0].camYaw);
- if (corneriaCamYawDeg < 180.0f) {
- sp13C = -(7280.0f - sp13C);
+ if (gLevelMode == LEVELMODE_ON_RAILS) {
+ if (corneriaCamYawDeg < 180.0f) {
+ sp13C = -(7280.0f - sp13C);
+ }
+ }
+
+ 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__);
}
// gTestVarF = sp13C;
@@ -514,8 +528,14 @@ void Background_DrawBackdrop(void) {
// Render the textures across a wider range to cover the screen
for (int i = 0; i < 10; i++) {
- FrameInterpolation_RecordOpenChild("Backdrop", i);
- FrameInterpolation_RecordMarker(__FILE__, __LINE__);
+ if (skipInterpolation) {
+ // @port Skip interpolation
+ FrameInterpolation_ShouldInterpolateFrame(false);
+ } else {
+ // @port: Tag the transform.
+ FrameInterpolation_RecordOpenChild("Backdrop", 0);
+ FrameInterpolation_RecordMarker(__FILE__, __LINE__);
+ }
switch ((s32) gCurrentLevel) {
case LEVEL_CORNERIA:
@@ -530,9 +550,15 @@ void Background_DrawBackdrop(void) {
Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
- // @port Pop the transform id.
- FrameInterpolation_RecordCloseChild();
+ if (skipInterpolation) {
+ // @port Skip interpolation
+ FrameInterpolation_ShouldInterpolateFrame(false);
+ } else {
+ // @port Pop the transform id.
+ FrameInterpolation_RecordCloseChild();
+ }
}
+ bgPrevPosX = sp13C;
break;
}