aboutsummaryrefslogtreecommitdiff
path: root/engines/griffon
diff options
context:
space:
mode:
authorStrangerke2019-10-23 22:25:29 +0200
committerEugene Sandulenko2019-11-13 22:07:08 +0100
commit4f8753d839c4a038678d5c93ab2d35b70e64e5d4 (patch)
treec8b79e7f644f05120b72489b55af4be8f00cace8 /engines/griffon
parentbfd5abdee35f3b0b720ba19f021433f7e6b9f477 (diff)
downloadscummvm-rg350-4f8753d839c4a038678d5c93ab2d35b70e64e5d4.tar.gz
scummvm-rg350-4f8753d839c4a038678d5c93ab2d35b70e64e5d4.tar.bz2
scummvm-rg350-4f8753d839c4a038678d5c93ab2d35b70e64e5d4.zip
GRIFFON: Change volume in option menu
Diffstat (limited to 'engines/griffon')
-rw-r--r--engines/griffon/dialogs.cpp13
-rw-r--r--engines/griffon/sound.cpp4
2 files changed, 12 insertions, 5 deletions
diff --git a/engines/griffon/dialogs.cpp b/engines/griffon/dialogs.cpp
index c7d7a6a855..4031da742f 100644
--- a/engines/griffon/dialogs.cpp
+++ b/engines/griffon/dialogs.cpp
@@ -35,6 +35,7 @@
*/
#include "common/system.h"
+#include "common/config-manager.h"
#include "griffon/griffon.h"
#include "griffon/config.h"
@@ -221,6 +222,10 @@ void GriffonEngine::configMenu() {
configwindow->setAlpha(160, true);
int ticks1 = _ticks;
+
+ config.musicvol = ConfMan.getInt("music_volume");
+ config.effectsvol = ConfMan.getInt("sfx_volume");
+
do {
_videobuffer->fillRect(Common::Rect(0, 0, _videobuffer->w, _videobuffer->h), 0);
@@ -356,14 +361,14 @@ void GriffonEngine::configMenu() {
if (_event.kbd.keycode == Common::KEYCODE_LEFT) {
if (cursel == 11) {
- config.musicvol = config.musicvol - 25;
+ config.musicvol -= 25;
if (config.musicvol < 0)
config.musicvol = 0;
setChannelVolume(_musicchannel, config.musicvol);
setChannelVolume(_menuchannel, config.musicvol);
} else if (cursel == 12) {
- config.effectsvol = config.effectsvol - 25;
+ config.effectsvol -= 25;
if (config.effectsvol < 0)
config.effectsvol = 0;
@@ -379,14 +384,14 @@ void GriffonEngine::configMenu() {
}
if (_event.kbd.keycode == Common::KEYCODE_RIGHT) {
if (cursel == 11) {
- config.musicvol = config.musicvol + 25;
+ config.musicvol += 25;
if (config.musicvol > 255)
config.musicvol = 255;
setChannelVolume(_musicchannel, config.musicvol);
setChannelVolume(_menuchannel, config.musicvol);
} else if (cursel == 12) {
- config.effectsvol = config.effectsvol + 25;
+ config.effectsvol += 25;
if (config.effectsvol > 255)
config.effectsvol = 255;
diff --git a/engines/griffon/sound.cpp b/engines/griffon/sound.cpp
index f488c5b757..44373c995f 100644
--- a/engines/griffon/sound.cpp
+++ b/engines/griffon/sound.cpp
@@ -46,7 +46,9 @@
namespace Griffon {
-void GriffonEngine::setChannelVolume(int channel, int volume) {}
+void GriffonEngine::setChannelVolume(int channel, int volume) {
+ _mixer->setChannelVolume(_handles[channel], volume);
+}
int GriffonEngine::getSoundHandle() {
for (uint i = 0; i < kSoundHandles; i++) {