change #ifdef USE_EDITOR2 to #ifndef DISABLE_EDITOR2...

...and update buildsystems accordingly. This will force people using
custom builds (e.g. devcpp, codeblocks) to either add editor2 sources
or consciously disable it.
This commit is contained in:
Tomasz Śniatowski 2008-09-05 14:32:24 +01:00
parent 152a0c1554
commit d553c9d313
13 changed files with 34 additions and 26 deletions

View file

@ -100,9 +100,9 @@ if(NOT WIN32)
add_definitions(-DWESNOTH_PATH='\"${DATADIR}\"')
endif(NOT WIN32)
if(ENABLE_EDITOR2)
add_definitions(-DUSE_EDITOR2)
endif(ENABLE_EDITOR2)
if(NOT ENABLE_EDITOR2)
add_definitions(-DDISABLE_EDITOR2)
endif(NOT ENABLE_EDITOR2)
if(X11_FOUND)
add_definitions(-D_X11)

View file

@ -32,3 +32,9 @@ Removed the --small-gui build option, starting Wesnoth with the --smallgui
parameter achieves the same.
***
Editor2 is now built by default, that is, without having to supply an extra
compilation flag. To build *without* editor2, set the DISABLE_EDITOR2 define.
The behaviour of scons, cmake and autotools is unchanged, this affects only
people who use some other building method. If you start getting linker errors,
you most likely need to add editor2's sources to the build or disable it.

View file

@ -282,8 +282,8 @@ if env['lowmem']:
if env['internal_data']:
env.Append(CPPDEFINES = "USE_INTERNAL_DATA")
if env['editor2']:
env.Append(CPPDEFINES = "USE_EDITOR2")
if not env['editor2']:
env.Append(CPPDEFINES = "DISABLE_EDITOR2")
if have_X:
env.Append(CPPDEFINES = "_X11")

View file

