News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

[patch] Cleanup in simmain + typo in simuconf.tab

Started by gerw, August 25, 2009, 09:14:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gerw

With this patch, simutrans produces better readable output while reading the simuconfs. And the standard for singleuser_install seems to be "0".

Index: simmain.cc
===================================================================
--- simmain.cc  (revision 2614)
+++ simmain.cc  (working copy)
@@ -442,7 +442,7 @@
        chdir( umgebung_t::program_dir );
        if(  found_simuconf  ) {
                if(simuconf.open("config/simuconf.tab")) {
-                       printf("parse_simuconf() at config/simuconf.tab");
+                       printf("parse_simuconf() at config/simuconf.tab: ");
                        umgebung_t::default_einstellungen.parse_simuconf( simuconf, disp_width, disp_height, fullscreen, umgebung_t::objfilename, false );
                }
        }
@@ -450,9 +450,9 @@
        // if set for multiuser, then parses the users config (if there)
        // retrieve everything (but we must do this again once more ... )
        if(multiuser) {
-               cstring_t obj_conf = umgebung_t::user_dir;
-               if(simuconf.open(obj_conf + "simuconf.tab")) {
-                       printf("parse_simuconf() at %ssimuconf.tab", (const char *)obj_conf);
+               cstring_t obj_conf = umgebung_t::user_dir + "simuconf.tab";
+               if(simuconf.open(obj_conf)) {
+                       printf("parse_simuconf() at %s: ", (const char *)obj_conf);
                        umgebung_t::default_einstellungen.parse_simuconf( simuconf, disp_width, disp_height, fullscreen, umgebung_t::objfilename, false );
                }
        }
@@ -582,19 +582,18 @@
        // now find the pak specific tab file ...
        cstring_t obj_conf = umgebung_t::objfilename + "config/simuconf.tab";
        cstring_t dummy("");
+       sint16 idummy;
        if(simuconf.open((const char *)obj_conf)) {
-               sint16 idummy;
-               printf("parse_simuconf() at %sconfig/simuconf.tab", (const char *)obj_conf);
+               printf("parse_simuconf() at %s: ", (const char *)obj_conf);
                umgebung_t::default_einstellungen.parse_simuconf( simuconf, idummy, idummy, idummy, dummy, false );
                pak_diagonal_multiplier = umgebung_t::default_einstellungen.get_pak_diagonal_multiplier();
                simuconf.close();
        }
        // and parse again parse the user settings
        if(umgebung_t::user_dir!=umgebung_t::program_dir) {
-               cstring_t obj_conf = umgebung_t::user_dir;
-               if(simuconf.open(obj_conf + "simuconf.tab")) {
-                       sint16 idummy;
-                       printf("parse_simuconf() at %ssimuconf.tab", (const char *)obj_conf);
+               cstring_t obj_conf = umgebung_t::user_dir + "simuconf.tab";
+               if(simuconf.open(obj_conf)) {
+                       printf("parse_simuconf() at %s: ", (const char *)obj_conf);
                        umgebung_t::default_einstellungen.parse_simuconf( simuconf, idummy, idummy, idummy, dummy, false );
                        simuconf.close();
                }
Index: simutrans/config/simuconf.tab
===================================================================
--- simutrans/config/simuconf.tab       (revision 2614)
+++ simutrans/config/simuconf.tab       (working copy)
@@ -14,7 +14,7 @@
#
# This simuconf.tab will be read first => we set meaningful defaults here.
#
-# load/save the files in the users or the program directory directory? (default: 1 = user directory)
+# load/save the files in the users or the program directory directory? (default: 0 = user directory)
# ATTENTION!
# will be only used if this file is located in the program directory at config/simuconf.tab!
#singleuser_install = 1