Remove SDL_mixer from base config (I doubt mapc needs that) and update
[neverball] / share / solid.c
index 86fea72..4bb31d9 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
  * Copyright (C) 2003 Robert Kooima
  *
  * NEVERBALL is  free software; you can redistribute  it and/or modify
@@ -29,8 +29,8 @@
 #include "base_config.h"
 #include "binary.h"
 
-#define MAGIC 0x4F425251        /* SOL file magic number (should not change). */
-#define SOL_VERSION  5          /* SOL file format version (can change).      */
+#define MAGIC       0x4c4f53af
+#define SOL_VERSION 5
 
 #define LARGE 1.0e+5f
 
@@ -233,7 +233,6 @@ static void sol_load_ball(FILE *fin, struct s_ball *bp)
     get_array(fin,  bp->e[2], 3);
     get_array(fin,  bp->p,    3);
     get_float(fin, &bp->r);
-    get_float(fin, &bp->a);
 }
 
 static void sol_load_view(FILE *fin, struct s_view *wp)
@@ -333,7 +332,7 @@ static int sol_load_file(FILE *fin, struct s_file *fp)
     for (i = 0; i < fp->ic; i++) get_index(fin, fp->iv + i);
 
     if (fp->ac) fread(fp->av, 1, fp->ac, fin);
-    
+
     return 1;
 }
 
@@ -493,7 +492,6 @@ static void sol_stor_ball(FILE *fout, struct s_ball *bp)
     put_array(fout,  bp->e[2], 3);
     put_array(fout,  bp->p,    3);
     put_float(fout, &bp->r);
-    put_float(fout, &bp->a);
 }
 
 static void sol_stor_view(FILE *fout, struct s_view *wp)
@@ -510,7 +508,7 @@ static void sol_stor_file(FILE *fin, struct s_file *fp)
 
     put_index(fin, &magic);
     put_index(fin, &version);
-    
+
     put_index(fin, &fp->mc);
     put_index(fin, &fp->vc);
     put_index(fin, &fp->ec);
@@ -784,7 +782,7 @@ static float sol_bounce(struct s_ball *up,
     v_mad(u, w, n, -wn);
     v_mad(v, v, n, -vn);
     v_mad(v, v, u, +km * dt);
-    v_mad(v, v, n, xn + yn); 
+    v_mad(v, v, n, xn + yn);
 
     v_mad(p, q, n, up->r);
 
@@ -1045,7 +1043,7 @@ static float sol_test_lump(float dt,
                 t = u;
             }
         }
+
     /* Test all edges */
 
     if (up->r > 0.0f)
@@ -1389,7 +1387,7 @@ int sol_swch_test(struct s_file *fp, int ui)
                     /* The ball enter */
                     if (xp->t0 == 0)
                         xp->e = 1;
-                    
+
                     /* Toggle the state, update the path. */
 
                     xp->f = xp->f ? 0 : 1;