@ -6,6 +6,8 @@ Version 1.5.3+svn:
* More visible selection - draw a special overlay on every selected hex.
* Allow different map generators to be used in map -> generate map
(FR #3950)
* Reverse the preprocessor logic in src/ to default to building editor2,
with a DISABLE_EDITOR2 define to build without it.
* Language and i18n:
* updated translations: Chinese (Traditional), Czech, French, Galician,
German, Hungarian, Italian, Polish

View file

@ -302,9 +302,9 @@ AM_CONDITIONAL([INCLUDEDINTL], [test x$nls_cv_use_gnu_gettext = xyes])
AM_CONDITIONAL([INSTALLDATA], [test [ x$game = xyes || test x$editor = xyes || test x$editor2 = xyes ]])
AM_CONDITIONAL([DUMMYLOCALES], [test x$dummylocales = xyes])
if test x$editor2 = xyes
if test x$editor2 = xno
then
CXXFLAGS="$CXXFLAGS -DUSE_EDITOR2"
CXXFLAGS="$CXXFLAGS -DDISABLE_EDITOR2"
fi
if test x$dummylocales = xyes; then

View file

@ -73,7 +73,7 @@
#include "ai_python.hpp"
#endif
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
#include "editor2/editor_main.hpp"
#endif
@ -134,7 +134,7 @@ public:
bool new_campaign();
bool goto_campaign();
bool goto_multiplayer();
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
bool goto_editor();
#endif
bool play_multiplayer();
@ -147,7 +147,7 @@ public:
enum RELOAD_GAME_DATA { RELOAD_DATA, NO_RELOAD_DATA };
void play_game(RELOAD_GAME_DATA reload=RELOAD_DATA);
void play_replay();
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
editor2::EXIT_STATUS start_editor();
#endif
void start_wesnothd();
@ -205,7 +205,7 @@ private:
std::string multiplayer_server_;
bool jump_to_campaign_, jump_to_multiplayer_;
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
bool jump_to_editor_;
#endif
game_config::config_cache& cache_;
@ -244,7 +244,7 @@ game_controller::game_controller(int argc, char** argv) :
multiplayer_server_(),
jump_to_campaign_(false),
jump_to_multiplayer_(false)
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
,jump_to_editor_(false)
#endif
,cache_(game_config::config_cache::instance())
@ -353,7 +353,7 @@ game_controller::game_controller(int argc, char** argv) :
} else if(val == "--new-widgets") {
// This is a hidden option to enable the new widget toolkit.
gui2::new_widgets = true;
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
} else if(val == "-e" || val == "--editor") {
jump_to_editor_ = true;
#endif
@ -1114,7 +1114,7 @@ bool game_controller::goto_multiplayer()
return true;
}
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
bool game_controller::goto_editor()
{
if(jump_to_editor_){
@ -1581,7 +1581,7 @@ void game_controller::play_replay()
}
}
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
editor2::EXIT_STATUS game_controller::start_editor()
{
cache_.clear_defines();
@ -1665,7 +1665,7 @@ static int process_command_args(int argc, char** argv) {
<< " additional command mode options in-game.\n"
<< " --decompress INFILE OUTFILE decompresses a savefile (INFILE) that is in binary\n"
<< " WML format into text WML format (OUTFILE).\n"
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
<< " -e, --editor starts editor2 not showing title screen.\n"
#endif
<< " -f, --fullscreen runs the game in full screen mode.\n"
@ -1969,7 +1969,7 @@ static int play_game(int argc, char** argv)
if(game.goto_multiplayer() == false){
continue; //Go to main menu
}
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
if (game.goto_editor() == false) {
return 0;
}
@ -2053,7 +2053,7 @@ static int play_game(int argc, char** argv)
loadscreen::global_loadscreen_manager loadscreen(game.disp().video());
game.reload_changed_game_config();
continue;
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
} else if(res == gui::START_MAP_EDITOR) {
//@todo editor can ask the game to quit completely
if (game.start_editor() == editor2::EXIT_QUIT_TO_DESKTOP) {

View file

@ -90,7 +90,7 @@ static void fill_window_types()
window_type_list[MP_SERVER_LIST] = "mp_server_list";
window_type_list[MP_CREATE_GAME] = "mp_create_game";
window_type_list[TITLE_SCREEN] = "title_screen";
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
window_type_list[EDITOR_NEW_MAP] = "editor_new_map";
window_type_list[EDITOR_GENERATE_MAP] = "editor_generate_map";
window_type_list[EDITOR_RESIZE_MAP] = "editor_resize_map";

View file

@ -42,7 +42,7 @@ enum twindow_type {
//! mp game the user wants to play.
MP_SERVER_LIST, //<! The mp server list dialog.
MP_CREATE_GAME, /**< The mp creation dialog. */
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
EDITOR_NEW_MAP, //<! New map dialog
EDITOR_GENERATE_MAP, /** Editor random map genarator dialog */
EDITOR_RESIZE_MAP, /** Editor resize map dialog */

View file

@ -172,7 +172,7 @@ twindow::tretval twindow::get_retval_by_id(const std::string& id)
*/
} else if(id == "tutorial") {
return static_cast<tretval>(gui::TUTORIAL);
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
} else if(id == "editor") {
return static_cast<tretval>(gui::START_MAP_EDITOR);
#endif

View file

@ -130,7 +130,7 @@ const struct {
{ hotkey::HOTKEY_EDIT_AUTO_UPDATE, "editautoupdate", N_("Delay transition updates"), true, hotkey::SCOPE_GENERAL },
{ hotkey::HOTKEY_EDIT_UPDATE, "editupdate", N_("Update transitions"), true, hotkey::SCOPE_GENERAL },
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
{ hotkey::HOTKEY_EDITOR_QUIT_TO_DESKTOP, "editor-quit-to-desktop", N_("Quit to Desktop"), false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_PARTIAL_UNDO, "editor-partial-undo", N_("Partial Undo"), false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_MAP_NEW, "editor-map-new", N_("New Map"), false, hotkey::SCOPE_EDITOR },

View file

@ -70,7 +70,7 @@ enum HOTKEY_COMMAND {
HOTKEY_EDIT_FLIP, HOTKEY_EDIT_SELECT_ALL, HOTKEY_EDIT_DRAW,
HOTKEY_EDIT_REFRESH, HOTKEY_EDIT_UPDATE, HOTKEY_EDIT_AUTO_UPDATE,
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
HOTKEY_EDITOR_QUIT_TO_DESKTOP,
HOTKEY_EDITOR_PARTIAL_UNDO,
HOTKEY_EDITOR_MAP_NEW, HOTKEY_EDITOR_MAP_LOAD, HOTKEY_EDITOR_MAP_SAVE,

View file

@ -369,7 +369,7 @@ TITLE_RESULT show_title(game_display& screen, config& tips_of_day)
N_("TitleScreen button^Multiplayer"),
N_("TitleScreen button^Load"),
N_("TitleScreen button^Add-ons"),
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
N_("TitleScreen button^Editor"),
#endif
N_("TitleScreen button^Language"),
@ -389,7 +389,7 @@ TITLE_RESULT show_title(game_display& screen, config& tips_of_day)
N_("Play multiplayer (hotseat, LAN, or Internet), or a single scenario against the AI"),
N_("Load a saved game"),
N_("Download usermade campaigns, eras, or map packs"),
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
N_("Start the map editor"),
#endif
N_("Change the language"),

View file

@ -31,7 +31,7 @@ enum TITLE_RESULT { TUTORIAL = 1, /**< Start special campaign 'tutorial' */
NEW_CAMPAIGN, /**< Let user select a campaign to play */
MULTIPLAYER, /**< Play single scenario against humans or AI */
LOAD_GAME, GET_ADDONS,
#ifdef USE_EDITOR2
#ifndef DISABLE_EDITOR2
START_MAP_EDITOR,
#endif
CHANGE_LANGUAGE, EDIT_PREFERENCES,