Clean up.
authorKrabbyKrap <KrabbyKrap@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 26 Jan 2008 20:27:00 +0000 (20:27 +0000)
committerKrabbyKrap <KrabbyKrap@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 26 Jan 2008 20:27:00 +0000 (20:27 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@1606 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/set.c
ball/st_set.c
ball/util.c
share/config.h

index 9504b08..83faa6a 100644 (file)
@@ -321,17 +321,11 @@ void set_free(void)
 
 int set_exists(int i, int contribValue)
 {
-    if      (contribValue == 1)
-    {
-        if(set_contribution(i)!=NULL && !strcmp(set_contribution(i), "0"))
-            return 1;
-    }
+    if (contribValue == 1)
+        return (set_contribution(i)!=NULL && !strcmp(set_contribution(i), "0")) ? 1 : 0;
 
     else if (contribValue == 2)
-    {
-        if(set_contribution(i)!=NULL && !strcmp(set_contribution(i), "1"))
-            return 1;
-    }
+        return (set_contribution(i)!=NULL && !strcmp(set_contribution(i), "1")) ? 1 : 0;
 
     else
         return (0 <= i && i < count);
index 663e9d5..4fd5aca 100644 (file)
@@ -36,7 +36,7 @@ static int shot_id;
 static int desc_id;
 
 static int do_init             = 1;
-static int do_init_audio       = 1;
+static int true_init           = 1;
 
 static int set_action(int i)
 {
@@ -73,8 +73,8 @@ static int set_action(int i)
 
         config_set_d(CONFIG_SHOW_CONTRIBUTIONS, 0);
 
-        do_init = 1;
-        do_init_audio = 0;
+        do_init   = 1;
+        true_init = 0;
         return goto_state(&st_set);
 
         break;
@@ -85,8 +85,8 @@ static int set_action(int i)
 
         config_set_d(CONFIG_SHOW_CONTRIBUTIONS, 1);
 
-        do_init = 1;
-        do_init_audio = 0;
+        do_init   = 1;
+        true_init = 0;
         return goto_state(&st_set);
 
         break;
@@ -130,7 +130,7 @@ static int set_enter(void)
     int i;
 
     int j, n;
-    j = n = 0;
+    j = 0;
 
     for(i = 0; i < MAXSET; i++)
     {
@@ -145,11 +145,10 @@ static int set_enter(void)
     if (do_init)
     {
         total = set_init(config_get_d(CONFIG_SHOW_CONTRIBUTIONS));
-        if (do_init_audio)
+        if (true_init)
         {
             audio_music_fade_to(0.5f, "bgm/inter.ogg");
             audio_play(AUD_START, 1.f);
-              /* We need to recheck for contributions on true initialization */
             for(i = 0; i < MAXSET; i++)
             {
                 if (set_exists(i, 2))
@@ -165,8 +164,7 @@ static int set_enter(void)
     if(config_get_d(CONFIG_SHOW_CONTRIBUTIONS))
         n = 1;
 
-    do_init_audio = 1;
-    do_init = 1;
+    do_init = true_init = 1;
 
     if ((id = gui_vstack(0)))
     {
index 4eaba6a..48c5e65 100644 (file)
@@ -386,7 +386,7 @@ char gui_keyboard_char(char c)
  * two as labels for a switch with a default label.
  */
 
-int gui_back_prev_next(int id, int prev, int next, int displayContrib)
+int gui_back_prev_next(int id, int prev, int next, int displayContributions)
 {
     int jd;
     int kd;
@@ -396,7 +396,7 @@ int gui_back_prev_next(int id, int prev, int next, int displayContrib)
     {
         if ((ld = gui_hstack(jd)))
         {
-            if(displayContrib)
+            if(displayContributions)
             {
                 gui_maybe(ld, _("Contributions"), GUI_CONTRIB, !config_get_d(CONFIG_SHOW_CONTRIBUTIONS));
                 gui_maybe(ld, _("Official Sets"), GUI_OFFIC,    config_get_d(CONFIG_SHOW_CONTRIBUTIONS));
index d743e5b..1fe892d 100644 (file)
@@ -160,8 +160,8 @@ enum {
 #define DEFAULT_KEY_RIGHT            SDLK_RIGHT
 #define DEFAULT_KEY_PAUSE            SDLK_SPACE
 #define DEFAULT_KEY_RESTART          SDLK_r
-#define DEFAULT_SHOW_CONTRIBUTIONS   0
 #define DEFAULT_STATS                0
+#define DEFAULT_SHOW_CONTRIBUTIONS   0
 
 /*---------------------------------------------------------------------------*/