summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp24
-rw-r--r--src/gui/gui.h2
2 files changed, 3 insertions, 23 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;
}
diff --git a/src/gui/gui.h b/src/gui/gui.h
index caf27744..5f2cc810 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -86,8 +86,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 */
Image *mMouseCursor; /**< Mouse cursor image */
bool mCustomCursor; /**< Show custom cursor */