Renamed MenuManager::recalc_pos() -> MenuManager::on_window_resize() and Menu::update...
authorIngo Ruhnke <grumbel@gmail.com>
Sun, 10 Aug 2014 00:12:20 +0000 (02:12 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Sun, 10 Aug 2014 00:12:20 +0000 (02:12 +0200)
src/gui/menu.cpp
src/gui/menu.hpp
src/gui/menu_manager.cpp
src/gui/menu_manager.hpp
src/supertux/menu/options_menu.cpp
src/supertux/screen_manager.cpp

index f8dca8f..f2c55a4 100644 (file)
@@ -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:
index d5feba2..f619944 100644 (file)
@@ -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() {}
index 48cbebc..575c0f5 100644 (file)
@@ -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)
   {
index 6b2d39c..9b8fe38 100644 (file)
@@ -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();
index 79a2278..538233e 100644 (file)
@@ -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;
index 17e2ba2..a326d9b 100644 (file)
@@ -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)