diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-29 14:12:39 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-29 14:12:39 +0000 |
commit | 4988b2ae63413a754196b915c2de34f74ad3ce8d (patch) | |
tree | c4a761a6ed2fe0df0706af05631ba05968ae4e78 /src/gui | |
parent | b2ee6c2da10288415e597d254a7694f7ddccbc78 (diff) | |
download | mana-4988b2ae63413a754196b915c2de34f74ad3ce8d.tar.gz mana-4988b2ae63413a754196b915c2de34f74ad3ce8d.tar.bz2 mana-4988b2ae63413a754196b915c2de34f74ad3ce8d.tar.xz mana-4988b2ae63413a754196b915c2de34f74ad3ce8d.zip |
Changes to disable sound on Windows.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/setup.cpp | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index d4396408..5be5fe5f 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -28,7 +28,9 @@ #include "setup.h" +#ifndef WIN32 extern Sound sound; +#endif /* no WIN32 */ /* * Metod returns the number of elements in container @@ -137,32 +139,33 @@ Setup::~Setup() { */ void Setup::action(const std::string& eventId) { - if(eventId == "apply") { - setVisible(false); + if (eventId == "apply") { + setVisible(false); - /* Display settings */ - if(fsCheckBox->isMarked() == true && config.getValue("screen",0) == 2) { - config.setValue("screen",1); - set_gfx_mode(GFX_AUTODETECT_FULLSCREEN,800,600,0,0); - - } else - if(fsCheckBox->isMarked() == false && config.getValue("screen",0) == 1) { - config.setValue("screen",2); - set_gfx_mode(GFX_AUTODETECT_WINDOWED,800,600,0,0); - } + /* Display settings */ + if (fsCheckBox->isMarked() == true && config.getValue("screen",0) == 2) { + config.setValue("screen",1); + set_gfx_mode(GFX_AUTODETECT_FULLSCREEN,800,600,0,0); + + } else + if (fsCheckBox->isMarked() == false && config.getValue("screen",0) == 1) { + config.setValue("screen",2); + set_gfx_mode(GFX_AUTODETECT_WINDOWED,800,600,0,0); + } - /* Sound settings */ - if(soundCheckBox->isMarked() == true) { + /* Sound settings */ +#ifndef WIN32 + if (soundCheckBox->isMarked() == true) { config.setValue("sound",1); sound.init(32, 20); - } else { - config.setValue("sound",0); + } else { + config.setValue("sound",0); sound.close(); + } +#endif /* not WIN32 */ + } else if(eventId == "cancel") { + setVisible(false); } - - } else if(eventId == "cancel") { - setVisible(false); - } } /* @@ -170,11 +173,13 @@ void Setup::action(const std::string& eventId) */ Setup * Setup::ptr = NULL; Setup * Setup::create_setup() { - if(ptr == NULL) - ptr = new Setup(guiTop); - else - ptr->setVisible(true); + if(ptr == NULL) { + ptr = new Setup(guiTop); + } + else { + ptr->setVisible(true); + } - return ptr; + return ptr; } |