Split SOL data structures into base, varying and rendering parts
[neverball] / ball / game_common.c
index 7675609..5788d73 100644 (file)
@@ -15,7 +15,7 @@
 #include "game_common.h"
 #include "vec3.h"
 #include "config.h"
-#include "solid.h"
+#include "solid_vary.h"
 
 /*---------------------------------------------------------------------------*/
 
@@ -113,7 +113,7 @@ void game_view_init(struct game_view *view)
     view->e[2][2] = 1.0f;
 }
 
-void game_view_fly(struct game_view *view, const struct s_file *fp, float k)
+void game_view_fly(struct game_view *view, const struct s_vary *vary, float k)
 {
     /* float  x[3] = { 1.f, 0.f, 0.f }; */
     float  y[3] = { 0.f, 1.f, 0.f };
@@ -128,10 +128,10 @@ void game_view_fly(struct game_view *view, const struct s_file *fp, float k)
 
     /* k = 0.0 view is at the ball. */
 
-    if (fp->uc > 0)
+    if (vary->uc > 0)
     {
-        v_cpy(c0, fp->uv[0].p);
-        v_cpy(p0, fp->uv[0].p);
+        v_cpy(c0, vary->uv[0].p);
+        v_cpy(p0, vary->uv[0].p);
     }
 
     v_mad(p0, p0, y, view->dp);
@@ -140,18 +140,18 @@ void game_view_fly(struct game_view *view, const struct s_file *fp, float k)
 
     /* k = +1.0 view is s_view 0 */
 
-    if (k >= 0 && fp->wc > 0)
+    if (k >= 0 && vary->base->wc > 0)
     {
-        v_cpy(p1, fp->wv[0].p);
-        v_cpy(c1, fp->wv[0].q);
+        v_cpy(p1, vary->base->wv[0].p);
+        v_cpy(c1, vary->base->wv[0].q);
     }
 
     /* k = -1.0 view is s_view 1 */
 
-    if (k <= 0 && fp->wc > 1)
+    if (k <= 0 && vary->base->wc > 1)
     {
-        v_cpy(p1, fp->wv[1].p);
-        v_cpy(c1, fp->wv[1].q);
+        v_cpy(p1, vary->base->wv[1].p);
+        v_cpy(c1, vary->base->wv[1].q);
     }
 
     /* Interpolate the views. */