aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/menu/application.cpp23
-rw-r--r--src/menu/application.hpp7
2 files changed, 5 insertions, 25 deletions
diff --git a/src/menu/application.cpp b/src/menu/application.cpp
index 9e790b15..80fded75 100644
--- a/src/menu/application.cpp
+++ b/src/menu/application.cpp
@@ -40,7 +40,7 @@ namespace usdx
Application* Application::instance = NULL;
Application::Application(Container* parent)
- : DrawableControl(parent), display(NULL), frame(NULL),
+ : Container(parent), display(NULL), frame(NULL),
fps_manager(NULL), running(false), display_width(800),
display_height(600), frames_per_second(50)
{
@@ -50,13 +50,6 @@ 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;
@@ -82,17 +75,8 @@ namespace usdx
if (frame) {
frame->repaint();
}
- }
- void Application::repaint(void) {
- DrawableControl::repaint();
-
- for (std::list<DrawableControl*>::const_iterator it =
- overlays.begin();
- it != overlays.end(); it++) {
-
- (*it)->repaint();
- }
+ Container::draw();
}
const Frame *Application::get_current_frame(void) const
@@ -110,7 +94,8 @@ namespace usdx
SDL_Event event;
EventManager event_manager;
boost::thread event_thread(boost::bind(&EventManager::handle_events, &event_manager));
- overlays.push_front(new SoftwareMousePointer(NULL, &event_manager));
+ DrawableControl *p = new SoftwareMousePointer(this, &event_manager);
+ p->repaint();
LoadingFrame frame;
set_current_frame(&frame);
diff --git a/src/menu/application.hpp b/src/menu/application.hpp
index 76b451f0..efd99533 100644
--- a/src/menu/application.hpp
+++ b/src/menu/application.hpp
@@ -32,13 +32,12 @@
#include <log4cpp/Category.hh>
#include <list>
-#include "drawable_control.hpp"
#include "container.hpp"
#include "frame.hpp"
namespace usdx
{
- class Application : public DrawableControl
+ class Application : public Container
{
private:
static log4cpp::Category& log;
@@ -55,8 +54,6 @@ namespace usdx
int frames_per_second;
- std::list<DrawableControl*> overlays;
-
/**
* This is the main loop.
*/
@@ -84,8 +81,6 @@ namespace usdx
const int get_frames_per_second(void) const;
void set_frames_per_second(int fps);
-
- void repaint(void);
};
};