aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-04-25 18:10:15 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:47 +0100
commit1a8b5160d105b50f20cb3cc24443b1f41ac6c1af (patch)
treece1bb575c9e934cd97858c6c5e2793c4427778ee /src/menu
parent647660014b2f506d19c4feedc06a45b514035d5b (diff)
downloadusdx-1a8b5160d105b50f20cb3cc24443b1f41ac6c1af.tar.gz
usdx-1a8b5160d105b50f20cb3cc24443b1f41ac6c1af.tar.xz
usdx-1a8b5160d105b50f20cb3cc24443b1f41ac6c1af.zip
added SDL_Surface* display to all repaint/draw methods
Diffstat (limited to '')
-rw-r--r--src/menu/container.cpp6
-rw-r--r--src/menu/container.hpp6
-rw-r--r--src/menu/drawable.cpp5
-rw-r--r--src/menu/drawable.hpp6
-rw-r--r--src/menu/drawable_control.hpp4
-rw-r--r--src/menu/frame.cpp4
-rw-r--r--src/menu/frame.hpp4
-rw-r--r--src/menu/frame_background.hpp2
-rw-r--r--src/menu/frame_background_color.cpp2
-rw-r--r--src/menu/frame_background_color.hpp4
10 files changed, 26 insertions, 17 deletions
diff --git a/src/menu/container.cpp b/src/menu/container.cpp
index 467e5aa5..edcd5e10 100644
--- a/src/menu/container.cpp
+++ b/src/menu/container.cpp
@@ -43,16 +43,16 @@ namespace usdx
controls.clear();
}
- void Container::repaint(void) const
+ void Container::repaint(SDL_Surface* display) const
{
if (get_visible()) {
- draw();
+ draw(display);
for (std::list<DrawableControl*>::const_iterator it =
controls.begin();
it != controls.end(); it++) {
- (*it)->repaint();
+ (*it)->repaint(display);
}
}
}
diff --git a/src/menu/container.hpp b/src/menu/container.hpp
index 271a4f67..8ba9466c 100644
--- a/src/menu/container.hpp
+++ b/src/menu/container.hpp
@@ -27,9 +27,11 @@
#ifndef CONTAINER_HPP
#define CONTAINER_HPP
-#include "drawable_control.hpp"
+#include <SDL/SDL.h>
#include <list>
+#include "drawable_control.hpp"
+
namespace usdx
{
class Container : public DrawableControl
@@ -44,7 +46,7 @@ namespace usdx
/**
* Method for redraw all contained objects.
*/
- void repaint(void) const;
+ void repaint(SDL_Surface* display) const;
};
};
diff --git a/src/menu/drawable.cpp b/src/menu/drawable.cpp
index 5f744e62..0c68affc 100644
--- a/src/menu/drawable.cpp
+++ b/src/menu/drawable.cpp
@@ -32,17 +32,16 @@ namespace usdx
{
}
- void Drawable::repaint(void) const
+ void Drawable::repaint(SDL_Surface* display) const
{
if (visible) {
- draw();
+ draw(display);
}
};
void Drawable::set_visible(bool value)
{
visible = value;
- draw();
}
const bool Drawable::get_visible(void) const
diff --git a/src/menu/drawable.hpp b/src/menu/drawable.hpp
index e2cc43fc..28cbd223 100644
--- a/src/menu/drawable.hpp
+++ b/src/menu/drawable.hpp
@@ -27,6 +27,8 @@
#ifndef DRAWABLE_HPP
#define DRAWABLE_HPP
+#include <SDL/SDL.h>
+
namespace usdx
{
/**
@@ -41,7 +43,7 @@ namespace usdx
/**
* Pure virtual method, that descendant classes have to implement.
*/
- virtual void draw(void) const = 0;
+ virtual void draw(SDL_Surface* display) const = 0;
public:
Drawable(void);
@@ -50,7 +52,7 @@ namespace usdx
/**
* Method for redraw this Object. If visible issues draw.
*/
- void repaint(void) const;
+ void repaint(SDL_Surface* display) const;
/**
* Setter for visible.
diff --git a/src/menu/drawable_control.hpp b/src/menu/drawable_control.hpp
index 60701f4b..bf7ff42b 100644
--- a/src/menu/drawable_control.hpp
+++ b/src/menu/drawable_control.hpp
@@ -27,6 +27,8 @@
#ifndef DRAWABLE_CONTROL_HPP
#define DRAWABLE_CONTROL_HPP
+#include <SDL/SDL.h>
+
#include "drawable.hpp"
#include "control.hpp"
@@ -39,7 +41,7 @@ namespace usdx
* Pure virtual method, that descendant classes have to
* implement. (Should be left pure virtual.)
*/
- virtual void draw(void) const = 0;
+ virtual void draw(SDL_Surface* display) const = 0;
public:
DrawableControl(Control* parent);
diff --git a/src/menu/frame.cpp b/src/menu/frame.cpp
index 665a2627..228df767 100644
--- a/src/menu/frame.cpp
+++ b/src/menu/frame.cpp
@@ -56,8 +56,8 @@ namespace usdx
return background;
}
- void Frame::draw(void) const
+ void Frame::draw(SDL_Surface* display) const
{
- background->repaint();
+ background->repaint(display);
}
};
diff --git a/src/menu/frame.hpp b/src/menu/frame.hpp
index e71bef9b..b337275c 100644
--- a/src/menu/frame.hpp
+++ b/src/menu/frame.hpp
@@ -27,6 +27,8 @@
#ifndef FRAME_HPP
#define FRAME_HPP
+#include <SDL/SDL.h>
+
#include "container.hpp"
#include "frame_background.hpp"
@@ -38,7 +40,7 @@ namespace usdx
FrameBackground* background;
protected:
- virtual void draw(void) const;
+ virtual void draw(SDL_Surface* display) const;
public:
Frame(Control* parent);
diff --git a/src/menu/frame_background.hpp b/src/menu/frame_background.hpp
index e815094a..a8e7daea 100644
--- a/src/menu/frame_background.hpp
+++ b/src/menu/frame_background.hpp
@@ -51,7 +51,7 @@ namespace usdx
FrameBackground(const FrameBackground&);
FrameBackground& operator=(const FrameBackground&);
- virtual void draw(void) = 0;
+ virtual void draw(SDL_Surface* display) = 0;
};
};
diff --git a/src/menu/frame_background_color.cpp b/src/menu/frame_background_color.cpp
index 3c3adfd8..4f37b184 100644
--- a/src/menu/frame_background_color.cpp
+++ b/src/menu/frame_background_color.cpp
@@ -33,7 +33,7 @@ namespace usdx
{
}
- void FrameBackgroundColor::draw(void) const
+ void FrameBackgroundColor::draw(SDL_Surface* display) const
{
glClearColor(color.get_red(), color.get_green(), color.get_blue(), 0);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
diff --git a/src/menu/frame_background_color.hpp b/src/menu/frame_background_color.hpp
index d1fdcc17..a52e1f13 100644
--- a/src/menu/frame_background_color.hpp
+++ b/src/menu/frame_background_color.hpp
@@ -27,6 +27,8 @@
#ifndef FRAME_BACKGROUND_COLOR_HPP
#define FRAME_BACKGROUND_COLOR_HPP
+#include <SDL/SDL.h>
+
#include "frame_background.hpp"
#include "utils/rgb_color.hpp"
@@ -38,7 +40,7 @@ namespace usdx
RgbColor color;
protected:
- virtual void draw(void) const;
+ virtual void draw(SDL_Surface* display) const;
public:
FrameBackgroundColor(RgbColor &color);