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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Mar 4 16:34:59 CET 2007


Revision: 25977
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25977&view=rev
Author:   drmccoy
Date:     2007-03-04 07:34:58 -0800 (Sun, 04 Mar 2007)

Log Message:
-----------
- Some minor fixes
- Added the Gob2 Mac version fac76 reported in bug #1673397

Modified Paths:
--------------
    scummvm/trunk/engines/gob/detection.cpp
    scummvm/trunk/engines/gob/draw_v2.cpp
    scummvm/trunk/engines/gob/game_v2.cpp
    scummvm/trunk/engines/gob/init_v2.cpp
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/mult_v2.cpp

Modified: scummvm/trunk/engines/gob/detection.cpp
===================================================================
--- scummvm/trunk/engines/gob/detection.cpp	2007-03-04 15:09:45 UTC (rev 25976)
+++ scummvm/trunk/engines/gob/detection.cpp	2007-03-04 15:34:58 UTC (rev 25977)
@@ -356,6 +356,22 @@
 		GF_GOB2,
 		"intro"
 	},
+	{ // Supplied by fac76 in bug report #1673397
+		{
+			"gob2",
+			"",
+			{
+				{"intro.stk", 0, "b45b984ee8017efd6ea965b9becd4d66", 828443},
+				{"musmac1.mid", 0, "7f96f491448c7a001b32df89cf8d2af2", 1658},
+				{NULL, 0, NULL, 0}
+			},
+			UNK_LANG,
+			kPlatformMacintosh,
+			Common::ADGF_NO_FLAGS
+		},
+		GF_GOB2,
+		"intro"
+	},
 	{
 		{
 			"gob2",

Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp	2007-03-04 15:09:45 UTC (rev 25976)
+++ scummvm/trunk/engines/gob/draw_v2.cpp	2007-03-04 15:34:58 UTC (rev 25977)
@@ -41,9 +41,9 @@
 
 void Draw_v2::printText(void) {
 	int i;
-	char *dataPtr;
-	char *ptr;
-	char *ptr2;
+	byte *dataPtr;
+	byte *ptr;
+	byte *ptr2;
 	char mask[80];
 	char str[80];
 	char buf[50];
@@ -86,39 +86,32 @@
 	}
 
 	size = _vm->_game->_totTextData->items[index].size;
-	dataPtr = _vm->_game->_totTextData->dataPtr + _vm->_game->_totTextData->items[index].offset;
+	dataPtr = ((byte *) _vm->_game->_totTextData->dataPtr) +
+		_vm->_game->_totTextData->items[index].offset;
 	ptr = dataPtr;
 
 	if ((_renderFlags & 0x400) && (ptr[1] & 0x80))
 		return;
 
+	destX = READ_LE_UINT16(ptr) & 0x7FFF;
+	destY = READ_LE_UINT16(ptr + 2);
+	spriteRight = READ_LE_UINT16(ptr + 4);
+	spriteBottom = READ_LE_UINT16(ptr + 6);
+	ptr += 8;
+
 	if (_renderFlags & RENDERFLAG_CAPTUREPUSH) {
-		_destSpriteX = READ_LE_UINT16(ptr) & 0x7FFF;
-		_destSpriteY = READ_LE_UINT16(ptr + 2);
-		_spriteRight = READ_LE_UINT16(ptr + 4) - _destSpriteX + 1;
-		_spriteBottom = READ_LE_UINT16(ptr + 6) - _destSpriteY + 1;
-		_vm->_game->capturePush(_destSpriteX, _destSpriteY,
-						 _spriteRight, _spriteBottom);
+		_vm->_game->capturePush(destX, destY,
+				spriteRight - destX + 1, spriteBottom - destY + 1);
 		(*_vm->_scenery->_pCaptureCounter)++;
 	}
-	
-	_destSpriteX = READ_LE_UINT16(ptr) & 0x7FFF;
-	destX = _destSpriteX;
 
-	_destSpriteY = READ_LE_UINT16(ptr + 2);
-	destY = _destSpriteY;
-
-	_spriteRight = READ_LE_UINT16(ptr + 4);
-	spriteRight = _spriteRight;
-
-	_spriteBottom = READ_LE_UINT16(ptr + 6);
-	spriteBottom = _spriteBottom;
-
+	_destSpriteX = destX;
+	_destSpriteY = destY;
+	_spriteRight = spriteRight;
+	_spriteBottom = spriteBottom;
 	_destSurface = 21;
 
-	ptr += 8;
-
-	_backColor = (byte) *ptr++;
+	_backColor = *ptr++;
 	_transparency = 1;
 
 	spriteOperation(DRAW_CLEARRECT);
@@ -151,7 +144,7 @@
 
 	// Adding the boundary check *shouldn't* pose any problems, since access behind
 	// that point should be forbidden anyway.
-	for (i = 0, ptr2 = ptr; ((ptr2 - dataPtr) < size) && (*ptr2 != 1); ptr2++, i++) {
+	for (i = 0, ptr2 = ptr; ((ptr2 - dataPtr) < size) && (*ptr2 != 1); i++) {
 		if ((_vm->_game->_totFileData[0x29] < 0x32) && (*ptr2 > 3) && (*ptr2 < 32))
 			*ptr2 = 32;
 
@@ -171,7 +164,7 @@
 
 		case 6:
 			ptr2++;
-			switch (*ptr & 0xC0) {
+			switch (*ptr2 & 0xC0) {
 			case 0x40:
 				ptr2 += 9;
 				break;
@@ -188,7 +181,7 @@
 			break;
 
 		case 10:
-			ptr2 += (((byte) ptr2[1]) * 2) + 2;
+			ptr2 += (ptr2[1] * 2) + 2;
 			break;
 
 		default:
@@ -214,7 +207,7 @@
 	_transparency = 1;
 	
 	while (true) {
-		if ((*ptr >= 1) && ((*ptr <= 7) || (*ptr == 10)) && (strPos != 0)) {
+		if ((((*ptr >= 1) && (*ptr <= 7)) || (*ptr == 10)) && (strPos != 0)) {
 			str[MAX(strPos, strPos2)] = 0;
 			strPosBak = strPos;
 			width = strlen(str) * _fonts[fontIndex]->itemWidth;
@@ -299,7 +292,7 @@
 
 		case 4:
 			ptr++;
-			frontColor = (byte) *ptr++;
+			frontColor = *ptr++;
 			break;
 
 		case 6:
@@ -341,7 +334,7 @@
 		case 10:
 			// loc_12C93
 			str[0] = (char)255;
-			WRITE_LE_UINT16((uint16*)(str+1), ptr - _vm->_game->_totTextData->dataPtr);
+			WRITE_LE_UINT16((uint16*)(str+1), ((char *) ptr) - _vm->_game->_totTextData->dataPtr);
 			str[3] = 0;
 			ptr++;
 			i = *ptr++;

Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp	2007-03-04 15:09:45 UTC (rev 25976)
+++ scummvm/trunk/engines/gob/game_v2.cpp	2007-03-04 15:34:58 UTC (rev 25977)
@@ -74,11 +74,6 @@
 		while (!_vm->_quitRequested) {
 			if (_vm->_global->_inter_variables != 0)
 				_vm->_draw->animateCursor(4);
-			if (_vm->_platform == Common::kPlatformMacintosh) {
-				if (_vm->_adlib)
-					_vm->_adlib->stopPlay();
-			} else
-				_vm->_cdrom->stopPlaying();
 
 			if (skipPlay != -1) {
 				_vm->_inter->initControlVars(1);

Modified: scummvm/trunk/engines/gob/init_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/init_v2.cpp	2007-03-04 15:09:45 UTC (rev 25976)
+++ scummvm/trunk/engines/gob/init_v2.cpp	2007-03-04 15:34:58 UTC (rev 25977)
@@ -53,8 +53,13 @@
 	_vm->_global->_sprAllocated = 0;
 	_vm->_gtimer->enableTimer();
 
-	if ((_vm->_global->_videoMode == 0x13) || (_vm->_global->_videoMode == 0x14))
-		_vm->_global->_colorCount = 256;
+	if ((_vm->_platform == Common::kPlatformPC) || (_vm->_platform == Common::kPlatformMacintosh)) {
+		if ((_vm->_global->_videoMode == 0x13) || (_vm->_global->_videoMode == 0x14))
+			_vm->_global->_colorCount = 256;
+		else
+			_vm->_global->_colorCount = 16;
+	} else
+		_vm->_global->_colorCount = 16;
 
 	_vm->_global->_pPaletteDesc = &_vm->_global->_paletteStruct;
 	_vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette;

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2007-03-04 15:09:45 UTC (rev 25976)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2007-03-04 15:34:58 UTC (rev 25977)
@@ -1545,7 +1545,6 @@
 	repCount = _vm->_parse->parseValExpr();
 	frequency = _vm->_parse->parseValExpr();
 
-	warning("playSound(%d, %d, %d)", index, repCount, frequency);
 	_soundEndTimeKey = 0;
 	if (_vm->_game->_soundSamples[index] == 0)
 		return false;
@@ -1715,56 +1714,55 @@
 
 	switch (cmd & 0x7f) {
 	case 48:
-		if ((_vm->_global->_videoMode < 0x32) || (_vm->_global->_videoMode > 0x63)) {
+		if ((_vm->_global->_fakeVideoMode < 0x32) || (_vm->_global->_fakeVideoMode > 0x63)) {
 			_vm->_global->_inter_execPtr += 48;
 			return false;
 		}
 		break;
 
 	case 49:
-		if ((_vm->_global->_videoMode != 5) && (_vm->_global->_videoMode != 7)) {
+		if ((_vm->_global->_fakeVideoMode != 5) && (_vm->_global->_fakeVideoMode != 7)) {
 			_vm->_global->_inter_execPtr += 18;
 			return false;
 		}
 		break;
 
 	case 50:
-		if ((_vm->_global->_videoMode != 0x0D) || (_vm->_global->_colorCount == 256)) {
+		if (_vm->_global->_colorCount == 256) {
 			_vm->_global->_inter_execPtr += 16;
 			return false;
 		}
 		break;
 
 	case 51:
-		if (_vm->_global->_videoMode < 0x64) {
+		if (_vm->_global->_fakeVideoMode < 0x64) {
 			_vm->_global->_inter_execPtr += 2;
 			return false;
 		}
 		break;
 
 	case 52:
-		if ((_vm->_platform == Common::kPlatformPC) &&
-				((_vm->_global->_videoMode != 0x0D) || (_vm->_global->_colorCount == 256))) {
+		if (_vm->_global->_colorCount == 256) {
 			_vm->_global->_inter_execPtr += 48;
 			return false;
 		}
 		break;
 
 	case 53:
-		if (_vm->_global->_videoMode < 0x13) {
+		if (_vm->_global->_colorCount != 256) {
 			_vm->_global->_inter_execPtr += 2;
 			return false;
 		}
 		break;
 
 	case 54:
-		if (_vm->_global->_videoMode < 0x13) {
+		if (_vm->_global->_fakeVideoMode < 0x13) {
 			return false;
 		}
 		break;
 
 	case 61:
-		if (_vm->_global->_videoMode < 0x13) {
+		if (_vm->_global->_fakeVideoMode < 0x13) {
 			*_vm->_global->_inter_execPtr += 4;
 			return false;
 		}
@@ -1832,8 +1830,6 @@
 			_vm->_draw->_vgaPalette[i].green = _vm->_global->_inter_execPtr[1];
 			_vm->_draw->_vgaPalette[i].blue = _vm->_global->_inter_execPtr[2];
 		}
-		if ((_vm->_platform == Common::kPlatformPC) && _vm->_global->_videoMode >= 0x13)
-			return false;
 		break;
 
 	case 53:

Modified: scummvm/trunk/engines/gob/mult_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult_v2.cpp	2007-03-04 15:09:45 UTC (rev 25976)
+++ scummvm/trunk/engines/gob/mult_v2.cpp	2007-03-04 15:34:58 UTC (rev 25977)
@@ -410,7 +410,6 @@
 		_palFadingBlue = 0;
 
 		_oldPalette = _vm->_global->_pPaletteDesc->vgaPal;
-//		memcpy((char *)_palAnimPalette, (char *)_vm->_global->_pPaletteDesc->vgaPal, 768);
 
 		if (_vm->_anim->_animSurf == 0) {
 			_vm->_util->setFrameRate(_multData->frameRate);
@@ -694,9 +693,6 @@
 		stop = 0;
 		_doPalSubst = 0;
 		_vm->_global->_pPaletteDesc->vgaPal = _oldPalette;
-
-		memcpy((char *)_palAnimPalette, (char *)_vm->_global->_pPaletteDesc->vgaPal, 768);
-
 		_vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
 	} else {
 		stop = 0;
@@ -708,6 +704,7 @@
 		_multData->palAnimIndices[2] = 0;
 		_multData->palAnimIndices[3] = 0;
 
+		memcpy((char *)_palAnimPalette, (char *)_vm->_global->_pPaletteDesc->vgaPal, 768);
 		_vm->_global->_pPaletteDesc->vgaPal = _palAnimPalette;
 	}
 	return stop;


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