summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-10 07:46:41 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-10 07:46:41 +0000
commit7bbe721a23b9caba7a67ac806be10aa536f7f46d (patch)
treed87383830d132ca08b472abed69b20f3f3eee58a /src/gui/gui.cpp
parent4d338e801f8b1175585de6b5e7b8b2ca331b682f (diff)
downloadmana-client-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.gz
mana-client-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.bz2
mana-client-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.xz
mana-client-7bbe721a23b9caba7a67ac806be10aa536f7f46d.zip
Moved knowledge about whether we use OpenGL into the Graphics class. Added helper function for being creation to reduce code duplication. Some code simplifications.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 033ed3df..bd6a9ba4 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -181,16 +181,8 @@ void Gui::logic()
void Gui::draw()
{
- if (useOpenGL) {
-#ifdef USE_OPENGL
- dynamic_cast<gcn::OpenGLGraphics*>(guiGraphics)->pushClipArea(guiTop->getDimension());
- guiTop->draw((gcn::OpenGLGraphics*)guiGraphics);
-#endif
- }
- else {
- dynamic_cast<gcn::SDLGraphics*>(guiGraphics)->pushClipArea(guiTop->getDimension());
- guiTop->draw((gcn::SDLGraphics*)guiGraphics);
- }
+ guiGraphics->pushClipArea(guiTop->getDimension());
+ guiTop->draw(mGraphics);
int mouseX, mouseY;
Uint8 button = SDL_GetMouseState(&mouseX, &mouseY);
@@ -201,14 +193,7 @@ void Gui::draw()
guiGraphics->drawImage(mMouseCursor, mouseX - 5, mouseY - 2);
}
- if (useOpenGL) {
-#ifdef USE_OPENGL
- dynamic_cast<gcn::OpenGLGraphics*>(guiGraphics)->popClipArea();
-#endif
- }
- else {
- dynamic_cast<gcn::SDLGraphics*>(guiGraphics)->popClipArea();
- }
+ guiGraphics->popClipArea();
}
void Gui::mousePress(int mx, int my, int button)