Make fullscreen switching work in editor2,

...among other stuff, by using preferences::display_manager
This commit is contained in:
Tomasz Śniatowski 2008-07-15 17:30:09 +01:00
parent badfdd7053
commit e2d1b3790a
2 changed files with 4 additions and 1 deletions

View file

@ -72,6 +72,7 @@ void editor_controller::init(CVideo& video)
theme_cfg = theme_cfg ? theme_cfg : &dummy;
gui_ = new editor_display(video, map_, *theme_cfg, game_config_, config());
gui_->set_grid(preferences::grid());
prefs_disp_manager_ = new preferences::display_manager(gui_);
}
editor_controller::~editor_controller()
@ -83,6 +84,7 @@ editor_controller::~editor_controller()
foreach (apr a, mouse_actions_) {
delete a.second;
}
delete prefs_disp_manager_;
}
void editor_controller::main_loop()
@ -221,7 +223,6 @@ bool editor_controller::execute_command(hotkey::HOTKEY_COMMAND command, int inde
void editor_controller::toggle_grid()
{
preferences::set_grid(!preferences::grid());
gui_->set_grid(preferences::grid());
gui_->invalidate_all();
}

View file

@ -125,6 +125,8 @@ class editor_controller : public controller_base,
/** The display object used and owned by the editor. Possibly recreated when a new map is created */
editor_display* gui_;
preferences::display_manager* prefs_disp_manager_;
/**
* The undo stack. A double-ended queues due to the need to add items to one end,
* and remove from both when performing the undo or when trimming the size. This container owns