Bump
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Wed, 24 Nov 2010 14:47:01 +0000 (14:47 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Wed, 24 Nov 2010 14:47:01 +0000 (14:47 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@3370 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/st_demo.c
ball/st_play.c
ball/st_set.c
ball/st_shared.c
ball/st_shared.h
ball/st_start.c
putt/st_all.c
putt/st_conf.c
share/st_resol.c
share/state.c
share/state.h

index a7d7567..8119953 100644 (file)
@@ -358,9 +358,9 @@ static void demo_point(int id, int x, int y, int dx, int dy)
         gui_demo_update_status(i);
 }
 
-static void demo_stick(int id, int a, float v)
+static void demo_stick(int id, int a, float v, int bump)
 {
-    int jd = shared_stick_basic(id, a, v);
+    int jd = shared_stick_basic(id, a, v, bump);
     int i  = gui_token(jd);
 
     if (jd && i >= 0 && !GUI_ISMSK(i))
@@ -482,9 +482,9 @@ static void set_speed(int d)
     hud_speed_pulse(speed);
 }
 
-static void demo_play_stick(int id, int a, float v)
+static void demo_play_stick(int id, int a, float v, int bump)
 {
-    if (!STICK_BUMP)
+    if (!bump)
         return;
 
     if (config_tst_d(CONFIG_JOYSTICK_AXIS_Y, a))
index a5e633a..07ea0bc 100644 (file)
@@ -399,7 +399,7 @@ static void play_loop_point(int id, int x, int y, int dx, int dy)
     game_set_pos(dx, dy);
 }
 
-static void play_loop_stick(int id, int a, float v)
+static void play_loop_stick(int id, int a, float v, int bump)
 {
     if (config_tst_d(CONFIG_JOYSTICK_AXIS_X, a))
         game_set_z(v);
index 8b0e087..36b6279 100644 (file)
@@ -161,9 +161,9 @@ static void set_point(int id, int x, int y, int dx, int dy)
         set_over(i);
 }
 
-static void set_stick(int id, int a, float v)
+static void set_stick(int id, int a, float v, int bump)
 {
-    int jd = shared_stick_basic(id, a, v);
+    int jd = shared_stick_basic(id, a, v, bump);
     int i  = gui_token(jd);
     if (jd && set_exists(i))
         set_over(i);
index bb92d6f..c6fa4ca 100644 (file)
@@ -54,19 +54,19 @@ void shared_point(int id, int x, int y, int dx, int dy)
     shared_point_basic(id, x, y);
 }
 
-int shared_stick_basic(int id, int a, float v)
+int shared_stick_basic(int id, int a, float v, int bump)
 {
     int jd;
 
-    if ((jd = gui_stick(id, a, v, STICK_BUMP)))
+    if ((jd = gui_stick(id, a, v, bump)))
         gui_pulse(jd, 1.2f);
 
     return jd;
 }
 
-void shared_stick(int id, int a, float v)
+void shared_stick(int id, int a, float v, int bump)
 {
-    shared_stick_basic(id, a, v);
+    shared_stick_basic(id, a, v, bump);
 }
 
 void shared_angle(int id, int x, int z)
index 5eb79e0..49bc3ab 100644 (file)
@@ -8,10 +8,9 @@ void shared_paint(int id, float st);
 void shared_timer(int id, float dt);
 int  shared_point_basic(int id, int x, int y);
 void shared_point(int id, int x, int y, int dx, int dy);
-int  shared_stick_basic(int id, int a, float v);
-void shared_stick(int id, int a, float v);
+int  shared_stick_basic(int id, int a, float v, int bump);
+void shared_stick(int id, int a, float v, int bump);
 void shared_angle(int id, int x, int z);
 int  shared_click(int b, int d);
 
-
-#endif /* ST_SHARED_H */
+#endif
index 47ceb0d..2564a92 100644 (file)
@@ -268,9 +268,9 @@ static void start_point(int id, int x, int y, int dx, int dy)
     start_over(gui_point(id, x, y), 1);
 }
 
-static void start_stick(int id, int a, float v)
+static void start_stick(int id, int a, float v, int bump)
 {
-    start_over(gui_stick(id, a, v, STICK_BUMP), 1);
+    start_over(gui_stick(id, a, v, bump), 1);
 }
 
 static int start_keybd(int c, int d)
