Author: ilor
Date: Wed Jun 11 17:02:33 2008
New Revision: 27103
URL: http://svn.gna.org/viewcvs/wesnoth?rev=27103&view=rev
Log:
Fix disappearing menus ingame after editor2's old editor has been used
Modified:
trunk/src/editor/editor.hpp
trunk/src/editor2/editor_common.hpp
trunk/src/editor2/editor_main.cpp
trunk/src/game.cpp
Modified: trunk/src/editor/editor.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor/editor.hpp?rev=27103&r1=27102&r2=27103&view=diff
==============================================================================
--- trunk/src/editor/editor.hpp (original)
+++ trunk/src/editor/editor.hpp Wed Jun 11 17:02:33 2008
@@ -334,7 +334,9 @@
// cycles.
bool mouse_moved_;
bool highlighted_locs_cleared_;
+#ifndef USE_EDITOR2
const hotkey::manager hotkey_manager_;
+#endif
const preferences::display_manager prefs_disp_manager_;
static config prefs_;
static config hotkeys_;
Modified: trunk/src/editor2/editor_common.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_common.hpp?rev=27103&r1=27102&r2=27103&view=diff
==============================================================================
--- trunk/src/editor2/editor_common.hpp (original)
+++ trunk/src/editor2/editor_common.hpp Wed Jun 11 17:02:33 2008
@@ -23,7 +23,7 @@
#define LOG_ED LOG_STREAM_INDENT(info, editor)
#define WRN_ED LOG_STREAM_INDENT(warn, editor)
#define ERR_ED LOG_STREAM_INDENT(err, editor)
-#define SCOPE_ED log_scope(__FUNCTION__)
+#define SCOPE_ED log_scope2(editor, __FUNCTION__)
namespace editor2 {
@@ -34,7 +34,6 @@
// forward declarations
-class editor_display;
class editor_map;
class brush;
Modified: trunk/src/editor2/editor_main.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_main.cpp?rev=27103&r1=27102&r2=27103&view=diff
==============================================================================
--- trunk/src/editor2/editor_main.cpp (original)
+++ trunk/src/editor2/editor_main.cpp Wed Jun 11 17:02:33 2008
@@ -13,6 +13,7 @@
*/
#include "editor_main.hpp"
+#include "editor_common.hpp"
#include "../editor/editor.hpp"
@@ -29,22 +30,9 @@
EXIT_STATUS start(config& game_conf, CVideo& video)
{
- preproc_map defines_map;
- // define editor to do conditionnal loading in the main cfg
- defines_map["EDITOR"] = preproc_define();
-
- defines_map["MEDIUM"] = preproc_define();
- defines_map["NORMAL"] = preproc_define();
-
-#if defined(__APPLE__)
- defines_map["APPLE"] = preproc_define();
-#endif
+ SCOPE_ED;
std::string mapdata = map_editor::new_map(22, 22,
t_translation::GRASS_LAND);
- config cfg;
- scoped_istream stream = preprocess_file("data/", &defines_map);
-// read(cfg, *stream);
- cfg = game_conf;
- config* theme_cfg = cfg.find_child("theme", "name", "editor");
+ config* theme_cfg = game_conf.find_child("theme", "name", "editor");
config dummy_theme;
if (!theme_cfg) {
std::cerr << "Editor theme could not be loaded." << std::endl;
@@ -56,9 +44,9 @@
for(;;) {
try {
- editormap map(cfg, mapdata);
- editor_display gui(video, map, *theme_cfg, cfg,
config());
- map_editor::map_editor editor(gui, map, *theme_cfg,
cfg);
+ editormap map(game_conf, mapdata);
+ editor_display gui(video, map, *theme_cfg, game_conf,
config());
+ map_editor::map_editor editor(gui, map, *theme_cfg,
game_conf);
editor.set_file_to_save_as(filename, from_scenario);
editor.main_loop();
break;
Modified: trunk/src/game.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=27103&r1=27102&r2=27103&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Wed Jun 11 17:02:33 2008
@@ -2093,6 +2093,9 @@
} else {
defines_map_["NORMAL"] = preproc_define();
defines_map_["MEDIUM"] = preproc_define();
+#ifdef USE_EDITOR2
+ defines_map_["EDITOR2"] = preproc_define();
+#endif
}
//refresh_game_cfg();
@@ -2197,8 +2200,6 @@
#ifdef USE_EDITOR2
editor2::EXIT_STATUS game_controller::start_editor()
{
- defines_map_["EDITOR"] = preproc_define();
- refresh_game_cfg();
editor2::start(game_config_, video_);
}
#endif
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits