summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/engine.cpp4
-rw-r--r--src/gui/gui.cpp9
-rw-r--r--src/gui/gui.h1
4 files changed, 9 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 8001ef37..80ef04a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2005-08-15 Björn Steinbrink <B.Steinbrink@gmx.de>
+ * src/engine.cpp, src/gui/gui.cpp, src/gui/gui.h: Removed guiTop global
+ variable.
* src/graphics.cpp, src/graphics.h, src/main.cpp: Made the OpenGL related
code fully #ifdef'ed.
* src/main.cpp, src/gui/browserbox.cpp, src/gui/gui.cpp,
diff --git a/src/engine.cpp b/src/engine.cpp
index a79319f1..4c91a688 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -177,7 +177,9 @@ Engine::Engine():
{
// Initializes GUI
debugInfo = new gcn::Label();
- guiTop->add(debugInfo);
+ // Oh, come on guichan folks, how useful is it to have a single widget gui?
+ // (Well, the BasicContainer interface isn't that much more useful... ;)
+ dynamic_cast<WindowContainer*>(gui->getTop())->add(debugInfo);
// Create dialogs
chatWindow = new ChatWindow(
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 197177cd..5f37e566 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -56,7 +56,6 @@ extern Being* autoTarget;
// Guichan stuff
Gui *gui;
gcn::SDLInput *guiInput; // GUI input
-WindowContainer *guiTop; // The top container
// Fonts used in showing hits
gcn::ImageFont *hitRedFont;
@@ -99,7 +98,7 @@ Gui::Gui(Graphics *graphics):
mFocusHandler = new FocusHandler();
// Initialize top GUI widget
- guiTop = new WindowContainer();
+ WindowContainer *guiTop = new WindowContainer();
guiTop->setDimension(gcn::Rectangle(0, 0,
graphics->getWidth(), graphics->getHeight()));
guiTop->setOpaque(false);
@@ -171,7 +170,7 @@ Gui::~Gui()
}
delete mGuiFont;
- delete guiTop;
+ delete mTop;
delete mImageLoader;
if (mHostImageLoader) {
@@ -192,8 +191,8 @@ void Gui::logic()
void Gui::draw()
{
- mGraphics->pushClipArea(guiTop->getDimension());
- guiTop->draw(mGraphics);
+ mGraphics->pushClipArea(mTop->getDimension());
+ mTop->draw(mGraphics);
int mouseX, mouseY;
Uint8 button = SDL_GetMouseState(&mouseX, &mouseY);
diff --git a/src/gui/gui.h b/src/gui/gui.h
index a8e602ff..80a4ee7d 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -105,7 +105,6 @@ class Gui : public gcn::Gui, public gcn::MouseListener, ConfigListener
};
extern Gui *gui; /**< The GUI system */
-extern WindowContainer *guiTop; /**< The top container */
extern gcn::SDLInput *guiInput; /**< GUI input */
/**