summaryrefslogtreecommitdiff
path: root/src/gui/listbox.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/listbox.cpp
parent4d338e801f8b1175585de6b5e7b8b2ca331b682f (diff)
downloadmana-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.gz
mana-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.bz2
mana-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.xz
mana-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/listbox.cpp')
-rw-r--r--src/gui/listbox.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index fee67cbd..0dd9203c 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -48,16 +48,8 @@ void ListBox::draw(gcn::Graphics *graphics)
// Draw rectangle below the selected list element
if (mSelected >= 0) {
- if (useOpenGL) {
-#ifdef USE_OPENGL
- dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(
- gcn::Rectangle(0, fontHeight * mSelected, getWidth(), fontHeight));
-#endif
- }
- else {
- dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(
- gcn::Rectangle(0, fontHeight * mSelected, getWidth(), fontHeight));
- }
+ graphics->fillRectangle(
+ gcn::Rectangle(0, fontHeight * mSelected, getWidth(), fontHeight));
}
// Draw the list elements