summaryrefslogtreecommitdiff
path: root/src/gui/browserbox.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/browserbox.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/browserbox.cpp')
-rw-r--r--src/gui/browserbox.cpp35
1 files changed, 7 insertions, 28 deletions
diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp
index 52a13763..504fb987 100644
--- a/src/gui/browserbox.cpp
+++ b/src/gui/browserbox.cpp
@@ -211,14 +211,7 @@ void BrowserBox::draw(gcn::Graphics* graphics)
if (mOpaque)
{
graphics->setColor(gcn::Color(BGCOLOR));
- if (useOpenGL) {
-#ifdef USE_OPENGL
- dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
-#endif
- }
- else {
- dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
- }
+ graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
}
if (mSelectedLink >= 0)
@@ -226,26 +219,12 @@ void BrowserBox::draw(gcn::Graphics* graphics)
if ((mHighMode == BACKGROUND) || (mHighMode == BOTH))
{
graphics->setColor(gcn::Color(HIGHLIGHT));
- if (useOpenGL) {
-#ifdef USE_OPENGL
- dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(
- gcn::Rectangle(
- mLinks[mSelectedLink].x1,
- mLinks[mSelectedLink].y1,
- mLinks[mSelectedLink].x2 - mLinks[mSelectedLink].x1,
- mLinks[mSelectedLink].y2 - mLinks[mSelectedLink].y1
- ));
-#endif
- }
- else {
- dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(
- gcn::Rectangle(
- mLinks[mSelectedLink].x1,
- mLinks[mSelectedLink].y1,
- mLinks[mSelectedLink].x2 - mLinks[mSelectedLink].x1,
- mLinks[mSelectedLink].y2 - mLinks[mSelectedLink].y1
- ));
- }
+ graphics->fillRectangle(gcn::Rectangle(
+ mLinks[mSelectedLink].x1,
+ mLinks[mSelectedLink].y1,
+ mLinks[mSelectedLink].x2 - mLinks[mSelectedLink].x1,
+ mLinks[mSelectedLink].y2 - mLinks[mSelectedLink].y1
+ ));
}
if ((mHighMode == UNDERLINE) || (mHighMode == BOTH))