61 #include "widgets/button.hpp"
76 #include <boost/iostreams/categories.hpp>
77 #include <boost/iostreams/copy.hpp>
78 #include <boost/iostreams/filter/bzip2.hpp>
79 #include <boost/iostreams/filter/gzip.hpp>
80 #include <boost/iostreams/filtering_stream.hpp>
81 #include <boost/optional.hpp>
82 #include <boost/program_options/errors.hpp>
83 #include <boost/scoped_ptr.hpp>
84 #include <boost/tuple/tuple.hpp>
103 #ifdef INADDR_BROADCAST
104 #undef INADDR_BROADCAST
110 #if defined(_OPENMP) && _MSC_VER >= 1600
115 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
119 #ifdef HAVE_VISUAL_LEAK_DETECTOR
123 class end_level_exception;
127 #define LOG_CONFIG LOG_STREAM(info, log_config)
129 #define LOG_GENERAL LOG_STREAM(info, lg::general())
132 #define LOG_PREPROC LOG_STREAM(info,log_preprocessor)
139 LOG_GENERAL <<
"exiting with code " << res <<
"\n";
144 template <
typename filter>
148 std::ifstream ifile(input_file.c_str(),
152 std::cerr <<
"Input file " << input_file <<
" is not good for reading. Exiting to prevent bzip2 from segfaulting\n";
155 std::ofstream ofile(output_file.c_str(), std::ios_base::out
157 boost::iostreams::filtering_stream<boost::iostreams::output>
stream;
160 boost::iostreams::copy(ifile, stream);
164 std::cerr <<
"IO error: " << e.
what() <<
"\n";
168 template <
typename filter>
172 std::ofstream ofile(output_file.c_str(), std::ios_base::out
174 std::ifstream ifile(input_file.c_str(),
176 boost::iostreams::filtering_stream<boost::iostreams::input>
stream;
179 boost::iostreams::copy(stream, ofile);
183 std::cerr <<
"IO error: " << e.
what() <<
"\n";
189 encode<boost::iostreams::gzip_compressor>(input_file, output_file);
194 decode<boost::iostreams::gzip_decompressor>(input_file, output_file);
199 encode<boost::iostreams::bzip2_compressor>(input_file, output_file);
204 decode<boost::iostreams::bzip2_decompressor>(input_file, output_file);
215 std::cerr <<
"please specify an existing file. File "<< file <<
" doesn't exist.\n";
219 std::cerr << SDL_GetTicks() <<
" Reading cached defines from: " << file <<
"\n";
225 read( cfg, *stream );
227 std::cerr <<
"Caught a config error while parsing file '" << file <<
"':\n" << e.
message << std::endl;
235 input_macros[def.first] = def.second;
238 std::cerr << SDL_GetTicks() <<
" Read " << read <<
" defines.\n";
244 Uint32 startTime = SDL_GetTicks();
246 bool skipCore =
false;
247 bool skipTerrainGFX =
false;
256 std::cerr <<
"empty define supplied\n";
260 LOG_PREPROC <<
"adding define: " << define <<
'\n';
261 defines_map.insert(std::make_pair(define,
preproc_define(define)));
263 if (define ==
"SKIP_CORE")
265 std::cerr <<
"'SKIP_CORE' defined.\n";
268 else if (define ==
"NO_TERRAIN_GFX")
270 std::cerr <<
"'NO_TERRAIN_GFX' defined." << std::endl;
271 skipTerrainGFX =
true;
279 std::cerr <<
"added " << defines_map.size() <<
" defines.\n";
282 if (skipCore ==
false) {
283 std::cerr <<
"preprocessing common macros from 'data/core' ...\n";
287 if (skipTerrainGFX ==
false)
290 std::cerr <<
"acquired " << (defines_map.size() - input_macros.size())
291 <<
" 'data/core' defines.\n";
294 std::cerr <<
"skipped 'data/core'\n";
297 std::cerr <<
"preprocessing specified resource: "
298 << resourceToProcess <<
" ...\n";
300 std::cerr <<
"acquired " << (defines_map.size() - input_macros.size())
301 <<
" total defines.\n";
310 std::string outputPath = targetDir +
"/" + outputFileName;
312 std::cerr <<
"writing '" << outputPath <<
"' with "
313 << defines_map.size() <<
" defines.\n";
323 (*itor).second.write(writer, (*itor).first);
327 std::cerr <<
"couldn't open the file.\n";
330 std::cerr <<
"preprocessing finished. Took "<< SDL_GetTicks() - startTime <<
" ticks.\n";
354 std::cerr <<
"Overriding data directory with " << datadir << std::endl;
357 if(datadir.c_str()[1] ==
':') {
359 if(datadir[0] ==
'/') {
383 std::cerr <<
"file '" << input_file <<
"'isn't a .gz file\n";
387 input_file, 0, input_file.length() - 3);
393 std::cerr <<
"file '" << input_file <<
"'isn't a .bz2 file\n";
397 input_file, 0, input_file.length() - 4);
400 if(cmdline_opts.
gzip) {
405 if(cmdline_opts.
bzip2) {
410 if(cmdline_opts.
help) {
411 std::cout << cmdline_opts;
414 if(cmdline_opts.
log) {
415 for(std::vector<boost::tuple<int, std::string> >::const_iterator it=cmdline_opts.
log->begin(); it!=cmdline_opts.
log->end(); ++it)
421 std::cerr <<
"unknown log domain: " << log_domain <<
'\n';
430 if(cmdline_opts.
path) {
441 SDL_setenv(
"SDL_VIDEODRIVER",
"dummy", 1);
472 #if defined _WIN32 || defined __APPLE__
473 setlocale(LC_ALL,
"English");
475 std::setlocale(LC_ALL,
"C");
497 <<
"An error at this point during initialization usually indicates that the data\n"
498 <<
"directory above was not correctly set or detected. Try passing the correct path\n"
499 <<
"in the command line with the --data-dir switch or as the only argument.\n";
508 static bool first_time =
true;
510 if (!first_time)
return;
524 if(_controlfp_s(&f_control, 0, 0) == 0) {
526 uint32_t rounding_mode = f_control & _MCW_RC;
527 uint32_t precision_mode = f_control & _MCW_PC;
528 if(rounding_mode != _RC_NEAR) {
529 std::cerr <<
"Floating point rounding mode is currently '" <<
530 ((rounding_mode == _RC_CHOP) ?
"chop" :
531 (rounding_mode == _RC_UP) ?
"up" :
532 (rounding_mode == _RC_DOWN) ?
"down" :
533 (rounding_mode == _RC_NEAR) ?
"near" :
534 "unknown") <<
"' setting to 'near'\n";
535 if(_controlfp_s(&unused, _RC_NEAR, _MCW_RC)) {
536 std::cerr <<
"failed to set floating point rounding type to 'near'\n";
539 if(precision_mode != _PC_53) {
540 std::cerr <<
"Floating point precision mode is currently '" <<
541 ((precision_mode == _PC_53) ?
"double" :
542 (precision_mode == _PC_24) ?
"single" :
543 (precision_mode == _PC_64 ) ?
"double extended" :
544 "unknown") <<
"' setting to 'double'\n";
545 if(_controlfp_s(&unused, _PC_53, _MCW_PC)) {
546 std::cerr <<
"failed to set floating point precision type to 'double'\n";
551 std::cerr <<
"_controlfp_s failed.\n";
557 switch (fegetround()) {
558 case FE_TONEAREST:
break;
559 case FE_DOWNWARD: std::cerr <<
"Floating point precision mode is currently 'downward'";
goto reset_fpu;
560 case FE_TOWARDZERO: std::cerr <<
"Floating point precision mode is currently 'toward-zero'";
goto reset_fpu;
561 case FE_UPWARD: std::cerr <<
"Floating point precision mode is currently 'upward'";
goto reset_fpu;
562 default: std::cerr <<
"Floating point precision mode is currently 'unknown'";
goto reset_fpu;
564 std::cerr <<
"setting to 'nearest'";
565 fesetround(FE_TONEAREST);
576 srand(time(
nullptr));
585 boost::scoped_ptr<game_launcher>
game(
587 const int start_ticks = SDL_GetTicks();
598 std::cerr <<
"could not initialize fonts\n";
604 res = game->init_language();
606 std::cerr <<
"could not initialize the language\n";
610 res = game->init_video();
612 std::cerr <<
"could not initialize display\n";
618 std::cerr <<
"could not initialize image preferences\n";
623 res = game->init_joystick();
625 std::cerr <<
"could not initialize joystick\n";
633 #if (defined(_X11) && !defined(__APPLE__)) || defined(_WIN32)
634 SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
641 game->jump_to_editor());
648 std::cerr <<
"could not initialize game config\n";
655 std::cerr <<
"could not re-initialize fonts for the current language\n";
669 LOG_CONFIG <<
"time elapsed: "<< (SDL_GetTicks() - start_ticks) <<
" ms\n";
692 if (!game->is_loading()) {
694 config_manager.game_config().
child(
"titlescreen_music");
714 std::cerr <<
"The wesnoth built-in timeout feature has been removed.\n" << std::endl;
715 std::cerr <<
"Please use a platform-specific script which will kill the overtime process instead.\n" << std::endl;
716 std::cerr <<
"For examples in bash, or in windows cmd, see the forums, or the wesnoth repository." << std::endl;
717 std::cerr <<
"The bash script is called `run_wml_tests`, the windows script is part of the VC project.\n" << std::endl;
719 int worker_result = game->unit_test();
720 std::cerr << ((worker_result == 0) ?
"PASS TEST " :
"FAIL TEST ")
721 << ((worker_result == 3) ?
"(INVALID REPLAY)" :
"")
722 << ((worker_result == 4) ?
"(ERRORED REPLAY)" :
"")
723 <<
": "<<*cmdline_opts.
unit_test << std::endl;
724 return worker_result;
727 if(game->play_test() ==
false) {
731 if(game->play_screenshot_mode() ==
false) {
735 if(game->play_render_image_mode() ==
false) {
740 if(game->goto_campaign() ==
false){
741 if (game->jump_to_campaign_id().empty())
749 if(game->goto_multiplayer() ==
false){
754 if(game->play_multiplayer_commandline() ==
false) {
758 if (game->goto_editor() ==
false) {
773 dlg.
show(game->video());
785 if(game->load_game() ==
false) {
786 game->clear_loaded_game();
792 game->set_tutorial();
794 if(game->new_campaign() ==
false) {
800 if(game->play_multiplayer() ==
false) {
805 if (game->change_language()) {
810 }
catch ( std::runtime_error &
e ) {
815 game->show_preferences();
829 config_manager.reload_changed_game_config();
835 std::vector<config> cores;
837 cores.push_back(core);
839 current = cores.size() -1;
843 if (core_dlg.
show(game->video())) {
847 config_manager.reload_changed_game_config();
852 config_manager.reload_changed_game_config();
857 game->start_editor();
860 game->launch_game(should_reload);
864 static bool parse_commandline_argument(
const char*&
next,
const char*
end,
std::string& res)
867 while(next != end && *next ==
' ')
872 bool is_excaped =
false;
876 if(*next ==
' ' && !is_excaped) {
879 else if(*next ==
'"' && !is_excaped) {
883 else if(*next ==
'"' && is_excaped && next + 1 != end && *(next + 1) ==
'"') {
888 else if(*next ==
'"' && is_excaped ) {
893 res.push_back(*next);
899 static std::vector<std::string> parse_commandline_arguments(
std::string input)
901 const char*
start = &input[0];
902 const char* end = start + input.size();
904 std::vector<std::string>
res;
906 while(parse_commandline_argument(start, end, buffer))
909 res.back().swap(buffer);
921 #if defined(_OPENMP) && _MSC_VER >= 1600
922 static void restart_process(
const std::vector<std::string>& commandline)
924 wchar_t process_path[MAX_PATH];
925 SetLastError(ERROR_SUCCESS);
926 GetModuleFileNameW(
nullptr, process_path, MAX_PATH);
927 if (GetLastError() != ERROR_SUCCESS)
929 throw std::runtime_error(
"Failed to retrieve the process path");
935 wchar_t* commandline_c_str =
new wchar_t[commandline_str.length() + 1];
936 commandline_str.copy(commandline_c_str, commandline_str.length());
937 commandline_c_str[commandline_str.length()] = L
'\0';
939 STARTUPINFOW startup_info;
940 ZeroMemory(&startup_info,
sizeof(startup_info));
941 startup_info.cb =
sizeof(startup_info);
942 PROCESS_INFORMATION process_info;
943 ZeroMemory(&process_info,
sizeof(process_info));
945 CreateProcessW(process_path, commandline_c_str,
nullptr,
nullptr,
946 false, 0u,
nullptr,
nullptr, &startup_info, &process_info);
948 CloseHandle(process_info.hProcess);
949 CloseHandle(process_info.hThread);
951 std::exit(EXIT_SUCCESS);
955 #if defined(__native_client__) || defined(__APPLE__)
959 int main(
int argc,
char** argv)
963 #ifdef HAVE_VISUAL_LEAK_DETECTOR
972 std::vector<std::string> args = parse_commandline_arguments(unicode_cast<std::string>(std::wstring(GetCommandLineW())));
978 for(
size_t k = 0; k < args.size(); ++k) {
979 if(args[k] ==
"--wconsole" || args[k] ==
"--help" || args[k] ==
"--nogui" || args[k] ==
"--logdomains" || args[k] ==
"--path" || args[k] ==
"--render-image" || args[k] ==
"--screenshot" || args[k] ==
"--data-path" || args[k] ==
"--userdata-path" || args[k] ==
"--userconfig-path" || args[k] ==
"--version") {
987 std::vector<std::string> args;
988 for(
int i = 0;
i < argc; ++
i)
993 assert(!args.empty());
1008 #if !defined(_WIN32) && !defined(__APPLE__)
1009 if (!getenv(
"OMP_WAIT_POLICY")) {
1010 setenv(
"OMP_WAIT_POLICY",
"PASSIVE", 1);
1011 execv(argv[0], argv);
1013 #elif _MSC_VER >= 1600
1014 if (!getenv(
"OMP_WAIT_POLICY")) {
1015 _putenv_s(
"OMP_WAIT_POLICY",
"PASSIVE");
1017 restart_process(args);
1022 if(SDL_Init(SDL_INIT_TIMER) < 0) {
1023 fprintf(stderr,
"Couldn't initialize SDL: %s\n", SDL_GetError());
1028 struct sigaction terminate_handler;
1030 terminate_handler.sa_flags = 0;
1031 sigemptyset(&terminate_handler.sa_mask);
1032 sigaction(SIGTERM, &terminate_handler,
nullptr);
1033 sigaction(SIGINT, &terminate_handler,
nullptr);
1038 const time_t
t = time(
nullptr);
1039 std::cerr <<
"Started on " << ctime(&t) <<
"\n";
1042 if(!exe_dir.empty()) {
1064 if(!auto_dir.empty()) {
1065 std::cerr <<
"Automatically found a possible data directory at "
1066 << auto_dir <<
'\n';
1074 std::cerr <<
"Error in command line: " << e.what() <<
'\n';
1077 std::cerr <<
"Could not initialize video. Exiting.\n";
1080 std::cerr <<
"Could not initialize fonts. Exiting.\n";
1083 std::cerr << e.
message <<
"\n";
1086 std::cerr <<
"Could not create button: Image could not be found\n";
1090 }
catch(return_to_play_side_exception&) {
1091 std::cerr <<
"caught return_to_play_side_exception, please report this bug (quitting)\n";
1093 std::cerr <<
"caught quit_game_exception (quitting)\n";
1095 std::cerr <<
"WML exception:\nUser message: "
1099 std::cerr << e.
what()
1100 <<
"\n\nGame will be aborted.\n";
1103 std::cerr << e.
what();
1108 }
catch(std::bad_alloc&) {
1109 std::cerr <<
"Ran out of memory. Aborted.\n";
1111 #if !defined(NO_CATCH_AT_GAME_END)
1112 }
catch(std::exception & e) {
1114 std::cerr <<
"Caught general exception:\n" << e.what() << std::endl;
1117 std::cerr <<
"Caught a string thrown as an exception:\n" << e << std::endl;
1119 }
catch(
const char * e) {
1120 std::cerr <<
"Caught a string thrown as an exception:\n" << e << std::endl;
1127 std::cerr <<
"Caught unspecified general exception. Terminating." << std::endl;
void show_about(CVideo &video, const std::string &campaign)
Show credits with list of contributors.
bool log_precise_timestamps
True if –log-precise was given on the command line. Shows timestamps in log with more precision...
child_itors child_range(const std::string &key)
static void wesnoth_terminate_handler(int)
void show_error_message(CVideo &video, const std::string &message, bool message_use_markup)
Shows an error message to the user.
void show_help(CVideo &video, const std::string &show_topic, int xloc, int yloc)
Open the help browser, show topic with id show_topic.
void set_callback(const std::string &name, callback_function)
static void reset_translations()
Used to reload all game data.
void set_user_data_dir(std::string path)
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
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)
const char * what() const
Play single scenario against humans or AI.
const std::function< int(const config &, const std::string &, int) > get_int
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.
bool show(CVideo &video, const unsigned auto_close_time=0)
Shows the window.
static l_noret error(LoadState *S, const char *why)
ucs4_convert_impl::enableif< TD, typename TS::value_type >::type unicode_cast(const TS &source)
GLenum GLenum GLenum input
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)
boost::optional< std::string > gunzip
Non-empty if –gunzip was given on the command line. Uncompresses a .gz file and exits.
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.
bool manage_addons(CVideo &v)
Shows the add-ons server connection dialog, for access to the various management front-ends.
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...
Dont reload if the previous defines equal the new defines.
static void safe_exit(int res)
boost::optional< std::vector< boost::tuple< int, std::string > > > log
Contains parsed arguments of –log-* (e.g.
This file contains information about validation abstract level interface.
Contains the exception interfaces used to signal completion of a scenario, campaign or turn...
Default, nothing done, no redraw needed.
std::string quote(const std::string &str)
Surround the string 'str' with double quotes.
Definitions for the interface to Wesnoth Markup Language (WML).
static void decode(const std::string &input_file, const std::string &output_file)
Start special campaign 'tutorial'.
void bind_textdomain(const char *domain, const char *directory, const char *encoding)
std::map< std::string, preproc_define > preproc_map
boost::optional< unsigned int > timeout
Non-empty if –timeout was given on the command line. Dependent on –unit.
std::string user_message
The message for the user explaining what went wrong.
bool preprocess
True if –preprocess was given on the command line. Starts Wesnoth in preprocessor-only mode...
bool set_log_domain_severity(std::string const &name, int severity)
static game_config_manager * get()
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...
Class for writing a config out to a file in pieces.
std::string get_user_data_dir()
std::string get_intl_dir()
const GLuint GLenum const GLvoid * binary
std::string normalize_path(const std::string &path)
Returns the absolute path of a file.
static lg::log_domain log_config("config")
bool strict_validation_enabled
GLsizei const GLfloat * value
all_children_itors all_children_range() const
In-order iteration over all children.
std::istream * istream_file(const std::string &fname, bool treat_failure_as_error=true)
boost::optional< std::string > logdomains
Non-empty if –logdomains was given on the command line. Prints possible logdomains filtered by given...
std::string dev_message
The message for developers telling which problem was triggered, this shouldn't be translated...
void play_music_config(const config &music_node)
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...
std::ostream * ostream_file(std::string const &fname, bool create_directory=true)
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.
void set_core_id(const std::string &core_id)
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.
int wesnoth_main(int argc, char **argv)
bool init()
Initializes the gui subsystems.
bool userconfig_path
True if –userconfig-path was given on the command line. Prints path to user config directory and exi...
static void display(CVideo &video, std::function< void()> f)
static void handle_preprocess_command(const commandline_options &cmdline_opts)
bool path
True if –path was given on the command line. Prints the path to data directory and exits...
This class implements the title screen.
boost::optional< std::string > render_image
Image path to render. First parameter after –render-image.
std::string join(T const &v, const std::string &s=",")
Generates a new string joining container items in a list.
int main(int argc, char **argv)
static int do_gameloop(const std::vector< std::string > &args)
Setups the game environment and enters the titlescreen or game loops.
static void gzip_encode(const std::string &input_file, const std::string &output_file)
bool is_gzip_file(const std::string &filename)
Returns true if the file ends with '.gz'.
Some defines: VERSION, PACKAGE, MIN_SAVEGAME_VERSION.
static void progress(const char *stage_name=nullptr)
tresult
Values for the menu-items of the main menu.
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.
std::map< std::string, tfilter >::iterator itor
bool debug_lua
True if –debug-lua was given in the commandline. Enables some Lua debugging mechanisms.
void set_user_config_dir(std::string path)
const std::string revision
boost::optional< std::string > preprocess_path
Path to parse that was given to the –preprocess option.
static int process_command_args(const commandline_options &cmdline_opts)
Process commandline-arguments.
Game configuration data as global variables.
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.
void read(config &cfg, std::istream &in, abstract_validator *validator)
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)
Let user select a campaign to play.
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()
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
bool screenshot
True if –screenshot was given on the command line. Starts Wesnoth in screenshot mode.
boost::optional< std::string > unit_test
Non-empty if –unit was given on the command line. Goes directly into unit test mode, into a scenario, if specified.
bool is_bzip2_file(const std::string &filename)
Returns true if the file ends with '.bz2'.
Contains the SDL_Rect helper code.
Base class for all the errors encountered by the engine.
std::string list_logdomains(const std::string &filter)
void play_music_repeatedly(const std::string &id)
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
bool version
True if –version was given on the command line. Prints version and exits.
Standard logging facilities (interface).
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.
static void encode(const std::string &input_file, const std::string &output_file)
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 commit_music_changes()
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.
Helper class, don't construct this directly.
static preproc_map::value_type read_pair(const config &)
Interfaces for manipulating version numbers of engine, add-ons, etc.
bool file_exists(const std::string &name)
Returns true if a file or directory with such name already exists.
const std::string version
GLsizei const GLcharARB ** string
void preprocess_resource(const std::string &res_name, preproc_map *defines_map, bool write_cfg, bool write_plain_cfg, std::string target_directory)
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.
std::string wesnoth_program_dir
void precise_timestamps(bool pt)