Fix lookaround mode without changing lerp alpha, also fix fly-by this way
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Thu, 17 Feb 2011 11:11:49 +0000 (11:11 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Thu, 17 Feb 2011 11:11:49 +0000 (11:11 +0000)
Do this by copying the new view to the old view. It might seem that
this totally breaks interpolation (just like the previous fix), but
neither lookaround nor fly-by are lockstepped which makes
interpolation non-applicable here.

git-svn-id: https://s.snth.net/svn/neverball/trunk@3501 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/game_client.c

index 22d2499..4140a3c 100644 (file)
@@ -477,7 +477,7 @@ void game_look(float phi, float theta)
     view->c[1] = view->p[1] +                       fsinf(V_RAD(phi));
     view->c[2] = view->p[2] - fcosf(V_RAD(theta)) * fcosf(V_RAD(phi));
 
-    gl.alpha = 1.0f;
+    gl.view[PREV] = gl.view[CURR];
 }
 
 /*---------------------------------------------------------------------------*/
@@ -516,6 +516,8 @@ void game_fade(float d)
 void game_client_fly(float k)
 {
     game_view_fly(&gl.view[CURR], &gd.file.vary, k);
+
+    gl.view[PREV] = gl.view[CURR];
 }
 
 /*---------------------------------------------------------------------------*/