A few tiny fixes working around the anachronisms of OpenBSD.
authorrlk <rlk@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Thu, 3 Jan 2008 19:56:14 +0000 (19:56 +0000)
committerrlk <rlk@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Thu, 3 Jan 2008 19:56:14 +0000 (19:56 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@1381 78b8d119-cf0a-0410-b17c-f493084dd1d7

Makefile
ball/game.c
scripts/version.sh

index d1d97a9..7165768 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -66,7 +66,7 @@ ifdef MINGW
     endif
 
     OGL_LIBS := -lopengl32 -lm
-else ifdef DARWIN
+elifdef DARWIN
     ifneq ($(ENABLE_NLS),0)
         INTL_LIBS := -lintl -liconv
     endif
index 785d16e..e01004b 100644 (file)
@@ -35,8 +35,8 @@ static int game_state = 0;
 static struct s_file file;
 static struct s_file back;
 
-static float clock      = 0.f;          /* Clock time                        */
-static int   clock_down = 1;            /* Clock go up or down?              */
+static float timer      = 0.f;          /* Clock time                        */
+static int   timer_down = 1;            /* Timer go up or down?              */
 
 static float game_rx;                   /* Floor rotation about X axis       */
 static float game_rz;                   /* Floor rotation about Z axis       */
@@ -313,8 +313,8 @@ static void view_init(void)
 
 int game_init(const struct level *level, int t, int g)
 {
-    clock      = (float) t / 100.f;
-    clock_down = (t > 0);
+    timer      = (float) t / 100.f;
+    timer_down = (t > 0);
     coins      = 0;
 
     if (game_state)
@@ -375,7 +375,7 @@ void game_free(void)
 
 int curr_clock(void)
 {
-    return (int) (clock * 100.f);
+    return (int) (timer * 100.f);
 }
 
 int curr_coins(void)
@@ -927,16 +927,16 @@ static void game_update_time(float dt, int b)
 
    /* The ticking clock. */
 
-    if (b && clock_down)
+    if (b && timer_down)
     {
-        if (clock < 600.f)
-            clock -= dt;
-        if (clock < 0.f)
-            clock = 0.f;
+        if (timer < 600.f)
+            timer -= dt;
+        if (timer < 0.f)
+            timer = 0.f;
     }
     else if (b)
     {
-        clock += dt;
+        timer += dt;
     }
 }
 
@@ -1011,7 +1011,7 @@ static int game_update_state(int bt)
 
     /* Test for time-out. */
 
-    if (bt && clock_down && clock <= 0.f)
+    if (bt && timer_down && timer <= 0.f)
     {
         audio_play(AUD_TIME, 1.0f);
         return GAME_TIME;
index 20adc02..d8bb6bc 100644 (file)
@@ -9,6 +9,6 @@ svn_version()
     test "$svn_rev" != "exported" && echo "r$svn_rev"
 }
 
-version="$(svn_version || date --utc +"%Y-%m-%d")"
+version="$(svn_version || date -u +"%Y-%m-%d")"
 test -n "$version" && echo "$version" || echo "unknown"