From 2a17d9e831cc56409cb6f44232df1a459a8753fd Mon Sep 17 00:00:00 2001 From: MysterD Date: Sat, 26 Sep 2020 22:00:34 -0700 Subject: [PATCH] Make 60 fps behave better for infinite stairs --- src/game/camera.c | 1 + src/game/rendering_graph_node.c | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/game/camera.c b/src/game/camera.c index 4564a255..a9f4509b 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -5320,6 +5320,7 @@ void warp_camera(f32 displacementX, f32 displacementY, f32 displacementZ) { vec3f_add(start->pos, displacement); vec3f_add(end->focus, displacement); vec3f_add(end->pos, displacement); + skip_camera_interpolation(); } /** diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index 0a84255a..a511ac57 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -917,7 +917,8 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { gCurGraphNodeHeldObject->prevShadowPosTimestamp = gGlobalTimer; } else { if (gGlobalTimer == gCurGraphNodeObject->prevShadowPosTimestamp + 1 && - gGlobalTimer != gCurGraphNodeObject->skipInterpolationTimestamp) { + gGlobalTimer != gCurGraphNodeObject->skipInterpolationTimestamp && + gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) { interpolate_vectors(shadowPosInterpolated, gCurGraphNodeObject->prevShadowPos, shadowPos); } else { vec3f_copy(shadowPosInterpolated, shadowPos); @@ -1076,7 +1077,8 @@ static void geo_process_object(struct Object *node) { mtxf_mul(gMatStack[gMatStackIndex + 1], *node->header.gfx.throwMatrix, gMatStack[gMatStackIndex]); if (gGlobalTimer == node->header.gfx.prevThrowMatrixTimestamp + 1 && - gGlobalTimer != node->header.gfx.skipInterpolationTimestamp) { + gGlobalTimer != node->header.gfx.skipInterpolationTimestamp && + gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) { interpolate_matrix(mtxf, *node->header.gfx.throwMatrix, node->header.gfx.prevThrowMatrix); mtxf_mul(gMatStackInterpolated[gMatStackIndex + 1], mtxf, gMatStackInterpolated[gMatStackIndex]); @@ -1089,7 +1091,8 @@ static void geo_process_object(struct Object *node) { } else if (node->header.gfx.node.flags & GRAPH_RENDER_CYLBOARD) { Vec3f posInterpolated; if (gGlobalTimer == node->header.gfx.prevTimestamp + 1 && - gGlobalTimer != node->header.gfx.skipInterpolationTimestamp) { + gGlobalTimer != node->header.gfx.skipInterpolationTimestamp && + gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) { interpolate_vectors(posInterpolated, node->header.gfx.prevPos, node->header.gfx.pos); } else { vec3f_copy(posInterpolated, node->header.gfx.pos); @@ -1103,7 +1106,8 @@ static void geo_process_object(struct Object *node) { } else if (node->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) { Vec3f posInterpolated; if (gGlobalTimer == node->header.gfx.prevTimestamp + 1 && - gGlobalTimer != node->header.gfx.skipInterpolationTimestamp) { + gGlobalTimer != node->header.gfx.skipInterpolationTimestamp && + gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) { interpolate_vectors(posInterpolated, node->header.gfx.prevPos, node->header.gfx.pos); } else { vec3f_copy(posInterpolated, node->header.gfx.pos); @@ -1118,7 +1122,8 @@ static void geo_process_object(struct Object *node) { Vec3f posInterpolated; Vec3s angleInterpolated; if (gGlobalTimer == node->header.gfx.prevTimestamp + 1 && - gGlobalTimer != node->header.gfx.skipInterpolationTimestamp) { + gGlobalTimer != node->header.gfx.skipInterpolationTimestamp && + gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) { interpolate_vectors(posInterpolated, node->header.gfx.prevPos, node->header.gfx.pos); interpolate_angles(angleInterpolated, node->header.gfx.prevAngle, node->header.gfx.angle); } else { @@ -1135,7 +1140,8 @@ static void geo_process_object(struct Object *node) { } if (gGlobalTimer == node->header.gfx.prevScaleTimestamp + 1 && - gGlobalTimer != node->header.gfx.skipInterpolationTimestamp) { + gGlobalTimer != node->header.gfx.skipInterpolationTimestamp && + gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) { interpolate_vectors(scaleInterpolated, node->header.gfx.prevScale, node->header.gfx.scale); } else { vec3f_copy(scaleInterpolated, node->header.gfx.scale);