summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
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 */