From: Ingo Ruhnke Date: Fri, 8 Aug 2014 18:18:31 +0000 (+0200) Subject: Added MenuManager::draw() X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a210c57e38878b67d680ccc0712b0461c9759d44;p=supertux.git Added MenuManager::draw() --- diff --git a/src/gui/menu_manager.cpp b/src/gui/menu_manager.cpp index fa0ae00af..dd07255e5 100644 --- a/src/gui/menu_manager.cpp +++ b/src/gui/menu_manager.cpp @@ -47,6 +47,15 @@ MenuManager::~MenuManager() } void +MenuManager::draw(DrawingContext& context) +{ + if (m_current) + { + m_current->draw(context); + } +} + +void MenuManager::push_current(Menu* menu) { m_previous = m_current; diff --git a/src/gui/menu_manager.hpp b/src/gui/menu_manager.hpp index d601ae211..85a88cabf 100644 --- a/src/gui/menu_manager.hpp +++ b/src/gui/menu_manager.hpp @@ -21,6 +21,7 @@ #include class Menu; +class DrawingContext; class MenuManager { @@ -44,6 +45,8 @@ public: MenuManager(); ~MenuManager(); + void draw(DrawingContext& context); + /** Set the current menu, if pmenu is NULL, hide the current menu */ void set_current(Menu* pmenu); diff --git a/src/supertux/screen_manager.cpp b/src/supertux/screen_manager.cpp index 4b7661b12..a19f914fd 100644 --- a/src/supertux/screen_manager.cpp +++ b/src/supertux/screen_manager.cpp @@ -139,8 +139,7 @@ ScreenManager::draw(DrawingContext& context) static int frame_count = 0; current_screen->draw(context); - if(m_menu_manager->current() != NULL) - m_menu_manager->current()->draw(context); + m_menu_manager->draw(context); if(screen_fade.get() != NULL) screen_fade->draw(context); Console::instance->draw(context);