diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui.cpp | 13 | ||||
-rw-r--r-- | src/gui/gui.h | 2 | ||||
-rw-r--r-- | src/gui/setup.cpp | 4 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 436a5a1a..6a57f214 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -45,12 +45,13 @@ Gui::Gui(Graphics *graphics) setInput(guiInput); // Set image loader -#ifndef USE_OPENGL - imageLoader = new gcn::SDLImageLoader(); -#else - hostImageLoader = new gcn::SDLImageLoader(); - imageLoader = new gcn::OpenGLImageLoader(hostImageLoader); -#endif + if (useOpenGL) { + hostImageLoader = new gcn::SDLImageLoader(); + imageLoader = new gcn::OpenGLImageLoader(hostImageLoader); + } + else { + imageLoader = new gcn::SDLImageLoader(); + } gcn::Image::setImageLoader(imageLoader); // Initialize top GUI widget diff --git a/src/gui/gui.h b/src/gui/gui.h index 66f7cb0f..f2d48c77 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -69,9 +69,7 @@ class Gui : public gcn::Gui, public gcn::MouseListener private: gcn::Gui *gui; /**< The GUI system */ -#ifdef USE_OPENGL gcn::ImageLoader *hostImageLoader; /**< For loading images in GL */ -#endif gcn::ImageLoader *imageLoader; /**< For loading images */ gcn::ImageFont *guiFont; /**< The global GUI font */ diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 87d4ef42..42b770f9 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -188,12 +188,12 @@ void Setup::action(const std::string &eventId) if (eventId == "sfx") { config.setValue("sfxVolume", (int)sfxSlider->getValue()); - sound.setSfxVolume(sfxSlider->getValue()); + sound.setSfxVolume((int)sfxSlider->getValue()); } else if (eventId == "music") { config.setValue("musicVolume", (int)musicSlider->getValue()); - sound.setMusicVolume(musicSlider->getValue()); + sound.setMusicVolume((int)musicSlider->getValue()); } else if (eventId == "guialpha") { |