Author: zaroth
Date: Thu Jun  9 11:52:20 2011
New Revision: 49799

URL: http://svn.gna.org/viewcvs/wesnoth?rev=49799&view=rev
Log:
adding bpp, load, no-cache, validcache, with-replay commands support to
the commandline_options and game_controller.

Modified:
    trunk/src/commandline_options.cpp
    trunk/src/game_controller.cpp

Modified: trunk/src/commandline_options.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/commandline_options.cpp?rev=49799&r1=49798&r2=49799&view=diff
==============================================================================
--- trunk/src/commandline_options.cpp (original)
+++ trunk/src/commandline_options.cpp Thu Jun  9 11:52:20 2011
@@ -84,10 +84,11 @@
        // Options are sorted alphabetically by --long-option.
        po::options_description general_opts("General options");
        general_opts.add_options()
-               ("config-dir", po::value<std::string>(), "sets the path of the 
user config directory to $HOME/arg or My Documents\\My Games\\arg for Windows. 
You can specify also an absolute path outside the $HOME or My Documents\\My 
Games directory.")
+               ("config-dir", po::value<std::string>(), "sets the path of the 
user config directory to $HOME/<arg> or My Documents\\My Games\\<arg> for 
Windows. You can specify also an absolute path outside the $HOME or My 
Documents\\My Games directory.")
                ("data-dir", po::value<std::string>(), "overrides the data 
directory with the one specified.")
                ("debug,d", "enables additional command mode options in-game.")
                ("help,h", "prints this message and exits.")
+               ("load,l", po::value<std::string>(), "loads the save <arg> from 
the standard save game directory.\nWhen launching the map editor via -e, the 
map <arg> is loaded, relative to the current directory. If it is a directory, 
the editor will start with a load map dialog opened there.")
                ("new-syntax", "enables the new campaign syntax parsing.")
                ("nocache", "disables caching of game data.")
                ("path", "prints the path to the data directory and exits.")

Modified: trunk/src/game_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_controller.cpp?rev=49799&r1=49798&r2=49799&view=diff
==============================================================================
--- trunk/src/game_controller.cpp (original)
+++ trunk/src/game_controller.cpp Thu Jun  9 11:52:20 2011
@@ -116,25 +116,33 @@
 
        const std::string app_basename = file_name(argv[0]);
        jump_to_editor_ = app_basename.find("editor") != std::string::npos;
-       
-       if(cmdline_opts_.fps)
+
+       if (cmdline_opts_.bpp)
+               force_bpp_ = *cmdline_opts_.bpp;
+       if (cmdline_opts_.fps)
                preferences::set_show_fps(true);
-       if(cmdline_opts_.new_storyscreens)
+       if (cmdline_opts_.load)
+               game::load_game_exception::game = *cmdline_opts_.load;
+       if (cmdline_opts_.new_storyscreens)
                // This is a hidden option to help testing
                // the work-in-progress new storyscreen code.
                // Don't document.
                set_new_storyscreen(true);
-       if(cmdline_opts_.new_widgets)
+       if (cmdline_opts_.new_widgets)
                gui2::new_widgets = true;
+       if (cmdline_opts_.nocache)
+               cache_.set_use_cache(false);
+       if (cmdline_opts_.validcache)
+               cache_.set_force_valid_cache(true);
+       if (cmdline_opts_.with_replay)
+               game::load_game_exception::show_replay = true;
 
        for(arg_ = 1; arg_ != argc_; ++arg_) {
                const std::string val(argv_[arg_]);
                if(val.empty()) {
                        continue;
                }
-               else if(val == "--nocache") {
-                       cache_.set_use_cache(false);
-               } else if(val == "--max-fps") {
+               else if(val == "--max-fps") {
                        if(arg_+1 != argc_) {
                                ++arg_;
                                int fps = 
lexical_cast_default<int>(argv_[arg_], 50);
@@ -147,8 +155,6 @@
                                }
                                preferences::set_draw_delay(fps);
                        }
-               } else if(val == "--validcache") {
-                       cache_.set_force_valid_cache(true);
                } else if(val == "--resolution" || val == "-r") {
                        if(arg_+1 != argc_) {
                                ++arg_;
@@ -163,19 +169,6 @@
                                        }
                                }
                        }
-               } else if(val == "--bpp") {
-                       if(arg_+1 != argc_) {
-                               ++arg_;
-                               force_bpp_ = 
lexical_cast_default<int>(argv_[arg_],-1);
-                       }
-               } else if(val == "--load" || val == "-l") {
-                       if(arg_+1 != argc_) {
-                               ++arg_;
-                               game::load_game_exception::game = argv_[arg_];
-                       }
-               } else if(val == "--with-replay") {
-                       game::load_game_exception::show_replay = true;
-
                } else if(val == "--nogui") {
                        no_gui_ = true;
                        no_sound = true;


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to