Skip to content

Commit

Permalink
Added MenuManager::draw()
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Aug 8, 2014
1 parent a5e3e67 commit a210c57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/gui/menu_manager.cpp
Expand Up @@ -46,6 +46,15 @@ MenuManager::~MenuManager()
s_instance = nullptr;
}

void
MenuManager::draw(DrawingContext& context)
{
if (m_current)
{
m_current->draw(context);
}
}

void
MenuManager::push_current(Menu* menu)
{
Expand Down
3 changes: 3 additions & 0 deletions src/gui/menu_manager.hpp
Expand Up @@ -21,6 +21,7 @@
#include <list>

class Menu;
class DrawingContext;

class MenuManager
{
Expand All @@ -44,6 +45,8 @@ class MenuManager
MenuManager();
~MenuManager();

void draw(DrawingContext& context);

/** Set the current menu, if pmenu is NULL, hide the current menu */
void set_current(Menu* pmenu);

Expand Down
3 changes: 1 addition & 2 deletions src/supertux/screen_manager.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit a210c57

Please sign in to comment.