Match set score access to level scores
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Wed, 18 Aug 2010 01:01:00 +0000 (01:01 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Wed, 18 Aug 2010 01:01:00 +0000 (01:01 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@3256 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/set.c
ball/set.h
ball/st_done.c
ball/st_start.c

index 3d15378..43ea6a4 100644 (file)
@@ -390,14 +390,14 @@ const char *set_shot(int i)
     return set_exists(i) ? SET_GET(sets, i)->shot : NULL;
 }
 
-const struct score *set_time_score(int i)
+const struct score *set_score(int i, int s)
 {
-    return set_exists(i) ? &SET_GET(sets, i)->time_score : NULL;
-}
-
-const struct score *set_coin_score(int i)
-{
-    return set_exists(i) ? &SET_GET(sets, i)->coin_score : NULL;
+    if (set_exists(i))
+    {
+        if (s == SCORE_TIME) return &SET_GET(sets, i)->time_score;
+        if (s == SCORE_COIN) return &SET_GET(sets, i)->coin_score;
+    }
+    return NULL;
 }
 
 /*---------------------------------------------------------------------------*/
index 2cdabb2..c6128ef 100644 (file)
@@ -25,8 +25,7 @@ const char         *set_id(int);
 const char         *set_name(int);
 const char         *set_desc(int);
 const char         *set_shot(int);
-const struct score *set_time_score(int);
-const struct score *set_coin_score(int);
+const struct score *set_score(int, int);
 
 int  set_score_update (int, int, int *, int *);
 void set_rename_player(int, int, const char *);
index 1b4161b..76b85bf 100644 (file)
@@ -97,8 +97,8 @@ static int done_enter(void)
         gui_layout(id, 0, 0);
     }
 
-    set_score_board(set_coin_score(curr_set()), progress_score_rank(),
-                    set_time_score(curr_set()), progress_times_rank(),
+    set_score_board(set_score(curr_set(), SCORE_COIN), progress_score_rank(),
+                    set_score(curr_set(), SCORE_TIME), progress_times_rank(),
                     NULL, -1);
 
     /* Reset hack. */
index 77dba63..6ef78bf 100644 (file)
@@ -99,8 +99,8 @@ static void start_over(int id, int pulse)
     {
         gui_set_image(shot_id, set_shot(curr_set()));
 
-        set_score_board(set_coin_score(curr_set()), -1,
-                        set_time_score(curr_set()), -1,
+        set_score_board(set_score(curr_set(), SCORE_COIN), -1,
+                        set_score(curr_set(), SCORE_TIME), -1,
                         NULL, -1);
     }