index 6890500..f87d74f 100644 (file)
@@ -155,19 +155,19 @@ static int score_card(const char  *title,
 
 /*---------------------------------------------------------------------------*/
 
-static int shared_stick_basic(int id, int a, float v)
+static int shared_stick_basic(int id, int a, float v, int bump)
 {
     int jd;
 
-    if ((jd = gui_stick(id, a, v, STICK_BUMP)))
+    if ((jd = gui_stick(id, a, v, bump)))
         gui_pulse(jd, 1.2f);
 
     return jd;
 }
 
-static void shared_stick(int id, int a, float v)
+static void shared_stick(int id, int a, float v, int bump)
 {
-    shared_stick_basic(id, a, v);
+    shared_stick_basic(id, a, v, bump);
 }
 
 /*---------------------------------------------------------------------------*/
@@ -380,11 +380,11 @@ static void course_point(int id, int x, int y, int dx, int dy)
     }
 }
 
-static void course_stick(int id, int a, float v)
+static void course_stick(int id, int a, float v, int bump)
 {
     int jd;
 
-    if ((jd = shared_stick_basic(id, a, v)))
+    if ((jd = shared_stick_basic(id, a, v, bump)))
     {
         int i = gui_token(jd);
 
@@ -909,7 +909,7 @@ static void stroke_point(int id, int x, int y, int dx, int dy)
     game_set_mag(dy);
 }
 
-static void stroke_stick(int id, int a, float v)
+static void stroke_stick(int id, int a, float v, int bump)
 {
     if (config_tst_d(CONFIG_JOYSTICK_AXIS_X, a))
         stroke_rotate = 6 * v;
index 52cbce7..67033a6 100644 (file)
@@ -271,9 +271,9 @@ static void conf_point(int id, int x, int y, int dx, int dy)
     gui_pulse(gui_point(id, x, y), 1.2f);
 }
 
-static void conf_stick(int id, int a, float v)
+static void conf_stick(int id, int a, float v, int bump)
 {
-    gui_pulse(gui_stick(id, a, v, STICK_BUMP), 1.2f);
+    gui_pulse(gui_stick(id, a, v, bump), 1.2f);
 }
 
 static int conf_click(int b, int d)
index 84e3074..da4a506 100644 (file)
@@ -154,9 +154,9 @@ static void resol_point(int id, int x, int y, int dx, int dy)
     gui_pulse(gui_point(id, x, y), 1.2f);
 }
 
-static void resol_stick(int id, int a, float v)
+static void resol_stick(int id, int a, float v, int bump)
 {
-    gui_pulse(gui_stick(id, a, v, STICK_BUMP), 1.2f);
+    gui_pulse(gui_stick(id, a, v, bump), 1.2f);
 }
 
 static int resol_click(int b, int d)
index 507ef49..991248f 100644 (file)
@@ -101,8 +101,6 @@ void st_point(int x, int y, int dx, int dy)
         state->point(state->gui_id, x, y, dx, dy);
 }
 
-int STICK_BUMP;
-
 void st_stick(int a, float v)
 {
     static struct
@@ -117,9 +115,7 @@ void st_stick(int a, float v)
         { &CONFIG_JOYSTICK_AXIS_U, &CONFIG_JOYSTICK_AXIS_U_INVERT }
     };
 
-    int i;
-
-    STICK_BUMP = 0;
+    int i, bump = 0;
 
     for (i = 0; i < ARRAYSIZE(axes); i++)
         if (config_tst_d(*axes[i].num, a))
@@ -128,8 +124,8 @@ void st_stick(int a, float v)
 
             /* Note the transition from centered to leaned position. */
 
-            STICK_BUMP = ((-0.5f <= p && p <= +0.5f) &&
-                          (v < -0.5f || +0.5f < v));
+            bump = ((-0.5f <= p && p <= +0.5f) &&
+                    (v < -0.5f || +0.5f < v));
 
             axes[i].prev = v;
 
@@ -140,7 +136,7 @@ void st_stick(int a, float v)
         }
 
     if (state && state->stick)
-        state->stick(state->gui_id, a, v);
+        state->stick(state->gui_id, a, v, bump);
 }
 
 void st_angle(int x, int z)
index 1bec94f..f4c9d64 100644 (file)
@@ -13,7 +13,7 @@ struct state
     void (*paint)(int id, float t);
     void (*timer)(int id, float dt);
     void (*point)(int id, int x, int y, int dx, int dy);
-    void (*stick)(int id, int a, float v);
+    void (*stick)(int id, int a, float v, int bump);
     void (*angle)(int id, int x, int z);
     int  (*click)(int b,  int d);
     int  (*keybd)(int c,  int d);
@@ -24,6 +24,7 @@ struct state
 };
 
 struct state *curr_state(void);
+
 float time_state(void);
 void  init_state(struct state *);
 int   goto_state(struct state *);
@@ -37,8 +38,6 @@ int  st_click(int, int);
 int  st_keybd(int, int);
 int  st_buttn(int, int);
 
-extern int STICK_BUMP;
-
 /*---------------------------------------------------------------------------*/
 
 #endif