[Scummvm-cvs-logs] SF.net SVN: scummvm: [25205] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Fri Jan 26 20:00:42 CET 2007


Revision: 25205
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25205&view=rev
Author:   drmccoy
Date:     2007-01-26 11:00:41 -0800 (Fri, 26 Jan 2007)

Log Message:
-----------
- Just warn, don't die, when a CD-Track isn't found
- Before using _vm->_adlib, first check whether it's actually there

Modified Paths:
--------------
    scummvm/trunk/engines/gob/cdrom.cpp
    scummvm/trunk/engines/gob/game.cpp
    scummvm/trunk/engines/gob/game_v1.cpp
    scummvm/trunk/engines/gob/game_v2.cpp
    scummvm/trunk/engines/gob/inter_v1.cpp
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/music.cpp

Modified: scummvm/trunk/engines/gob/cdrom.cpp
===================================================================
--- scummvm/trunk/engines/gob/cdrom.cpp	2007-01-26 18:21:41 UTC (rev 25204)
+++ scummvm/trunk/engines/gob/cdrom.cpp	2007-01-26 19:00:41 UTC (rev 25205)
@@ -172,7 +172,7 @@
 	}
 
 	if (!matchPtr) {
-		error("Track %s not found", trackname);
+		warning("Track %s not found", trackname);
 		return;
 	}
 

Modified: scummvm/trunk/engines/gob/game.cpp
===================================================================
--- scummvm/trunk/engines/gob/game.cpp	2007-01-26 18:21:41 UTC (rev 25204)
+++ scummvm/trunk/engines/gob/game.cpp	2007-01-26 19:00:41 UTC (rev 25205)
@@ -352,7 +352,7 @@
 		return;
 
 	if (_soundADL[slot]) {
-		if (_vm->_adlib->getIndex() == slot)
+		if (_vm->_adlib && (_vm->_adlib->getIndex() == slot))
 			_vm->_adlib->stopPlay();
 		if (_soundFromExt[slot] == 1) {
 			delete[] ((char *) _soundSamples[slot]);

Modified: scummvm/trunk/engines/gob/game_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v1.cpp	2007-01-26 18:21:41 UTC (rev 25204)
+++ scummvm/trunk/engines/gob/game_v1.cpp	2007-01-26 19:00:41 UTC (rev 25205)
@@ -81,9 +81,10 @@
 				_vm->_draw->_fontToSprite[i].height = -1;
 			}
 
-			if (_vm->_features & GF_MAC)
-				_vm->_adlib->stopPlay();
-			else
+			if (_vm->_features & GF_MAC) {
+				if (_vm->_adlib)
+					_vm->_adlib->stopPlay();
+			} else
 				_vm->_cdrom->stopPlaying();
 			_vm->_draw->animateCursor(4);
 			_vm->_inter->initControlVars(1);

Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp	2007-01-26 18:21:41 UTC (rev 25204)
+++ scummvm/trunk/engines/gob/game_v2.cpp	2007-01-26 19:00:41 UTC (rev 25205)
@@ -73,9 +73,10 @@
 		while (!_vm->_quitRequested) {
 			if (_vm->_global->_inter_variables != 0)
 				_vm->_draw->animateCursor(4);
-			if (_vm->_features & GF_MAC)
-				_vm->_adlib->stopPlay();
-			else
+			if (_vm->_features & GF_MAC) {
+				if (_vm->_adlib)
+					_vm->_adlib->stopPlay();
+			} else
 				_vm->_cdrom->stopPlaying();
 
 			if (skipPlay != -1) {

Modified: scummvm/trunk/engines/gob/inter_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v1.cpp	2007-01-26 18:21:41 UTC (rev 25204)
+++ scummvm/trunk/engines/gob/inter_v1.cpp	2007-01-26 19:00:41 UTC (rev 25205)
@@ -1210,7 +1210,8 @@
 }
 
 bool Inter_v1::o1_stopSound(char &cmdCount, int16 &counter, int16 &retFlag) {
-	_vm->_adlib->stopPlay();
+	if (_vm->_adlib)
+		_vm->_adlib->stopPlay();
 	_vm->_snd->stopSound(_vm->_parse->parseValExpr());
 	_soundEndTimeKey = 0;
 	return false;
@@ -1640,9 +1641,10 @@
 
 void Inter_v1::o1_playCDTrack(void) {
 	evalExpr(0);
-	if (_vm->_features & GF_MAC)
-		_vm->_adlib->playTrack(_vm->_global->_inter_resStr);
-	else
+	if (_vm->_features & GF_MAC) {
+		if (_vm->_adlib)
+			_vm->_adlib->playTrack(_vm->_global->_inter_resStr);
+	} else
 		// Used in gob1 CD
 		_vm->_cdrom->startTrack(_vm->_global->_inter_resStr);
 }
@@ -1663,9 +1665,10 @@
 }
 
 void Inter_v1::o1_stopCD(void) {
-	if (_vm->_features & GF_MAC)
-		_vm->_adlib->stopPlay();
-	else
+	if (_vm->_features & GF_MAC) {
+		if (_vm->_adlib)
+			_vm->_adlib->stopPlay();
+	} else
 		// Used in gob1 CD
 		_vm->_cdrom->stopPlaying();
 }
@@ -2587,9 +2590,10 @@
 void Inter_v1::o1_drawObjects(int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc) {
 	_vm->_goblin->drawObjects();
 
-	if (_vm->_features & GF_MAC)
-		_vm->_adlib->playBgMusic();
-	else if (_vm->_cdrom->getTrackPos() == -1)
+	if (_vm->_features & GF_MAC) {
+		if (_vm->_adlib)
+			_vm->_adlib->playBgMusic();
+	} else if (_vm->_cdrom->getTrackPos() == -1)
 		_vm->_cdrom->playBgMusic();
 }
 

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2007-01-26 18:21:41 UTC (rev 25204)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2007-01-26 19:00:41 UTC (rev 25205)
@@ -1601,10 +1601,12 @@
 			_vm->_game->_soundSamples[index]->size / 2) * 1000) / freq2;
 	}
 	// loc_E2F3
-	if (_vm->_game->_soundTypes[index] & 8) {
-		_vm->_adlib->load((byte *) _vm->_game->_soundSamples[index], index);
-		_vm->_adlib->setRepeating(repCount - 1);
-		_vm->_adlib->startPlay();
+	if ((_vm->_game->_soundTypes[index] & 8)) {
+		if (_vm->_adlib) {
+			_vm->_adlib->load((byte *) _vm->_game->_soundSamples[index], index);
+			_vm->_adlib->setRepeating(repCount - 1);
+			_vm->_adlib->startPlay();
+		}
 	} else {
 		_vm->_snd->stopSound(0);
 		_vm->_snd->playSample(_vm->_game->_soundSamples[index], repCount, frequency);

Modified: scummvm/trunk/engines/gob/music.cpp
===================================================================
--- scummvm/trunk/engines/gob/music.cpp	2007-01-26 18:21:41 UTC (rev 25204)
+++ scummvm/trunk/engines/gob/music.cpp	2007-01-26 19:00:41 UTC (rev 25205)
@@ -307,7 +307,7 @@
 
 	_notes[voice] = note;
 	note += _notCol[voice];
-	note = MIN(0x5F, (int)note);
+	note = MIN((byte) 0x5F, note);
 	octa = note / 12;
 	freq = _freqs[_notLin[voice]][note - octa * 12];
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list