@gfgtdf explained in IRC that it's often used to slow Wesnoth down (instead
of speeding it up, as I had assumed).
This should also allow unit tests to compile again.
The FPS cap, originally implemented in 2007, is very poorly done. It
doesn't take frame time variance into account, and is therefore almost
guaranteed to cause missed frames all the time. It doesn't increase timer
granularity on Windows, which causes SDL_Delay() to often take much longer
than intended. And it's hardcoded for 50 FPS, which fits poorly with 60 Hz
displays.
This new implementation fixes all those issues.
My experience is that the game feels much, much smoother with the new
implementation, perfectly competitive with 1.12. In my opinion, performance
is now at an acceptable level for a stable release.
This is intended to be used instead of the Game Version dialog's
clipboard text report in the event that Wesnoth cannot reach the
titlescreen or the dialog for some reason.
Unlike the --version info dump, it performs various calls to the
filesystem API which have potential side-effects on the environment
(namely, creating a user data directory structure if none existed before
running the command). It seems highly improper for a program's --version
switch to perform any actions other than printing text to its parent
terminal, hence I thought it would be better to add a new switch with a
more active phrasing, also reflected in its accompanying documentation.
Ultimately, this and its UI counterpart should be used by 1.14 players
as part of the bug reporting process, preferably as a mandatory step
before submitting new reports on GH or the forums.
Covers more cases of:
* push_back(std::pair
* push_back(std::make_pair
* push_back(std::make_tuple
* push_back(T) where T is an empty object of type T
Small thing I noticed: this does mean the numbers in font::subset_descriptor are no longer 'cast' to size_t before being
added to the vector, but that shouldn't matter (hopefully).
This does several things:
- Make the formatting consistent, using underline instead of <angle brackets> for all arguments
- Add many missing switches; some experimental/dev ones are still not listed though
- Ensure all switches are listed in alphabetical order
- Fix some inaccurate details
- Minor fixes to the output of --help
In addition, the following additional switches now force a console on Windows:
--nogui
--logdomains
--path
--render-image
--screenshot
--data-path
--userdata-path
--userconfig-path
--version
This is only recognized by the game client at the moment. The
implementation is a bit hacky but it seems to work. Thanks, SDLmain.
The cwesnoth.cmd Windows batch file passes --wconsole to Wesnoth in the
command line, along with any other arguments passed to it. This is
intended to be *the* use case for --wconsole, since otherwise the fact
that Windows won't allocate a console for us on process initialization
(due to Wesnoth being compiled with the GUI application flag) causes
issues with the Command Prompt shell -- namely, the shell returns
before Wesnoth allocates its console, allowing shell input to happen
concurrently with Wesnoth's output to console.
cwesnoth.cmd should be used in shortcuts and given Wesnoth's install
path as its initial working directory.
If a lua script is passed as an argument to wesnoth, wesnoth will
actually instantiate the application_lua_kernel defined in the
previous commits, initialize it, and run the script in that
environment.
we now use boost::istreams instead of boost::filesystem::fstream because the later doesnt work with mingw.
we now use a custom codecvt instead of boost locale because we want to get better error messages for invalid utf8 strings using our _ERR streams
we now use unicode prgamm commandline args on windows..
Reuse the boost::program_options::error class (which we already catch in
main()) instead of throwing a std::string, and simplify the throwing
logic accordingly.
There is no need to provide incredibly verbose error messages since the
user is expected to be able to read --help or the man page to get here
in the first place.
Reuse the boost::program_options::error class (which we already catch in
main()) instead of throwing a std::string, and simplify the throwing
logic accordingly.
There is no need to provide incredibly verbose error messages since the
user is expected to be able to read --help or the man page to get here
in the first place.
This only fixes one case but when you are trying to set up a
headless multiplayer game it is pretty annoying when it crashes
with no explanation because of a bad controller string.
This was buggy and based on deprecated SDL features that will not
continue to be available. aquileia wrote us a very nice windows
port of the run_wml_tests bash script, so for windows mac and
linux we should now be able to run the unit tests as desired.
Maybe someday built-in timeouts can be supported using boost
process library, if that ever materializes.
When the game is run using e.g. "--log-strict=warning", then
writing anything to a log channel of severity warning or higher
will result in a game::game_error exception being thrown.
This will only happen the first time that such a write is
attempted, subsequent attempts to get the logging object will
pass without exception and such messages will be reported.
after unit tests play, then unless --noreplaycheck flag is used,
they save a replay at the end of the scenario (using autosave
code path), without compression. then they try to load it and
play it to completion.
this is the initial attempt.
This is the initial commit for --unit, -u, unit test option.
This option is a modified version of --test, -t. Scenarios will
run in the same context essentially, but will terminate on
scenario end.
The exit code of wesnoth is 0 (PASS) if the scenario ended with
LEVEL_RESULT VICTORY, or LEVEL_RESULT NONE.
The exit code of wesnoth is 1 (FAIL) otherwise.
Higher exit codes may reflect a failure for a reason other than
the scenario ending in defate.