diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-08-24 09:14:27 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-08-24 09:14:27 +0000 |
commit | 78e280de977329aec2b9ad5926882dc9af4d152d (patch) | |
tree | 44f3dbc5115982a15171dfe8a12884bbcb043bfd /src/gui/gui.cpp | |
parent | b0969b283f6c8bb0701f74e61f8086963f44ff93 (diff) | |
download | mana-78e280de977329aec2b9ad5926882dc9af4d152d.tar.gz mana-78e280de977329aec2b9ad5926882dc9af4d152d.tar.bz2 mana-78e280de977329aec2b9ad5926882dc9af4d152d.tar.xz mana-78e280de977329aec2b9ad5926882dc9af4d152d.zip |
Removed useless logic method and reverted mouse cursor to non-static since
there can be only one Gui instance so there is no point in supporting a shared
resource.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index bcb4ac0a..84680da8 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -59,7 +59,6 @@ gcn::Font *hitBlueFont; gcn::Font *hitYellowFont; // Font used to display speech and player names gcn::Font *speechFont; -ImageSet *Gui::mMouseCursor = NULL; class GuiConfigListener : public ConfigListener { @@ -81,7 +80,9 @@ class GuiConfigListener : public ConfigListener Gui::Gui(Graphics *graphics): mHostImageLoader(NULL), - mCustomCursor(false) + mCustomCursor(false), + mMouseCursors(NULL), + mCursorType(CURSOR_POINTER) { logger->log("Initializing GUI..."); // Set graphics @@ -178,10 +179,10 @@ Gui::~Gui() delete hitBlueFont; delete hitYellowFont; - if (mMouseCursor) { - mMouseCursor->decRef(); - mMouseCursor = NULL; + if (mMouseCursors) { + mMouseCursors->decRef(); } + delete mGuiFont; delete speechFont; delete viewport; @@ -193,12 +194,6 @@ Gui::~Gui() } void -Gui::logic() -{ - gcn::Gui::logic(); -} - -void Gui::draw() { mGraphics->pushClipArea(mTop->getDimension()); @@ -211,7 +206,7 @@ Gui::draw() mCustomCursor) { static_cast<Graphics*>(mGraphics)->drawImage( - mMouseCursor->get(mCursorType), + mMouseCursors->get(mCursorType), mouseX - 15, mouseY - 17); } @@ -233,13 +228,12 @@ Gui::setUseCustomCursor(bool customCursor) // Load the mouse cursor ResourceManager *resman = ResourceManager::getInstance(); - mMouseCursor = + mMouseCursors = resman->getImageSet("graphics/gui/mouse.png", 40, 40); - if (!mMouseCursor) { + if (!mMouseCursors) { logger->error("Unable to load mouse cursors."); } - mCursorType = CURSOR_POINTER; } else { @@ -247,9 +241,9 @@ Gui::setUseCustomCursor(bool customCursor) SDL_ShowCursor(SDL_ENABLE); // Unload the mouse cursor - if (mMouseCursor) { - mMouseCursor->decRef(); - mMouseCursor = NULL; + if (mMouseCursors) { + mMouseCursors->decRef(); + mMouseCursors = NULL; } } } |