summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-10-18 18:39:48 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-10-18 18:39:48 +0000
commit86441fda9c561dd264039edc68ddabbf7cb54ce2 (patch)
treef9d15edf9587bc149a42399369bfcf3b9d5c5b27 /src/gui
parentd3ab0ef7be4c1f0098acc08748c308091e75dfff (diff)
downloadmana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.gz
mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.bz2
mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.xz
mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.zip
Merged removal of dependency on Guichan OpenGL from trunk to 0.0 branch,
including optimization of OpenGL memory usage on modern OpenGL drivers. Patches by Guillaume Melquiond.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp25
-rw-r--r--src/gui/gui.h2
2 files changed, 5 insertions, 22 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index a83f794c..db0b9f80 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -30,14 +30,10 @@
// 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 "viewport.h"
#include "window.h"
#include "windowcontainer.h"
-#include "viewport.h"
#include "../configlistener.h"
#include "../configuration.h"
@@ -46,7 +42,7 @@
#include "../resources/imageset.h"
#include "../resources/resourcemanager.h"
-#include "../resources/sdlimageloader.h"
+#include "../resources/imageloader.h"
// Guichan stuff
Gui *gui;
@@ -79,7 +75,6 @@ class GuiConfigListener : public ConfigListener
};
Gui::Gui(Graphics *graphics):
- mHostImageLoader(NULL),
mCustomCursor(false),
mMouseCursors(NULL),
mCursorType(CURSOR_POINTER)
@@ -89,24 +84,16 @@ 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();
+ mFocusHandler = new FocusHandler;
// Initialize top GUI widget
WindowContainer *guiTop = new WindowContainer();
@@ -187,8 +174,6 @@ Gui::~Gui()
delete speechFont;
delete viewport;
delete mTop;
- delete mImageLoader;
- delete mHostImageLoader;
delete guiInput;
}
diff --git a/src/gui/gui.h b/src/gui/gui.h
index c709893f..1e4b9348 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -98,8 +98,6 @@ class Gui : public gcn::Gui
private:
GuiConfigListener *mConfigListener;
- gcn::ImageLoader *mHostImageLoader; /**< For loading images in GL */
- gcn::ImageLoader *mImageLoader; /**< For loading images */
gcn::Font *mGuiFont; /**< The global GUI font */
bool mCustomCursor; /**< Show custom cursor */
ImageSet *mMouseCursors; /**< Mouse cursor images */