[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,1.54,1.55 string.cpp,1.28,1.29

James Brown ender at users.sourceforge.net
Sat Oct 12 22:40:02 CEST 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv15316/scumm

Modified Files:
	imuse.cpp string.cpp 
Log Message:
Patch 622386: do_command(256) implementation, Sam and Max


Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- imuse.cpp	12 Oct 2002 14:43:00 -0000	1.54
+++ imuse.cpp	13 Oct 2002 05:39:26 -0000	1.55
@@ -1438,10 +1438,12 @@
 			return get_sound_status(b);
 		case 14:
 			// Sam and Max: Volume Fader?
-			for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
-				if (player->_active && player->_id == (uint16)b) {
-					player->fade_vol(e, f);
-					return 0;
+			if (f != 0) {
+				for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
+					if (player->_active && player->_id == (uint16)b) {
+						player->fade_vol(e, f);
+						return 0;
+					}
 				}
 			}
 			return -1;
@@ -1491,7 +1493,6 @@
 			warning("IMuseInternal::do_command invalid command %d", cmd);
 		}
 	} else if (param == 1) {
-
 		if ((1 << cmd) & (0x783FFF)) {
 			player = get_player_byid(b);
 			if (!player)
@@ -1506,7 +1507,10 @@
 
 		switch (cmd) {
 		case 0:
-			return player->get_param(c, d);
+			if (g_scumm->_features & GID_SAMNMAX)
+				return player->_def_do_command_trigger;
+			else
+				return player->get_param(c, d);
 		case 1:
 			if (g_scumm->_features & GID_SAMNMAX) // Jamieson630: Nasty
 				player->jump (d - 1, (e - 1) * 4 + f, ((g * player->_ticks_per_beat) >> 2) + h);
@@ -2137,10 +2141,12 @@
 			if (_def_do_command_trigger && *p == _def_do_command_trigger) {
 				_def_do_command_trigger = 0;
 				_se->do_command (_deferred_do_command [0],
-				            _deferred_do_command [1],
-				            _deferred_do_command [2],
-				            _deferred_do_command [3],
-				            0, 0, 0, 0);
+				                 _deferred_do_command [1],
+				                 _deferred_do_command [2],
+				                 _deferred_do_command [3],
+				                 0, 0, 0, 0);
+			} else {
+				_def_do_command_trigger = *p;
 			} // end if
 		} // end if
 		break;

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- string.cpp	6 Oct 2002 15:39:38 -0000	1.28
+++ string.cpp	13 Oct 2002 05:39:26 -0000	1.29
@@ -45,9 +45,9 @@
 			chr = 255;
 		if (chr == 255) {
 			chr = text[pos++];
-			if (chr == 3)
+			if (chr == 3)	// 'WAIT'
 				break;
-			if (chr == 8) {
+			if (chr == 8) { // 'Verb on next line'
 				if (arg == 1)
 					break;
 				while (text[pos] == ' ')
@@ -58,7 +58,7 @@
 				pos += 2;
 				continue;
 			}
-			if (chr == 9 || chr == 1 || chr == 2)
+			if (chr == 9 || chr == 1 || chr == 2) // 'Newline'
 				break;
 			if (chr == 14) {
 				int set = text[pos] | (text[pos + 1] << 8);
@@ -93,9 +93,9 @@
 			chr = 255;
 		if (chr == 255) {
 			chr = str[pos++];
-			if (chr == 3)
+			if (chr == 3) // 'Wait'
 				break;
-			if (chr == 8) {
+			if (chr == 8) { // 'Verb on next line'
 				if (a == 1) {
 					curw = 1;
 				} else {
@@ -108,11 +108,11 @@
 				pos += 2;
 				continue;
 			}
-			if (chr == 1) {
+			if (chr == 1) { // 'Newline'
 				curw = 1;
 				continue;
 			}
-			if (chr == 2)
+			if (chr == 2) // 'Don't terminate with \n'
 				break;
 			if (chr == 14) {
 				int set = str[pos] | (str[pos + 1] << 8);
@@ -746,6 +746,7 @@
 				addStringToStack(READ_LE_UINT16(ptr + num));
 				num += 2;
 				break;
+			case 3:
 			case 9:
 //#if defined(DOTT)
 			case 10:





More information about the Scummvm-git-logs mailing list