From: Ingo Ruhnke Date: Sun, 10 Aug 2014 00:12:20 +0000 (+0200) Subject: Renamed MenuManager::recalc_pos() -> MenuManager::on_window_resize() and Menu::update... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d1c49badcac1453e6fb40f531a929d5827ed569a;p=supertux.git Renamed MenuManager::recalc_pos() -> MenuManager::on_window_resize() and Menu::update() -> Menu::process_input() --- diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp index f8dca8f4d..f2c55a407 100644 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -174,7 +174,7 @@ Menu::clear() /* Process actions done on the menu */ void -Menu::update() +Menu::process_input() { int menu_height = (int) get_height(); if (menu_height > SCREEN_HEIGHT) @@ -321,7 +321,7 @@ Menu::update() case MN_TEXTFIELD: case MN_NUMFIELD: menuaction = MENU_ACTION_DOWN; - update(); + process_input(); break; case MN_BACK: diff --git a/src/gui/menu.hpp b/src/gui/menu.hpp index d5feba29d..f61994428 100644 --- a/src/gui/menu.hpp +++ b/src/gui/menu.hpp @@ -69,7 +69,7 @@ public: virtual void menu_action(MenuItem* item); - void update(); + void process_input(); /** Perform actions to bring the menu up to date with configuration changes */ virtual void refresh() {} diff --git a/src/gui/menu_manager.cpp b/src/gui/menu_manager.cpp index 48cbebccb..575c0f512 100644 --- a/src/gui/menu_manager.cpp +++ b/src/gui/menu_manager.cpp @@ -150,11 +150,11 @@ MenuManager::refresh() } void -MenuManager::update() +MenuManager::process_input() { if (current()) { - current()->update(); + current()->process_input(); } } @@ -274,7 +274,7 @@ MenuManager::clear_menu_stack() } void -MenuManager::recalc_pos() +MenuManager::on_window_resize() { for(auto i = m_menu_stack.begin(); i != m_menu_stack.end(); ++i) { diff --git a/src/gui/menu_manager.hpp b/src/gui/menu_manager.hpp index 6b2d39c60..9b8fe3800 100644 --- a/src/gui/menu_manager.hpp +++ b/src/gui/menu_manager.hpp @@ -45,7 +45,7 @@ public: ~MenuManager(); void event(const SDL_Event& event); - void update(); + void process_input(); void refresh(); void draw(DrawingContext& context); @@ -58,7 +58,7 @@ public: void pop_menu(); void clear_menu_stack(); - void recalc_pos(); + void on_window_resize(); bool is_active() const { return !m_menu_stack.empty(); diff --git a/src/supertux/menu/options_menu.cpp b/src/supertux/menu/options_menu.cpp index 79a2278f4..538233e4d 100644 --- a/src/supertux/menu/options_menu.cpp +++ b/src/supertux/menu/options_menu.cpp @@ -215,13 +215,13 @@ OptionsMenu::menu_action(MenuItem* item) { g_config->aspect_size = Size(0, 0); // Magic values Renderer::instance()->apply_config(); - MenuManager::instance().recalc_pos(); + MenuManager::instance().on_window_resize(); } else if (sscanf(item->list[item->selected].c_str(), "%d:%d", &g_config->aspect_size.width, &g_config->aspect_size.height) == 2) { Renderer::instance()->apply_config(); - MenuManager::instance().recalc_pos(); + MenuManager::instance().on_window_resize(); } else { @@ -240,7 +240,7 @@ OptionsMenu::menu_action(MenuItem* item) g_config->magnification /= 100.0f; } Renderer::instance()->apply_config(); - MenuManager::instance().recalc_pos(); + MenuManager::instance().on_window_resize(); break; case MNID_FULLSCREEN_RESOLUTION: @@ -269,7 +269,7 @@ OptionsMenu::menu_action(MenuItem* item) if(g_config->use_fullscreen != is_toggled(MNID_FULLSCREEN)) { g_config->use_fullscreen = !g_config->use_fullscreen; Renderer::instance()->apply_config(); - MenuManager::instance().recalc_pos(); + MenuManager::instance().on_window_resize(); g_config->save(); } break; diff --git a/src/supertux/screen_manager.cpp b/src/supertux/screen_manager.cpp index 17e2ba268..a326d9b94 100644 --- a/src/supertux/screen_manager.cpp +++ b/src/supertux/screen_manager.cpp @@ -174,7 +174,7 @@ ScreenManager::update_gamelogic(float elapsed_time) scripting::update_debugger(); scripting::TimeScheduler::instance->update(game_time); current_screen->update(elapsed_time); - m_menu_manager->update(); + m_menu_manager->process_input(); if(screen_fade.get() != NULL) screen_fade->update(elapsed_time); Console::instance->update(elapsed_time); @@ -203,7 +203,7 @@ ScreenManager::process_events() case SDL_WINDOWEVENT_RESIZED: Renderer::instance()->resize(event.window.data1, event.window.data2); - m_menu_manager->recalc_pos(); + m_menu_manager->on_window_resize(); break; } break; @@ -217,7 +217,7 @@ ScreenManager::process_events() { g_config->use_fullscreen = !g_config->use_fullscreen; Renderer::instance()->apply_config(); - m_menu_manager->recalc_pos(); + m_menu_manager->on_window_resize(); } else if (event.key.keysym.sym == SDLK_PRINTSCREEN || event.key.keysym.sym == SDLK_F12)