[Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.135,1.136 gameDetector.h,1.52,1.53

Jamieson Christian jamieson630 at users.sourceforge.net
Fri Aug 15 03:39:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv20171/common

Modified Files:
	gameDetector.cpp gameDetector.h 
Log Message:
Replaced ADLIB_ALWAYS and ADLIB_PREFERRED with a more flexible
list of music types supported. This was done because now
PC speaker support must be treated separately, along with
Adlib and native (GM/MT32) support.

This fixes a problem with games that don't support PC speaker
(including V5 games that don't parse SPK resources yet)
being run with -epcspk or -epcjr. Those games now properly
switch to -enull so that music resources still get parsed
and music/script synchronization mechanisms don't break.

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- gameDetector.cpp	13 Aug 2003 15:34:00 -0000	1.135
+++ gameDetector.cpp	15 Aug 2003 10:19:05 -0000	1.136
@@ -704,13 +704,17 @@
 	 * and the game is one of those that want adlib as
 	 * default, OR if the game is an older game that doesn't
 	 * support anything else anyway. */
+	if (_midi_driver == MD_AUTO)
+		_midi_driver = MD_ADLIB;
 	bool nativeMidiDriver =
 		(_midi_driver != MD_NULL && _midi_driver != MD_ADLIB &&
 		 _midi_driver != MD_PCSPK && _midi_driver != MD_PCJR);
-	if ((_game.adlib & VersionSettings::ADLIB_ALWAYS) && nativeMidiDriver ||
-	    (_game.adlib & VersionSettings::ADLIB_PREFERRED) && _midi_driver == MD_AUTO) {
+	if (nativeMidiDriver && !(_game.midi & MDT_NATIVE))
 		_midi_driver = MD_ADLIB;
-	}
+	if (_midi_driver == MD_ADLIB && !(_game.midi & MDT_ADLIB))
+		_midi_driver = MD_PCJR;
+	if ((_midi_driver == MD_PCSPK || _midi_driver == MD_PCJR) && !(_game.midi & MDT_PCSPK))
+		_midi_driver = MD_NULL;
 
 	if (!_gameDataPath) {
 		warning("No path was provided. Assuming the data files are in the current directory");

Index: gameDetector.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- gameDetector.h	13 Aug 2003 14:07:56 -0000	1.52
+++ gameDetector.h	15 Aug 2003 10:19:06 -0000	1.53
@@ -61,16 +61,18 @@
 	HB_HEB = 20
 };
 
+enum MidiDriverType {
+	MDT_NONE   = 0,
+	MDT_PCSPK  = 1, // MD_PCSPK and MD_PCJR
+	MDT_ADLIB  = 2, // MD_ADLIB
+	MDT_NATIVE = 4  // Everything else
+};
+
 struct VersionSettings {
 	const char *filename;
 	const char *gamename;
 	byte id, version;
-	enum {
-		ADLIB_DONT_CARE = 0,
-		ADLIB_PREFERRED = 1,
-		ADLIB_ALWAYS    = 2,
-		ADLIB_NEVER     = 3
-	} adlib;
+	int midi; // MidiDriverType values
 	uint32 features;
 	const char *detectname;
 };





More information about the Scummvm-git-logs mailing list