15 #include "addon/manager.hpp" 56 #include "widgets/button.hpp" 71 #include <boost/iostreams/categories.hpp> 72 #include <boost/iostreams/copy.hpp> 73 #include <boost/iostreams/filter/bzip2.hpp> 77 #pragma warning(disable : 4456) 78 #pragma warning(disable : 4458) 81 #include <boost/iostreams/filter/gzip.hpp> 87 #include <boost/iostreams/filtering_stream.hpp> 88 #include <boost/program_options/errors.hpp> 109 #ifdef INADDR_BROADCAST 110 #undef INADDR_BROADCAST 121 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS 125 class end_level_exception;
132 #define LOG_CONFIG LOG_STREAM(info, log_config) 134 #define LOG_GENERAL LOG_STREAM(info, lg::general()) 137 #define LOG_PREPROC LOG_STREAM(info, log_preprocessor) 144 LOG_GENERAL <<
"exiting with code " << res <<
"\n";
149 template<
typename filter>
150 static void encode(
const std::string& input_file,
const std::string& output_file)
153 std::ifstream ifile(input_file.c_str(),
std::ios_base::in | std::ios_base::binary);
157 std::cerr <<
"Input file " << input_file
158 <<
" is not good for reading. Exiting to prevent bzip2 from segfaulting\n";
162 std::ofstream ofile(output_file.c_str(), std::ios_base::out | std::ios_base::binary);
164 boost::iostreams::filtering_stream<boost::iostreams::output> stream;
165 stream.push(filter());
168 boost::iostreams::copy(ifile, stream);
173 std::cerr <<
"IO error: " << e.
what() <<
"\n";
177 template<
typename filter>
178 static void decode(
const std::string& input_file,
const std::string& output_file)
181 std::ofstream ofile(output_file.c_str(), std::ios_base::out | std::ios_base::binary);
182 std::ifstream ifile(input_file.c_str(),
std::ios_base::in | std::ios_base::binary);
184 boost::iostreams::filtering_stream<boost::iostreams::input> stream;
185 stream.push(filter());
188 boost::iostreams::copy(stream, ofile);
193 std::cerr <<
"IO error: " << e.
what() <<
"\n";
197 static void gzip_encode(
const std::string& input_file,
const std::string& output_file)
199 encode<boost::iostreams::gzip_compressor>(input_file, output_file);
202 static void gzip_decode(
const std::string& input_file,
const std::string& output_file)
204 decode<boost::iostreams::gzip_decompressor>(input_file, output_file);
207 static void bzip2_encode(
const std::string& input_file,
const std::string& output_file)
209 encode<boost::iostreams::bzip2_compressor>(input_file, output_file);
212 static void bzip2_decode(
const std::string& input_file,
const std::string& output_file)
214 decode<boost::iostreams::bzip2_decompressor>(input_file, output_file);
224 std::cerr <<
"please specify an existing file. File " << file <<
" doesn't exist.\n";
228 std::cerr << SDL_GetTicks() <<
" Reading cached defines from: " << file <<
"\n";
236 std::cerr <<
"Caught a config error while parsing file '" << file <<
"':\n" << e.
message << std::endl;
244 input_macros[def.first] = def.second;
248 std::cerr << SDL_GetTicks() <<
" Read " << read <<
" defines.\n";
254 uint32_t startTime = SDL_GetTicks();
257 bool skipCore =
false;
258 bool skipTerrainGFX =
false;
267 std::cerr <<
"empty define supplied\n";
271 LOG_PREPROC <<
"adding define: " << define <<
'\n';
274 if(define ==
"SKIP_CORE") {
275 std::cerr <<
"'SKIP_CORE' defined.\n";
277 }
else if(define ==
"NO_TERRAIN_GFX") {
278 std::cerr <<
"'NO_TERRAIN_GFX' defined." << std::endl;
279 skipTerrainGFX =
true;
287 std::cerr <<
"added " << defines_map.size() <<
" defines.\n";
290 if(skipCore ==
false) {
291 std::cerr <<
"preprocessing common macros from 'data/core' ...\n";
296 if(skipTerrainGFX ==
false) {
300 std::cerr <<
"acquired " << (defines_map.size() - input_macros.size()) <<
" 'data/core' defines.\n";
302 std::cerr <<
"skipped 'data/core'\n";
306 std::cerr <<
"preprocessing specified resource: " << resourceToProcess <<
" ...\n";
309 std::cerr <<
"acquired " << (defines_map.size() - input_macros.size()) <<
" total defines.\n";
312 std::string outputFileName =
"_MACROS_.cfg";
317 std::string outputPath = targetDir +
"/" + outputFileName;
319 std::cerr <<
"writing '" << outputPath <<
"' with " << defines_map.size() <<
" defines.\n";
325 for(
auto& define_pair : defines_map) {
326 define_pair.second.write(writer, define_pair.first);
329 std::cerr <<
"couldn't open the file.\n";
333 std::cerr <<
"preprocessing finished. Took " << SDL_GetTicks() - startTime <<
" ticks.\n";
338 for(
const std::string& define : defines) {
340 std::cerr <<
"empty define supplied\n";
344 LOG_PREPROC <<
"adding define: " << define <<
'\n';
347 std::cout <<
"Validating " << file <<
" against schema " << validator.
name_ << std::endl;
351 read(result, *stream, &validator);
353 std::cout <<
"validation failed\n";
355 std::cout <<
"validation succeeded\n";
384 const std::string datadir = *cmdline_opts.
data_dir;
387 if(datadir.c_str()[1] ==
':') {
389 if(datadir[0] ==
'/') {
397 std::cerr <<
"Overriding data directory with " <<
game_config::path << std::endl;
418 const std::string input_file(*cmdline_opts.
gunzip);
420 std::cerr <<
"file '" << input_file <<
"'isn't a .gz file\n";
424 const std::string output_file(input_file, 0, input_file.length() - 3);
429 const std::string input_file(*cmdline_opts.
bunzip2);
431 std::cerr <<
"file '" << input_file <<
"'isn't a .bz2 file\n";
435 const std::string output_file(input_file, 0, input_file.length() - 4);
439 if(cmdline_opts.
gzip) {
440 const std::string input_file(*cmdline_opts.
gzip);
441 const std::string output_file(*cmdline_opts.
gzip +
".gz");
445 if(cmdline_opts.
bzip2) {
446 const std::string input_file(*cmdline_opts.
bzip2);
447 const std::string output_file(*cmdline_opts.
bzip2 +
".bz2");
451 if(cmdline_opts.
help) {
452 std::cout << cmdline_opts;
456 if(cmdline_opts.
log) {
457 for(
const auto& log_pair : cmdline_opts.
log.get()) {
458 const std::string log_domain = log_pair.second;
459 const int severity = log_pair.first;
461 std::cerr <<
"unknown log domain: " << log_domain <<
'\n';
481 SDL_setenv(
"SDL_VIDEODRIVER",
"dummy", 1);
515 std::string schema_path;
538 #if defined _WIN32 || defined __APPLE__ 539 setlocale(LC_ALL,
"English");
541 std::setlocale(LC_ALL,
"C");
564 <<
"An error at this point during initialization usually indicates that the data\n" 565 <<
"directory above was not correctly set or detected. Try passing the correct path\n" 566 <<
"in the command line with the --data-dir switch or as the only argument.\n";
575 static bool first_time =
true;
594 if(_controlfp_s(&f_control, 0, 0) == 0) {
596 uint32_t rounding_mode = f_control & _MCW_RC;
597 uint32_t precision_mode = f_control & _MCW_PC;
599 if(rounding_mode != _RC_NEAR) {
600 std::cerr <<
"Floating point rounding mode is currently '" 601 << ((rounding_mode == _RC_CHOP)
603 : (rounding_mode == _RC_UP)
605 : (rounding_mode == _RC_DOWN)
607 : (rounding_mode == _RC_NEAR) ?
"near" :
"unknown")
608 <<
"' setting to 'near'\n";
610 if(_controlfp_s(&unused, _RC_NEAR, _MCW_RC)) {
611 std::cerr <<
"failed to set floating point rounding type to 'near'\n";
615 if(precision_mode != _PC_53) {
616 std::cerr <<
"Floating point precision mode is currently '" 617 << ((precision_mode == _PC_53)
619 : (precision_mode == _PC_24)
621 : (precision_mode == _PC_64) ?
"double extended" :
"unknown")
622 <<
"' setting to 'double'\n";
624 if(_controlfp_s(&unused, _PC_53, _MCW_PC)) {
625 std::cerr <<
"failed to set floating point precision type to 'double'\n";
629 std::cerr <<
"_controlfp_s failed.\n";
635 switch(fegetround()) {
639 std::cerr <<
"Floating point precision mode is currently 'downward'";
642 std::cerr <<
"Floating point precision mode is currently 'toward-zero'";
645 std::cerr <<
"Floating point precision mode is currently 'upward'";
648 std::cerr <<
"Floating point precision mode is currently 'unknown'";
651 std::cerr <<
"setting to 'nearest'";
652 fesetround(FE_TONEAREST);
664 srand(std::time(
nullptr));
673 std::cerr <<
"Press enter to continue..." << std::endl;
681 const auto game = std::make_unique<game_launcher>(cmdline_opts, args[0].c_str());
682 const int start_ticks = SDL_GetTicks();
693 std::cerr <<
"could not initialize fonts\n";
699 res =
game->init_language();
701 std::cerr <<
"could not initialize the language\n";
705 res =
game->init_video();
707 std::cerr <<
"could not initialize display\n";
713 std::cerr <<
"could not initialize image preferences\n";
718 res =
game->init_joystick();
720 std::cerr <<
"could not initialize joystick\n";
728 #if(defined(_X11) && !defined(__APPLE__)) || defined(_WIN32) 729 SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
742 std::cerr <<
"could not initialize game config\n";
750 std::cerr <<
"could not re-initialize fonts for the current language\n";
763 LOG_CONFIG <<
"time elapsed: " << (SDL_GetTicks() - start_ticks) <<
" ms\n";
786 if(!
game->is_loading()) {
787 const config& cfg = config_manager.game_config().
child(
"titlescreen_music");
793 config title_music_config;
795 title_music_config[
"append"] =
true;
796 title_music_config[
"immediate"] =
true;
809 if(cmdline_opts.unit_test) {
810 if(cmdline_opts.timeout) {
811 std::cerr <<
"The wesnoth built-in timeout feature has been removed.\n" << std::endl;
812 std::cerr <<
"Please use a platform-specific script which will kill the overtime process instead.\n" 814 std::cerr <<
"For examples in bash, or in windows cmd, see the forums, or the wesnoth repository." 817 <<
"The bash script is called `run_wml_tests`, the windows script is part of the VC project.\n" 821 int worker_result =
game->unit_test();
822 std::cerr << ((worker_result == 0) ?
"PASS TEST " :
"FAIL TEST ")
823 << ((worker_result == 3) ?
"(INVALID REPLAY)" :
"")
824 << ((worker_result == 4) ?
"(ERRORED REPLAY)" :
"") <<
": " << *cmdline_opts.unit_test
826 return worker_result;
829 if(
game->play_test() ==
false) {
833 if(
game->play_screenshot_mode() ==
false) {
837 if(
game->play_render_image_mode() ==
false) {
842 if(
game->goto_campaign() ==
false) {
843 if(
game->jump_to_campaign_id().empty())
851 if(
game->goto_multiplayer() ==
false) {
856 if(
game->play_multiplayer_commandline() ==
false) {
860 if(
game->goto_editor() ==
false) {
871 if(
game->is_loading()) {
872 if(!
game->load_game()) {
873 game->clear_loaded_game();
876 game->launch_game(should_reload);
921 config_manager.reload_changed_game_config();
925 game->start_editor();
928 gui2::dialogs::end_credits::display();
931 game->launch_game(should_reload);
940 static bool parse_commandline_argument(
const char*&
next,
const char* end, std::string& res)
943 while(next != end && *next ==
' ') {
951 bool is_excaped =
false;
953 for(; next != end; ++
next) {
954 if(*next ==
' ' && !is_excaped) {
956 }
else if(*next ==
'"' && !is_excaped) {
959 }
else if(*next ==
'"' && is_excaped && next + 1 != end && *(next + 1) ==
'"') {
963 }
else if(*next ==
'"' && is_excaped) {
967 res.push_back(*next);
974 static std::vector<std::string> parse_commandline_arguments(std::string input)
976 const char*
start = &input[0];
977 const char* end = start + input.size();
980 std::vector<std::string> res;
982 while(parse_commandline_argument(start, end, buffer)) {
984 res.back().swap(buffer);
999 #define error_exit(res) \ 1001 if(lg::using_own_console()) { \ 1002 std::cerr << "Press enter to continue..." << std::endl; \ 1008 #define error_exit(res) return res 1023 std::vector<std::string> args =
1024 parse_commandline_arguments(unicode_cast<std::string>(std::wstring(GetCommandLineW())));
1030 for(std::size_t k = 0; k < args.size(); ++k) {
1031 if(args[k] ==
"--wconsole" ||
1032 args[k] ==
"--help" ||
1033 args[k] ==
"--logdomains" ||
1034 args[k] ==
"--render-image" ||
1035 args[k] ==
"--report" ||
1037 args[k] ==
"--screenshot" ||
1038 args[k] ==
"--data-path" ||
1039 args[k] ==
"--userdata-path" ||
1040 args[k] ==
"--userconfig-path" ||
1041 args[k].
compare(0, 11,
"--validate=") == 0 ||
1042 args[k].compare(0, 17,
"--validate-schema") == 0 ||
1043 args[k] ==
"--version" 1052 std::vector<std::string> args;
1053 for(
int i = 0;
i < argc; ++
i) {
1054 args.push_back(std::string(argv[
i]));
1058 assert(!args.empty());
1062 if(SDL_Init(SDL_INIT_TIMER) < 0) {
1063 fprintf(stderr,
"Couldn't initialize SDL: %s\n", SDL_GetError());
1068 struct sigaction terminate_handler;
1070 terminate_handler.sa_flags = 0;
1072 sigemptyset(&terminate_handler.sa_mask);
1073 sigaction(SIGTERM, &terminate_handler,
nullptr);
1074 sigaction(SIGINT, &terminate_handler,
nullptr);
1079 #if defined(__APPLE__) && !defined(__IPHONEOS__) 1080 SDL_EventState(SDL_FINGERMOTION, SDL_DISABLE);
1081 SDL_EventState(SDL_FINGERDOWN, SDL_DISABLE);
1082 SDL_EventState(SDL_FINGERUP, SDL_DISABLE);
1088 SDL_StartTextInput();
1092 const std::time_t
t = std::time(
nullptr);
1093 std::cerr <<
"Started on " << ctime(&t) <<
"\n";
1096 if(!exe_dir.empty()) {
1099 std::string auto_dir;
1118 if(!auto_dir.empty()) {
1127 std::cerr <<
"Error in command line: " << e.what() <<
'\n';
1130 std::cerr <<
"Could not initialize video.\n\n" << e.
what() <<
"\n\nExiting.\n";
1133 std::cerr <<
"Could not initialize fonts.\n\n" << e.
what() <<
"\n\nExiting.\n";
1136 std::cerr << e.
message <<
"\n";
1139 std::cerr <<
"Could not create button: Image could not be found\n";
1143 }
catch(
const return_to_play_side_exception&) {
1144 std::cerr <<
"caught return_to_play_side_exception, please report this bug (quitting)\n";
1146 std::cerr <<
"caught quit_game_exception (quitting)\n";
1148 std::cerr <<
"WML exception:\nUser message: " << e.
user_message <<
"\nDev message: " << e.
dev_message <<
'\n';
1151 std::cerr << e.
what() <<
"\n\nGame will be aborted.\n";
1154 std::cerr << e.
what();
1159 }
catch(
const std::bad_alloc&) {
1160 std::cerr <<
"Ran out of memory. Aborted.\n";
1162 #if !defined(NO_CATCH_AT_GAME_END) 1163 }
catch(
const std::exception& e) {
1165 std::cerr <<
"Caught general '" <<
typeid(
e).
name() <<
"' exception:\n" << e.what() << std::endl;
1167 }
catch(
const std::string& e) {
1168 std::cerr <<
"Caught a string thrown as an exception:\n" << e << std::endl;
1170 }
catch(
const char* e) {
1171 std::cerr <<
"Caught a string thrown as an exception:\n" << e << std::endl;
1178 std::cerr <<
"Caught unspecified general exception. Terminating." << std::endl;
Exception used to escape form the ai or ui code to playsingle_controller::play_side.
bool log_precise_timestamps
True if –log-precise was given on the command line. Shows timestamps in log with more precision...
static void wesnoth_terminate_handler(int)
void set_callback(const std::string &name, callback_function)
config & child(config_key_type key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
static int handle_validate_command(const std::string &file, abstract_validator &validator, const std::vector< std::string > &defines)
void bind_textdomain(const char *domain, const char *directory, const char *)
const_all_children_itors all_children_range() const
In-order iteration over all children.
bool using_own_console()
Returns true if a console was allocated by the Wesnoth process.
void set(CURSOR_TYPE type)
Use the default parameter to reset cursors.
std::string library_versions_report()
Produce a plain-text report of library versions suitable for stdout/stderr.
static void bzip2_encode(const std::string &input_file, const std::string &output_file)
static void bzip2_decode(const std::string &input_file, const std::string &output_file)
Interfaces for manipulating version numbers of engine, add-ons, etc.
boost::optional< std::string > bzip2
Non-empty if –bzip2 was given on the command line. Compresses a file to .bz2 and exits...
static lg::log_domain log_preprocessor("preprocessor")
void set_team_colors(const std::vector< std::string > *colors)
set the team colors used by the TC image modification use a vector with one string for each team usin...
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...
std::string optional_features_report()
Produce a plain-text report of features suitable for stdout/stderr.
static l_noret error(LoadState *S, const char *why)
void set_user_data_dir(std::string newprefdir)
int compare(const std::string &s1, const std::string &s2)
Case-sensitive lexicographical comparison.
static bool file_exists(const bfs::path &fpath)
child_itors child_range(config_key_type key)
bool userdata_path
True if –userdata-path was given on the command line. Prints path to user data directory and exits...
static void gzip_decode(const std::string &input_file, const std::string &output_file)
static void progress(loading_stage stage=loading_stage::none)
filesystem::scoped_istream istream_file(const std::string &fname, bool treat_failure_as_error)
std::string user_message
The message for the user explaining what went wrong.
This class implements the title screen.
boost::optional< std::string > gunzip
Non-empty if –gunzip was given on the command line. Uncompresses a .gz file and exits.
void init()
Some tasks to run on startup.
Type that can be thrown as an exception to quit to desktop.
void early_log_file_setup()
Sets up the initial temporary log file.
boost::optional< unsigned int > rng_seed
RNG seed specified by –rng-seed option. Initializes RNG with given seed.
void preprocess_resource(const std::string &res_name, preproc_map *defines_map, bool write_cfg, bool write_plain_cfg, const std::string &parent_directory)
boost::optional< std::string > data_dir
Non-empty if –data-dir was given on the command line. Sets the config dir to the specified one...
Don't reload if the previous defines equal the new defines.
static void safe_exit(int res)
std::string normalize_path(const std::string &fpath, bool normalize_separators, bool resolve_dot_entries)
Returns the absolute path of a file.
Contains the exception interfaces used to signal completion of a scenario, campaign or turn...
bool show(const unsigned auto_close_time=0)
Shows the window.
Definitions for the interface to Wesnoth Markup Language (WML).
static void decode(const std::string &input_file, const std::string &output_file)
bool preprocess
True if –preprocess was given on the command line. Starts Wesnoth in preprocessor-only mode...
bool play_multiplayer(mp_selection res)
One of the realizations of serialization/validator.hpp abstract validator.
unsigned in
If equal to search_counter, the node is off the list.
static const char * name(const std::vector< SDL_Joystick *> &joysticks, const std::size_t index)
Used in parsing config file.
boost::optional< std::string > validate_schema
Non-empty if –validate-schema was given on the command line. Makes Wesnoth validate a WML schema...
static void warn_early_init_failure()
Print an alert and instructions to stderr about early initialization errors.
bool joystick_support_enabled()
boost::optional< std::string > userconfig_dir
Non-empty if –userconfig-dir was given on the command line. Sets the user config dir to the specifie...
bool report
True if –report was given on the command line. Prints a bug report-style info dump and exits...
void read(config &cfg, std::istream &in, abstract_validator *validator)
Class for writing a config out to a file in pieces.
std::string get_user_data_dir()
std::string get_intl_dir()
static lg::log_domain log_config("config")
bool strict_validation_enabled
void init()
Initializes the GUI subsystems.
boost::optional< std::string > logdomains
Non-empty if –logdomains was given on the command line. Prints possible logdomains filtered by given...
boost::optional< std::string > userdata_dir
Non-empty if –userdata-dir was given on the command line. Sets the user data dir to the specified on...
boost::optional< std::string > gzip
Non-empty if –gzip was given on the command line. Compresses a file to .gz and exits.
void enable_native_console_output()
Switches to using a native console instead of log file redirection.
bool is_directory(const std::string &fname)
Returns true if the given file is a directory.
std::unique_ptr< std::istream > scoped_istream
boost::optional< std::string > preprocess_output_macros
Non-empty if –preprocess-output-macros was given on the command line. Outputs all preprocessed macro...
void set_default_textdomain(const char *domain)
void refresh_addon_version_info_cache()
Refreshes the per-session cache of add-on's version information structs.
std::string sanitize_path(const std::string &path)
Sanitizes a path to remove references to the user's name.
const char * what() const noexcept
bool userconfig_path
True if –userconfig-path was given on the command line. Prints path to user config directory and exi...
static void handle_preprocess_command(const commandline_options &cmdline_opts)
boost::optional< std::vector< std::pair< int, std::string > > > log
Contains parsed arguments of –log-* (e.g.
boost::optional< std::string > render_image
Image path to render. First parameter after –render-image.
int main(int argc, char **argv)
Helper class, don't construct this directly.
static int do_gameloop(const std::vector< std::string > &args)
Setups the game environment and enters the titlescreen or game loops.
std::string dev_message
The message for developers telling which problem was triggered, this shouldn't be translated...
static void gzip_encode(const std::string &input_file, const std::string &output_file)
std::unique_ptr< std::ostream > scoped_ostream
bool is_gzip_file(const std::string &filename)
Returns true if the file ends with '.gz'.
Some defines: VERSION, PACKAGE, MIN_SAVEGAME_VERSION.
boost::optional< std::string > validate_wml
Non-empty if –validate was given on the command line. Makes Wesnoth validate a WML file against a sc...
static void handle_lua_script_args(game_launcher *game, commandline_options &)
Handles the lua script command line arguments if present.
std::string get_exe_dir()
boost::optional< std::string > preprocess_target
Target (output) path that was given to the –preprocess option.
static void init_locale()
I would prefer to setup locale first so that early error messages can get localized, but we need the game_launcher initialized to have filesystem::get_intl_dir() to work.
Log file control routines for Windows.
void set_user_config_dir(const std::string &newconfigdir)
bool debug_lua
True if –debug-lua was given in the commandline. Enables some Lua debugging mechanisms.
std::string get_wml_location(const std::string &filename, const std::string ¤t_dir)
Returns a complete path to the actual WML file or directory or an empty string if the file isn't pres...
const std::string revision
boost::optional< std::string > preprocess_path
Path to parse that was given to the –preprocess option.
void set_strict_severity(int severity)
static int process_command_args(const commandline_options &cmdline_opts)
Process commandline-arguments.
An exception object used when an IO error occurs.
boost::optional< std::string > bunzip2
Non-empty if –bunzip2 was given on the command line. Uncompresses a .bz2 file and exits...
structure which will hide all current floating labels, and cause floating labels instantiated after i...
Declarations for File-IO.
static int writer(lua_State *L, const void *b, size_t size, void *B)
Contains a basic exception class for SDL operations.
const version_info wesnoth_version(VERSION)
bool set_log_domain_severity(const std::string &name, int severity)
bool data_path
True if –data-path was given on the command line. Prints path to data directory and exits...
std::string get_user_config_dir()
bool screenshot
True if –screenshot was given on the command line. Starts Wesnoth in screenshot mode.
bool is_bzip2_file(const std::string &filename)
Returns true if the file ends with '.bz2'.
static void display(std::function< void()> f)
Contains the SDL_Rect helper code.
Base class for all the errors encountered by the engine.
void play_music_config(const config &music_node, bool allow_interrupt_current_track, int i)
std::string list_logdomains(const std::string &filter)
bool version
True if –version was given on the command line. Prints version and exits.
Standard logging facilities (interface).
std::string str() const
Serializes the version number into string form.
EXIT_STATUS start(const std::string &filename, bool take_screenshot, const std::string &screenshot_filename)
Main interface for launching the editor from the title screen.
bool strict_validation
True if –strict-validation was given on the command line. Makes Wesnoth trust validation errors as f...
boost::optional< std::vector< std::string > > preprocess_defines
Defines that were given to the –preprocess option.
std::map< std::string, struct preproc_define > preproc_map
static void encode(const std::string &input_file, const std::string &output_file)
Realization of serialization/validator.hpp abstract validator.
boost::optional< std::string > preprocess_input_macros
Non-empty if –preprocess-input-macros was given on the command line. Specifies a file that contains ...
void set_create_exceptions(bool value)
bool update_from_preferences()
initialize any private data, e.g. algorithm choices from preferences
A config object defines a single node in a WML file, with access to child nodes.
filesystem::scoped_istream preprocess_file(const std::string &fname, preproc_map *defines)
static preproc_map::value_type read_pair(const config &)
int wesnoth_main(int argc, char **argv)
bool help
True if –help was given on the command line. Prints help and exits.
std::string directory_name(const std::string &file)
Returns the directory name of a file, with filename stripped.
boost::optional< std::string > validate_with
Non-empty if –use-schema was given on the command line. Specifies the schema for use with –validate...
std::string full_build_report()
Produce a bug report-style info dump.
std::string wesnoth_program_dir
void precise_timestamps(bool pt)
void set_debug(bool new_debug)
filesystem::scoped_ostream ostream_file(const std::string &fname, bool create_directory)