summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-25 16:56:52 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-25 16:56:52 +0000
commit14c82e5b5d5547bcf9c3b06c68cf20a100600d0b (patch)
treea46770e8dc29a541eff9480c0e5c132336666b48 /src/gui/gui.cpp
parent06ea0c8cf1986460d3c74cddd02a714fb6c26bca (diff)
downloadmana-14c82e5b5d5547bcf9c3b06c68cf20a100600d0b.tar.gz
mana-14c82e5b5d5547bcf9c3b06c68cf20a100600d0b.tar.bz2
mana-14c82e5b5d5547bcf9c3b06c68cf20a100600d0b.tar.xz
mana-14c82e5b5d5547bcf9c3b06c68cf20a100600d0b.zip
Removed dependency on Guichan's OpenGL library. Taken over image loading and handling. Reduced memory usage when using OpenGL. (Up to 95% reduction for some textures.)
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 8f1cc7f4..620dfb0b 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -30,10 +30,6 @@
// Should stay here because of Guichan being sensitive to headers order
#include <guichan/sdl/sdlinput.hpp>
-#ifdef USE_OPENGL
-#include "../resources/openglsdlimageloader.h"
-#endif
-
#include "focushandler.h"
#include "window.h"
#include "windowcontainer.h"
@@ -46,10 +42,7 @@
#include "../resources/image.h"
#include "../resources/resourcemanager.h"
-#include "../resources/sdlimageloader.h"
-#ifdef USE_OPENGL
-#include "../resources/openglsdlimageloader.h"
-#endif
+#include "../resources/imageloader.h"
// Guichan stuff
Gui *gui;
@@ -82,7 +75,6 @@ class GuiConfigListener : public ConfigListener
};
Gui::Gui(Graphics *graphics):
- mHostImageLoader(NULL),
mMouseCursor(NULL),
mCustomCursor(false)
{
@@ -91,21 +83,13 @@ Gui::Gui(Graphics *graphics):
setGraphics(graphics);
// Set image loader
-#ifdef USE_OPENGL
- if (config.getValue("opengl", 0)) {
- mImageLoader = new OpenGLSDLImageLoader();
- } else
-#endif
- {
- mImageLoader = new SDLImageLoader();
- }
+ static ImageLoader imageLoader;
+ gcn::Image::setImageLoader(&imageLoader);
// Set input
guiInput = new gcn::SDLInput();
setInput(guiInput);
- gcn::Image::setImageLoader(mImageLoader);
-
// Set focus handler
delete mFocusHandler;
mFocusHandler = new FocusHandler();
@@ -189,8 +173,6 @@ Gui::~Gui()
delete speechFont;
delete viewport;
delete mTop;
- delete mImageLoader;
- delete mHostImageLoader;
delete guiInput;
}