[Scummvm-git-logs] scummvm master -> 4bfd005c78b4093c01f08ab3e9a3ecf9189c8c84

csnover csnover at users.noreply.github.com
Sat Nov 5 02:10:26 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4bfd005c78 SCI32: Stop digital audio when VMDs open in some SCI2.1 games


Commit: 4bfd005c78b4093c01f08ab3e9a3ecf9189c8c84
    https://github.com/scummvm/scummvm/commit/4bfd005c78b4093c01f08ab3e9a3ecf9189c8c84
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-11-04T20:10:21-05:00

Commit Message:
SCI32: Stop digital audio when VMDs open in some SCI2.1 games

Changed paths:
    engines/sci/engine/features.h
    engines/sci/graphics/video32.cpp



diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index 15c80a7..36b0d06 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 e44c159..8e267f9 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);





More information about the Scummvm-git-logs mailing list