diff src/yadex.cc @ 83:002bc70a3982

More cleanups. Mostly variable renames.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Sep 2011 18:06:30 +0300
parents 154714f3ab2e
children c518e08d5961
line wrap: on
line diff
--- a/src/yadex.cc	Mon Sep 26 17:56:33 2011 +0300
+++ b/src/yadex.cc	Mon Sep 26 18:06:30 2011 +0300
@@ -85,15 +85,15 @@
 
 void InitializeConfig()
 {
-    memset(cfg, 0, sizeof(cfg));
+    memset(&cfg, 0, sizeof(cfg));
 
     cfg.install_dir = NULL,        // Where Yadex is installed
     cfg.logfile = NULL,                // Filepointer to the error log
-    cfg.Registered = false,        // Registered or shareware game?
+    cfg.registered = false,        // Registered or shareware game?
     cfg.screen_lines = 24,                // Lines that our TTY can display
     cfg.remind_to_build_nodes = false,        // Remind user to build nodes
     cfg.config_file = NULL;
-    cfg.Debug = false;
+    cfg.debug = false;
 
     // Set from command line and/or config file
     cfg.autoscroll = false;
@@ -112,23 +112,23 @@
     strcpy(cfg.def.upper_texture, "STARTAN3");
     cfg.def.thing = 3004;
     cfg.double_click_timeout = 200;
-    cfg.Expert = false;
+    cfg.expert = false;
     cfg.Game = NULL;
 
-    cfg.PatchWads = NULL;
-    cfg.Quiet = false;
-    cfg.Quieter = false;
+    cfg.patchwads = NULL;
+    cfg.quiet = false;
+    cfg.quieter = false;
     cfg.scroll_less = 10;
     cfg.scroll_more = 90;
-    cfg.Select0 = false;
+    cfg.autoselect0 = false;
     cfg.show_help = false;
     cfg.sprite_scale = 100;
-    cfg.SwapButtons = false;
+    cfg.swap_buttons = false;
     cfg.verbose = 0;
     cfg.welcome_message = 1;
     cfg.bench = NULL;
 
-    memset(cfg.Iwad, 0, sizeof(cfg.Iwad));
+    memset(cfg.iwadnames, 0, sizeof(cfg.iwadnames));
     cfg.MainWad = NULL;
     
     
@@ -272,7 +272,7 @@
             GameInfo *info = &gameList[n];
             if (strcmp(cfg.Game, info->game) == 0)
             {
-                if (cfg.Iwad[n] == NULL)
+                if (cfg.iwadnames[n] == NULL)
                 {
                     err("You have to tell me where %s is.", info->wadname);
                     fprintf(stderr,
@@ -280,7 +280,7 @@
                             n + 1, n + 1);
                     exit(1);
                 }
-                cfg.MainWad = cfg.Iwad[n];
+                cfg.MainWad = cfg.iwadnames[n];
             }
         }
     }
@@ -305,7 +305,7 @@
         exit(1);
     }
 
-    if (cfg.Debug)
+    if (cfg.debug)
     {
         cfg.logfile = fopen(yadex_log_filename, "a");
         if (cfg.logfile == NULL)
@@ -318,8 +318,8 @@
         LogMessage(": Welcome to Yadex!\n");
     }
 
-    if (cfg.Quieter)
-        cfg.Quiet = true;
+    if (cfg.quieter)
+        cfg.quiet = true;
 
     // Sanity checks (useful when porting).
     check_types();
@@ -337,10 +337,10 @@
     if (OpenMainWad(cfg.MainWad))
         fatal_error("If you don't give me an iwad, I'll quit. I'm serious.");
 
-    if (cfg.PatchWads)
+    if (cfg.patchwads)
     {
         const char *const *pwad_name;
-        for (pwad_name = cfg.PatchWads; *pwad_name; pwad_name++)
+        for (pwad_name = cfg.patchwads; *pwad_name; pwad_name++)
             OpenPatchWad(*pwad_name);
     }
 
@@ -435,7 +435,7 @@
     fputc('\n', stderr);
     fflush(stderr);
 
-    if (cfg.Debug && cfg.logfile != NULL)
+    if (cfg.debug && cfg.logfile != NULL)
     {
         fputs("Error: ", cfg.logfile);
         vfprintf(cfg.logfile, fmt, args);
@@ -543,7 +543,7 @@
     time_t tval;
     char *tstr;
 
-    if (cfg.Debug && cfg.logfile != NULL)
+    if (cfg.debug && cfg.logfile != NULL)
     {
         va_start(args, logstr);
         /* if the message begins with ":", output the current date & time first */
@@ -676,7 +676,7 @@
         /* user asked to quit */
         else if (!strcmp(com, "quit") || !strcmp(com, "q"))
         {
-            if (!cfg.Registered)
+            if (!cfg.registered)
                 printf("Remember to register your copy of the game !\n");
             break;
         }
@@ -714,7 +714,7 @@
                         printf(" You are in %s mode.", cfg.Game);
                     else
 
-                    if (tolower(*com) == 'e' && com[1] > '1' && !cfg.Registered)
+                    if (tolower(*com) == 'e' && com[1] > '1' && !cfg.registered)
                         printf(" You have the shareware IWAD.");
 
                     printf("\n");