summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-11-21 06:24:50 +0000
committerIra Rice <irarice@gmail.com>2008-11-21 06:24:50 +0000
commitf5c0ed3ec4216219494121721a4cce0c7ec4fb34 (patch)
tree3ffc912b8225d620af521b3b0537ae9a1a1ca1bc
parentbe621542a7330c43c6d586286c4ef7411f83b6ea (diff)
downloadmana-f5c0ed3ec4216219494121721a4cce0c7ec4fb34.tar.gz
mana-f5c0ed3ec4216219494121721a4cce0c7ec4fb34.tar.bz2
mana-f5c0ed3ec4216219494121721a4cce0c7ec4fb34.tar.xz
mana-f5c0ed3ec4216219494121721a4cce0c7ec4fb34.zip
Changed windowing code to allow for multiple skins. This will be
modified in a bit so that there are no redundant skin loads, but for now, it doesn't leak any more as well.
-rw-r--r--src/gui/speechbubble.cpp4
-rw-r--r--src/gui/window.cpp21
-rw-r--r--src/gui/window.h5
3 files changed, 15 insertions, 15 deletions
diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp
index 2ab80bd9..6af16496 100644
--- a/src/gui/speechbubble.cpp
+++ b/src/gui/speechbubble.cpp
@@ -29,8 +29,8 @@
// TODO: Fix windows so that they can each load their own skins without the
// other windows overriding another window's skin.
-SpeechBubble::SpeechBubble()//:
-// Window("Message", false, NULL, "graphics/gui/speechbubble.xml")
+SpeechBubble::SpeechBubble():
+ Window("Message", false, NULL, "graphics/gui/speechbubble.xml")
{
mSpeechBox = new TextBox();
mSpeechBox->setEditable(false);
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 4ace032b..48964121 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -48,7 +48,7 @@ ConfigListener *Window::windowConfigListener = 0;
WindowContainer *Window::windowContainer = 0;
int Window::instances = 0;
int Window::mouseResize = 0;
-ImageRect Window::border;
+//ImageRect Window::border;
Image *Window::closeImage = NULL;
bool Window::mAlphaChanged = false;
@@ -57,9 +57,9 @@ class WindowConfigListener : public ConfigListener
void optionChanged(const std::string &)
{
Window::mAlphaChanged = true;
- for_each(Window::border.grid, Window::border.grid + 9,
- std::bind2nd(std::mem_fun(&Image::setAlpha),
- config.getValue("guialpha", 0.8)));
+// for_each(Window::border.grid, Window::border.grid + 9,
+// std::bind2nd(std::mem_fun(&Image::setAlpha),
+// config.getValue("guialpha", 0.8)));
}
};
@@ -142,18 +142,19 @@ Window::~Window()
instances--;
+ // Clean up static resources
+ for( int i = 0; i < 9; i++ )
+ {
+ delete border.grid[i];
+ border.grid[i] = NULL;
+ }
+
if (instances == 0)
{
config.removeListener("guialpha", windowConfigListener);
delete windowConfigListener;
windowConfigListener = NULL;
- // Clean up static resources
- for( int i = 0; i < 9; i++ )
- {
- delete border.grid[i];
- border.grid[i] = NULL;
- }
closeImage->decRef();
}
diff --git a/src/gui/window.h b/src/gui/window.h
index 3bb41a95..9380fc88 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -26,12 +26,11 @@
#include <guichan/widgets/window.hpp>
+#include "../graphics.h"
#include "../guichanfwd.h"
class ConfigListener;
class GCContainer;
-class Image;
-class ImageRect;
class ResizeGrip;
class WindowContainer;
@@ -291,7 +290,7 @@ class Window : public gcn::Window, gcn::WidgetListener
static int mouseResize; /**< Active resize handles */
static int instances; /**< Number of Window instances */
- static ImageRect border; /**< The window border and background */
+ ImageRect border; /**< The window border and background */
static Image *closeImage; /**< Close Button Image */
/**