From 464ee013f0ab22616221f4f9b812ccc8932b3f2c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 14 Jul 2009 19:32:25 +0000 Subject: Replaced char usage by int8, since char is unsigned on Linux/PPC by default. svn-id: r42490 --- engines/scumm/player_v2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/player_v2.h b/engines/scumm/player_v2.h index f0e14cdde3..5b375fb1e5 100644 --- a/engines/scumm/player_v2.h +++ b/engines/scumm/player_v2.h @@ -242,8 +242,8 @@ protected: Voice2 _cmsVoices[8]; MusicChip _cmsChips[2]; - char _tempo; - char _tempoSum; + int8 _tempo; + int8 _tempoSum; byte _looping; byte _octaveMask; int16 _midiDelay; -- cgit v1.2.3 From b159517dc3f55f3589bf9b7727607e7d216fde52 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Wed, 15 Jul 2009 02:06:26 +0000 Subject: Fix bug #2821215 - DIG: Skipping planetarium animation disables F5 menu. svn-id: r42498 --- engines/scumm/input.cpp | 17 +++++++++++++++-- engines/scumm/script_v6.cpp | 5 +++-- engines/scumm/scumm.cpp | 1 + engines/scumm/scumm_v6.h | 1 + engines/scumm/scumm_v7.h | 1 + 5 files changed, 21 insertions(+), 4 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 42b48a3f3d..61b714a3e2 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -258,6 +258,18 @@ void ScummEngine_v0::processInput() { ScummEngine::processInput(); } +#ifdef ENABLE_SCUMM_7_8 +void ScummEngine_v7::processInput() { + ScummEngine::processInput(); + + if (_skipVideo && !_smushActive) { + abortCutscene(); + _mouseAndKeyboardStat = Common::ASCII_ESCAPE; + _skipVideo = false; + } +} +#endif + void ScummEngine::processInput() { Common::KeyState lastKeyHit = _keyPressed; _keyPressed.reset(); @@ -392,9 +404,10 @@ void ScummEngine_v7::processKeyboard(Common::KeyState lastKeyHit) { _insane->escapeKeyHandler(); else _smushVideoShouldFinish = true; - } - if (!_smushActive || _smushVideoShouldFinish) + _skipVideo = true; + } else { abortCutscene(); + } _mouseAndKeyboardStat = Common::ASCII_ESCAPE; diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index c23a64be5b..dcd60352c7 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -1396,6 +1396,7 @@ void ScummEngine_v6::o6_getVerbFromXY() { void ScummEngine_v6::o6_beginOverride() { beginOverride(); + _skipVideo = 0; } void ScummEngine_v6::o6_endOverride() { @@ -2457,7 +2458,7 @@ void ScummEngine_v7::o6_kernelSetFunctions() { break; case 6: { // SMUSH movie playback - if (args[1] == 0) { + if (args[1] == 0 && !_skipVideo) { const char *videoname = (const char *)getStringAddressVar(VAR_VIDEONAME); assert(videoname); @@ -2474,7 +2475,7 @@ void ScummEngine_v7::o6_kernelSetFunctions() { if (_game.id == GID_DIG) { _disableFadeInEffect = true; } - } else if (_game.id == GID_FT) { + } else if (_game.id == GID_FT && !_skipVideo) { const int insaneVarNum = ((_game.features & GF_DEMO) && (_game.platform == Common::kPlatformPC)) ? 232 : 233; diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 143c550180..42fbb590b3 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -682,6 +682,7 @@ ScummEngine_v6::ScummEngine_v6(OSystem *syst, const DetectorResult &dr) _curVerbSlot = 0; _forcedWaitForMessage = false; + _skipVideo = false; VAR_VIDEONAME = 0xFF; VAR_RANDOM_NR = 0xFF; diff --git a/engines/scumm/scumm_v6.h b/engines/scumm/scumm_v6.h index d4768a7e92..eb55b83596 100644 --- a/engines/scumm/scumm_v6.h +++ b/engines/scumm/scumm_v6.h @@ -93,6 +93,7 @@ protected: int _curVerbSlot; bool _forcedWaitForMessage; + bool _skipVideo; public: ScummEngine_v6(OSystem *syst, const DetectorResult &dr); diff --git a/engines/scumm/scumm_v7.h b/engines/scumm/scumm_v7.h index fdc1d6de9c..fcadadb04d 100644 --- a/engines/scumm/scumm_v7.h +++ b/engines/scumm/scumm_v7.h @@ -103,6 +103,7 @@ protected: virtual void scummLoop_handleSound(); virtual void scummLoop_handleDrawing(); + virtual void processInput(); virtual void processKeyboard(Common::KeyState lastKeyHit); virtual void setupScumm(); -- cgit v1.2.3 From 9c06549d318be73de69e7e42ccbe49f99bbdc7cd Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Wed, 15 Jul 2009 05:00:59 +0000 Subject: Hack is no longer required, due to revision 42498. svn-id: r42499 --- engines/scumm/script.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 78f7fb0453..4d9447bee5 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -1367,17 +1367,6 @@ void ScummEngine::abortCutscene() { VAR(VAR_OVERRIDE) = 1; vm.cutScenePtr[idx] = 0; - - // HACK to fix issues with SMUSH and the way it does keyboard handling. - // In particular, normally abortCutscene() is being called while no - // scripts are active. But SMUSH runs from *inside* the script engine. - // And it calls abortCutscene() if ESC is pressed... not good. - // Proper fix might be to let SMUSH/INSANE run from outside the script - // engine but that would require lots of changes and may actually have - // negative effects, too. So we cheat here, to fix bug #751670. - if (_game.version == 7) - getScriptEntryPoint(); - } } -- cgit v1.2.3 From af289bdb03d7f0a5e8f01c03e462f230835e0077 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Thu, 16 Jul 2009 17:29:31 +0000 Subject: Fixed bug 2820514 ("Help dialog causes crash") svn-id: r42537 --- engines/scumm/dialogs.cpp | 16 ++++++++++++---- engines/scumm/dialogs.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 9fb107f9fc..54ade5b7ca 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -641,6 +641,8 @@ HelpDialog::HelpDialog(const GameSettings &game) new GUI::ButtonWidget(this, "ScummHelp.Close", "Close", kCloseCmd, 'C'); _prevButton->clearFlags(WIDGET_ENABLED); + _numLines = HELP_NUM_LINES; + // Dummy entries for (int i = 0; i < HELP_NUM_LINES; i++) { _key[i] = new StaticTextWidget(this, 0, 0, 10, 10, "", Graphics::kTextAlignRight); @@ -658,15 +660,20 @@ void HelpDialog::reflowLayout() { g_gui.xmlEval()->getWidgetData("ScummHelp.HelpText", x, y, w, h); + /* Make sure than we don't have more lines than what we can fit + * on the space that the layout reserves for text */ + _numLines = MIN(HELP_NUM_LINES, (int)(h / lineHeight)); + + int keyW = w * 20 / 100; int dscX = x + keyW + 32; int dscW = w * 80 / 100; int xoff = (_w >> 1) - (w >> 1); - for (int i = 0; i < HELP_NUM_LINES; i++) { - _key[i]->resize(xoff + x, y + lineHeight * i, keyW, lineHeight + 2); - _dsc[i]->resize(xoff + dscX, y + lineHeight * i, dscW, lineHeight + 2); + for (int i = 0; i < _numLines; i++) { + _key[i]->resize(xoff + x, y + lineHeight * i, keyW, lineHeight); + _dsc[i]->resize(xoff + dscX, y + lineHeight * i, dscW, lineHeight); } displayKeyBindings(); @@ -675,6 +682,7 @@ void HelpDialog::reflowLayout() { void HelpDialog::displayKeyBindings() { String titleStr, *keyStr, *dscStr; + int i; #ifndef __DS__ ScummHelp::updateStrings(_game.id, _game.version, _game.platform, _page, titleStr, keyStr, dscStr); @@ -684,7 +692,7 @@ void HelpDialog::displayKeyBindings() { #endif _title->setLabel(titleStr); - for (int i = 0; i < HELP_NUM_LINES; i++) { + for (i = 0; i < _numLines; i++) { _key[i]->setLabel(keyStr[i]); _dsc[i]->setLabel(dscStr[i]); } diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index 290b3450dc..996ff0e7a7 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -124,6 +124,7 @@ protected: int _page; int _numPages; + int _numLines; const GameSettings _game; -- cgit v1.2.3 From 2422ee06a25a82ce5367a2c36cb72422f61343e8 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 16 Jul 2009 17:39:16 +0000 Subject: Formatting fixes. svn-id: r42538 --- engines/scumm/dialogs.cpp | 9 +++------ engines/scumm/dialogs.h | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 54ade5b7ca..9d3ba527c4 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -660,11 +660,10 @@ void HelpDialog::reflowLayout() { g_gui.xmlEval()->getWidgetData("ScummHelp.HelpText", x, y, w, h); - /* Make sure than we don't have more lines than what we can fit - * on the space that the layout reserves for text */ + // Make sure than we don't have more lines than what we can fit + // on the space that the layout reserves for text _numLines = MIN(HELP_NUM_LINES, (int)(h / lineHeight)); - int keyW = w * 20 / 100; int dscX = x + keyW + 32; int dscW = w * 80 / 100; @@ -680,9 +679,7 @@ void HelpDialog::reflowLayout() { } void HelpDialog::displayKeyBindings() { - String titleStr, *keyStr, *dscStr; - int i; #ifndef __DS__ ScummHelp::updateStrings(_game.id, _game.version, _game.platform, _page, titleStr, keyStr, dscStr); @@ -692,7 +689,7 @@ void HelpDialog::displayKeyBindings() { #endif _title->setLabel(titleStr); - for (i = 0; i < _numLines; i++) { + for (int i = 0; i < _numLines; i++) { _key[i]->setLabel(keyStr[i]); _dsc[i]->setLabel(dscStr[i]); } diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index 996ff0e7a7..af844272fa 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -124,7 +124,7 @@ protected: int _page; int _numPages; - int _numLines; + int _numLines; const GameSettings _game; -- cgit v1.2.3 From 1e3beb40c04ef323f5354e4258659764735fdb0c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 16 Jul 2009 17:44:05 +0000 Subject: This commit is just for DrMcCoy. (forgot to fix two usages of whitespaces instead of tabs for indentation -.-) svn-id: r42539 --- engines/scumm/dialogs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 9d3ba527c4..880fab04a5 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -641,7 +641,7 @@ HelpDialog::HelpDialog(const GameSettings &game) new GUI::ButtonWidget(this, "ScummHelp.Close", "Close", kCloseCmd, 'C'); _prevButton->clearFlags(WIDGET_ENABLED); - _numLines = HELP_NUM_LINES; + _numLines = HELP_NUM_LINES; // Dummy entries for (int i = 0; i < HELP_NUM_LINES; i++) { @@ -662,7 +662,7 @@ void HelpDialog::reflowLayout() { // Make sure than we don't have more lines than what we can fit // on the space that the layout reserves for text - _numLines = MIN(HELP_NUM_LINES, (int)(h / lineHeight)); + _numLines = MIN(HELP_NUM_LINES, (int)(h / lineHeight)); int keyW = w * 20 / 100; int dscX = x + keyW + 32; -- cgit v1.2.3 From c0965b2a2aceab1468bccf5368b3c46f7a97efa1 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Fri, 17 Jul 2009 00:10:10 +0000 Subject: Fix using subtitles only setting in The Dig. svn-id: r42545 --- engines/scumm/string.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/scumm') diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index d40bbb9aaa..f00f4ff33b 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -1415,6 +1415,9 @@ void ScummEngine_v7::loadLanguageBundle() { } void ScummEngine_v7::playSpeech(const byte *ptr) { + if (_game.id == GID_DIG && (ConfMan.getBool("speech_mute") || VAR(VAR_VOICE_MODE) == 2)) + return; + if ((_game.id == GID_DIG || _game.id == GID_CMI) && ptr[0]) { char pointer[20]; strcpy(pointer, (const char *)ptr); -- cgit v1.2.3 From cff307e55db7cfe088885214bfc75b545223f9bd Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Fri, 17 Jul 2009 00:25:27 +0000 Subject: Fix bug #2821986 - COMI: setting to 'subtitles only' does not disable speech. svn-id: r42548 --- engines/scumm/imuse_digi/dimuse_track.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/scumm') diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 6ded6d23b2..a389c0e7e7 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -22,6 +22,7 @@ * $Id$ */ +#include "common/config-manager.h" #include "common/timer.h" #include "scumm/actor.h" @@ -136,6 +137,11 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, track->pan = a->_talkPan; track->vol = a->_talkVolume * 1000; } + + // The volume is set to zero, when using subtitles only setting in COMI + if (ConfMan.getBool("speech_mute") || _vm->VAR(_vm->VAR_VOICE_MODE) == 2) { + track->vol = 0; + } } assert(bits == 8 || bits == 12 || bits == 16); -- cgit v1.2.3