From d15d76976b6e57a9f421ab034c6f841051b962f3 Mon Sep 17 00:00:00 2001
From: Bjørn Lindeijer <bjorn@lindeijer.nl>
Date: Wed, 27 Jul 2005 21:55:20 +0000
Subject: Committing merging opengl and sdl part 3 by Andrej

---
 src/gui/browserbox.cpp  |  4 ++++
 src/gui/gui.cpp         |  6 ++++++
 src/gui/listbox.cpp     |  2 ++
 src/gui/minimap.cpp     |  2 ++
 src/gui/progressbar.cpp |  2 ++
 src/gui/scrollarea.cpp  | 16 ++++++++++++++++
 6 files changed, 32 insertions(+)

(limited to 'src/gui')

diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp
index 56539455..58877b6e 100644
--- a/src/gui/browserbox.cpp
+++ b/src/gui/browserbox.cpp
@@ -210,7 +210,9 @@ void BrowserBox::draw(gcn::Graphics* graphics)
     {
         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()));
@@ -223,6 +225,7 @@ void BrowserBox::draw(gcn::Graphics* graphics)
         {
             graphics->setColor(gcn::Color(HIGHLIGHT));
             if (useOpenGL) {
+#ifdef USE_OPENGL
                 dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(
                         gcn::Rectangle(
                             mLinks[mSelectedLink].x1,
@@ -230,6 +233,7 @@ void BrowserBox::draw(gcn::Graphics* graphics)
                             mLinks[mSelectedLink].x2 - mLinks[mSelectedLink].x1,
                             mLinks[mSelectedLink].y2 - mLinks[mSelectedLink].y1
                             ));
+#endif
             }
             else {
                 dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 1e101c5b..737b880c 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -56,7 +56,9 @@ Gui::Gui(Graphics *graphics):
     guiGraphics = graphics;
     //setGraphics(graphics);
     if (useOpenGL) {
+#ifdef USE_OPENGL
         setGraphics((gcn::OpenGLGraphics*)graphics);
+#endif
     }
     else {
         setGraphics((gcn::SDLGraphics*)graphics);
@@ -212,8 +214,10 @@ 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());
@@ -230,7 +234,9 @@ void Gui::draw()
     }
 
     if (useOpenGL) {
+#ifdef USE_OPENGL
         dynamic_cast<gcn::OpenGLGraphics*>(guiGraphics)->popClipArea();
+#endif
     }
     else {
         dynamic_cast<gcn::SDLGraphics*>(guiGraphics)->popClipArea();
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index bf80589a..3f82fe1b 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -52,8 +52,10 @@ void ListBox::draw(gcn::Graphics *graphics)
     {
         if (i == mSelected) {
             if (useOpenGL) {
+#ifdef USE_OPENGL
                 dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(
                     gcn::Rectangle(0, y, getWidth(), fontHeight));
+#endif
             }
             else {
                 dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index 59447fd7..c6069821 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -89,9 +89,11 @@ void Minimap::draw(gcn::Graphics *graphics)
             // Player dot
             graphics->setColor(gcn::Color(209, 52, 61));
             if (useOpenGL) {
+#ifdef USE_OPENGL
                 dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(gcn::Rectangle(
                         being->x / 2 + getPadding() - 1,
                         being->y / 2 + getTitleBarHeight() - 1, 3, 3));
+#endif
             }
             else {
                 dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(gcn::Rectangle(
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index a1083db3..fb03d90b 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -105,8 +105,10 @@ void ProgressBar::draw(gcn::Graphics *graphics)
     {
         graphics->setColor(gcn::Color(red, green, blue, 200));
         if (useOpenGL) {
+#ifdef USE_OPENGL
             dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(gcn::Rectangle(4, 4,
                     (int)(progress * (getWidth() - 8)), getHeight() - 8));
+#endif
         }
         else {
             dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(gcn::Rectangle(4, 4,
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index c8524657..3350a252 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -180,10 +180,12 @@ void ScrollArea::draw(gcn::Graphics *graphics)
     {
         graphics->setColor(getBaseColor());
         if (useOpenGL) {
+#ifdef USE_OPENGL
             dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(gcn::Rectangle(getWidth() - mScrollbarWidth,
                     getHeight() - mScrollbarWidth,
                     mScrollbarWidth,
                     mScrollbarWidth));
+#endif
         }
         else {
             dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(gcn::Rectangle(getWidth() - mScrollbarWidth,
@@ -197,7 +199,9 @@ void ScrollArea::draw(gcn::Graphics *graphics)
     {
         gcn::Rectangle contdim = mContent->getDimension();
         if (useOpenGL) {
+#ifdef USE_OPENGL
             dynamic_cast<gcn::OpenGLGraphics*>(graphics)->pushClipArea(getContentDimension());
+#endif
         }
         else {
             dynamic_cast<gcn::SDLGraphics*>(graphics)->pushClipArea(getContentDimension());
@@ -211,14 +215,18 @@ void ScrollArea::draw(gcn::Graphics *graphics)
             rec.width += 2 * mContent->getBorderSize();
             rec.height += 2 * mContent->getBorderSize();
             if (useOpenGL) {
+#ifdef USE_OPENGL
                 dynamic_cast<gcn::OpenGLGraphics*>(graphics)->pushClipArea(rec);
+#endif
             }
             else {
                 dynamic_cast<gcn::SDLGraphics*>(graphics)->pushClipArea(rec);
             }
             mContent->drawBorder(graphics);
             if (useOpenGL) {
+#ifdef USE_OPENGL
                 dynamic_cast<gcn::OpenGLGraphics*>(graphics)->popClipArea();
+#endif
             }
             else {
                 dynamic_cast<gcn::SDLGraphics*>(graphics)->popClipArea();
@@ -226,15 +234,19 @@ void ScrollArea::draw(gcn::Graphics *graphics)
         }
 
         if (useOpenGL) {
+#ifdef USE_OPENGL
             dynamic_cast<gcn::OpenGLGraphics*>(graphics)->pushClipArea(contdim);
+#endif
         }
         else {
             dynamic_cast<gcn::SDLGraphics*>(graphics)->pushClipArea(contdim);
         }
         mContent->draw(graphics);
         if (useOpenGL) {
+#ifdef USE_OPENGL
             dynamic_cast<gcn::OpenGLGraphics*>(graphics)->popClipArea();
             dynamic_cast<gcn::OpenGLGraphics*>(graphics)->popClipArea();
+#endif
         }
         else {
             dynamic_cast<gcn::SDLGraphics*>(graphics)->popClipArea();
@@ -330,7 +342,9 @@ void ScrollArea::drawVBar(gcn::Graphics *graphics)
     gcn::Rectangle dim = getVerticalBarDimension();
     graphics->setColor(gcn::Color(0, 0, 0, 32));
     if (useOpenGL) {
+#ifdef USE_OPENGL
         dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(dim);
+#endif
     }
     else {
         dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(dim);
@@ -343,7 +357,9 @@ void ScrollArea::drawHBar(gcn::Graphics *graphics)
     gcn::Rectangle dim = getHorizontalBarDimension();
     graphics->setColor(gcn::Color(0, 0, 0, 32));
     if (useOpenGL) {
+#ifdef USE_OPENGL
         dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(dim);
+#endif
     }
     else {
         dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(dim);
-- 
cgit v1.2.3-70-g09d2