aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2016-11-04 20:09:22 -0500
committerColin Snover2016-11-04 20:10:21 -0500
commit4bfd005c78b4093c01f08ab3e9a3ecf9189c8c84 (patch)
tree669b3abdfed0408234ec28d4ed6f43e56a0bf529 /engines/sci
parentf89b0e8c45ba5fedff1d1baf5ce8fab0129ceb14 (diff)
downloadscummvm-rg350-4bfd005c78b4093c01f08ab3e9a3ecf9189c8c84.tar.gz
scummvm-rg350-4bfd005c78b4093c01f08ab3e9a3ecf9189c8c84.tar.bz2
scummvm-rg350-4bfd005c78b4093c01f08ab3e9a3ecf9189c8c84.zip
SCI32: Stop digital audio when VMDs open in some SCI2.1 games
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/features.h11
-rw-r--r--engines/sci/graphics/video32.cpp9
2 files changed, 19 insertions, 1 deletions
diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index 15c80a7277..36b0d06360 100644
--- a/engines/sci/engine/features.h
+++ b/engines/sci/engine/features.h
@@ -117,6 +117,17 @@ public:
inline bool hasNewPaletteCode() const {
return getSciVersion() >= SCI_VERSION_2_1_MIDDLE || g_sci->getGameId() == GID_KQ7;
}
+
+ inline bool VMDOpenStopsAudio() const {
+ // Of the games that use VMDs:
+ // Yes: Phant1, Shivers, Torin
+ // No: SQ6
+ // TODO: Optional extra flag to kPlayVMD which defaults to Yes: PQ:SWAT
+ // TODO: SCI3, GK2 (GK2's VMD code is closer to SCI3 than SCI21)
+ return getSciVersion() == SCI_VERSION_2_1_MIDDLE &&
+ g_sci->getGameId() != GID_SQ6 &&
+ g_sci->getGameId() != GID_GK2;
+ }
#endif
/**
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index e44c159c1d..8e267f9144 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -28,6 +28,7 @@
#include "engine.h" // for Engine, g_engine
#include "engines/util.h" // for initGraphics
#include "sci/console.h" // for Console
+#include "sci/engine/features.h" // for GameFeatures
#include "sci/engine/state.h" // for EngineState
#include "sci/engine/vm_types.h" // for reg_t
#include "sci/event.h" // for SciEvent, EventManager, SCI_...
@@ -39,10 +40,12 @@
#include "sci/graphics/plane32.h" // for Plane, PlanePictureCodes::kP...
#include "sci/graphics/screen_item32.h" // for ScaleInfo, ScreenItem, Scale...
#include "sci/sci.h" // for SciEngine, g_sci, getSciVersion
-#include "sci/graphics/video32.h"
+#include "sci/sound/audio32.h" // for Audio32
#include "sci/video/seq_decoder.h" // for SEQDecoder
#include "video/avi_decoder.h" // for AVIDecoder
#include "video/coktel_decoder.h" // for AdvancedVMDDecoder
+#include "sci/graphics/video32.h"
+
namespace Graphics { struct Surface; }
namespace Sci {
@@ -526,6 +529,10 @@ VMDPlayer::IOStatus VMDPlayer::open(const Common::String &fileName, const OpenFl
error("Attempted to play %s, but another VMD was loaded", fileName.c_str());
}
+ if (g_sci->_features->VMDOpenStopsAudio()) {
+ g_sci->_audio32->stop(kAllChannels);
+ }
+
if (_decoder->loadFile(fileName)) {
if (flags & kOpenFlagMute) {
_decoder->setVolume(0);