aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/menu/application.cpp18
-rw-r--r--src/menu/application.hpp5
2 files changed, 23 insertions, 0 deletions
diff --git a/src/menu/application.cpp b/src/menu/application.cpp
index 670e4c77..cc690b1c 100644
--- a/src/menu/application.cpp
+++ b/src/menu/application.cpp
@@ -45,6 +45,13 @@ namespace usdx
Application::~Application()
{
+ for (std::list<DrawableControl*>::iterator it =
+ overlays.begin(); it != overlays.end(); it++) {
+ delete *it;
+ }
+
+ overlays.clear();
+
if (fps_manager) {
delete fps_manager;
fps_manager = NULL;
@@ -72,6 +79,17 @@ namespace usdx
}
}
+ void Application::repaint(SDL_Surface* display) const {
+ DrawableControl::repaint(display);
+
+ for (std::list<DrawableControl*>::const_iterator it =
+ overlays.begin();
+ it != overlays.end(); it++) {
+
+ (*it)->repaint(display);
+ }
+ }
+
const Frame *Application::get_current_frame(void) const
{
return frame;
diff --git a/src/menu/application.hpp b/src/menu/application.hpp
index 99036d51..24d0b44f 100644
--- a/src/menu/application.hpp
+++ b/src/menu/application.hpp
@@ -30,6 +30,7 @@
#include <SDL/SDL.h>
#include <SDL/SDL_framerate.h>
#include <log4cxx/logger.h>
+#include <list>
#include "drawable_control.hpp"
#include "frame.hpp"
@@ -53,6 +54,8 @@ namespace usdx
int frames_per_second;
+ std::list<DrawableControl*> overlays;
+
/**
* This is the main loop.
*/
@@ -80,6 +83,8 @@ namespace usdx
const int get_frames_per_second(void) const;
void set_frames_per_second(int fps);
+
+ void repaint(SDL_Surface* display) const;
};
};