diff options
author | Filippos Karapetis | 2009-10-22 07:18:37 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-10-22 07:18:37 +0000 |
commit | 93517e7649da286cd5b86efb3ee2e5cf7e7be436 (patch) | |
tree | e3f3e4ffa263dd8ec3768187f48707e7bcf1576b /engines/sci/engine | |
parent | f79d3bb7cd181326e8ddba5d7f5a43a3871dac65 (diff) | |
download | scummvm-rg350-93517e7649da286cd5b86efb3ee2e5cf7e7be436.tar.gz scummvm-rg350-93517e7649da286cd5b86efb3ee2e5cf7e7be436.tar.bz2 scummvm-rg350-93517e7649da286cd5b86efb3ee2e5cf7e7be436.zip |
Applied a modified version of patch #2881486 - "Add volume changing to SCI"
svn-id: r45329
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/ksound.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 74a08fdea2..01f20d2f4e 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -352,9 +352,9 @@ static reg_t kDoSoundSci0(EngineState *s, int argc, reg_t *argv) { int vol = (argc > 1) ? argv[1].toSint16() : -1; if (vol != -1) - s->_sound.sfx_set_volume(vol << 0xf); + s->_sound.sfx_setVolume(vol); else - s->r_acc = make_reg(0, s->_sound.sfx_get_volume() >> 0xf); + s->r_acc = make_reg(0, s->_sound.sfx_getVolume()); } break; @@ -474,9 +474,9 @@ static reg_t kDoSoundSci1Early(EngineState *s, int argc, reg_t *argv) { int vol = (argc > 1) ? argv[1].toSint16() : -1; if (vol != -1) - s->_sound.sfx_set_volume(vol << 0xf); + s->_sound.sfx_setVolume(vol); else - s->r_acc = make_reg(0, s->_sound.sfx_get_volume() >> 0xf); + s->r_acc = make_reg(0, s->_sound.sfx_getVolume()); break; } case _K_SCI01_SOUND_MUTE_SOUND : { @@ -781,13 +781,13 @@ static reg_t kDoSoundSci1Late(EngineState *s, int argc, reg_t *argv) { switch (command) { case _K_SCI1_SOUND_MASTER_VOLME : { - /*int vol = UPARAM_OR_ALT (1, -1); + int vol = (argc > 1 ? argv[1].offset : -1); - if (vol != -1) - s->acc = s->sound_server->command(s, SOUND_COMMAND_SET_VOLUME, 0, vol); - else - s->acc = s->sound_server->command(s, SOUND_COMMAND_GET_VOLUME, 0, 0); - break;*/ + if (vol != -1) + s->_sound.sfx_setVolume(vol); + + s->r_acc = make_reg(0, s->_sound.sfx_getVolume()); + break; } case _K_SCI1_SOUND_MUTE_SOUND : { /* if there's a parameter, we're setting it. Otherwise, |