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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Thu Jul 26 05:17:54 CEST 2007


Revision: 28208
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28208&view=rev
Author:   drmccoy
Date:     2007-07-25 20:17:54 -0700 (Wed, 25 Jul 2007)

Log Message:
-----------
Corrected Woodruff's hotspot text positions.

Modified Paths:
--------------
    scummvm/trunk/engines/gob/draw.h
    scummvm/trunk/engines/gob/draw_v2.cpp
    scummvm/trunk/engines/gob/game_v2.cpp
    scummvm/trunk/engines/gob/inter_v1.cpp

Modified: scummvm/trunk/engines/gob/draw.h
===================================================================
--- scummvm/trunk/engines/gob/draw.h	2007-07-26 01:01:00 UTC (rev 28207)
+++ scummvm/trunk/engines/gob/draw.h	2007-07-26 03:17:54 UTC (rev 28208)
@@ -32,13 +32,15 @@
 
 #define SPRITES_COUNT 50
 
-#define RENDERFLAG_NOINVALIDATE      0x001
-#define RENDERFLAG_CAPTUREPUSH       0x002
-#define RENDERFLAG_COLLISIONS        0x004
-#define RENDERFLAG_CAPTUREPOP        0x008
-#define RENDERFLAG_USEDELTAS         0x010
-#define RENDERFLAG_NOBLITINVALIDATED 0x200
-#define RENDERFLAG_SKIPOPTIONALTEXT  0x400
+#define RENDERFLAG_NOINVALIDATE      0x0001
+#define RENDERFLAG_CAPTUREPUSH       0x0002
+#define RENDERFLAG_COLLISIONS        0x0004
+#define RENDERFLAG_CAPTUREPOP        0x0008
+#define RENDERFLAG_USEDELTAS         0x0010
+#define RENDERFLAG_NOBLITINVALIDATED 0x0200
+#define RENDERFLAG_SKIPOPTIONALTEXT  0x0400
+#define RENDERFLAG_FROMSPLIT         0x0800
+#define RENDERFLAG_DOUBLECOORDS      0x1000
 
 class Draw {
 public:

Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp	2007-07-26 01:01:00 UTC (rev 28207)
+++ scummvm/trunk/engines/gob/draw_v2.cpp	2007-07-26 03:17:54 UTC (rev 28208)
@@ -197,7 +197,12 @@
 	int16 rectLeft, rectTop, rectRight, rectBottom;
 	int16 size;
 
-	if (!_vm->_game->_totTextData || !_vm->_game->_totTextData->dataPtr)
+	id &= 0xFFF;
+
+	if (!_vm->_game->_totTextData || !_vm->_game->_totTextData->dataPtr ||
+	    (id >= _vm->_game->_totTextData->itemsCount) ||
+		  (_vm->_game->_totTextData->items[id].offset == -1) ||
+			(_vm->_game->_totTextData->items[id].size == 0))
 		return;
 
 	_vm->validateLanguage();
@@ -210,10 +215,34 @@
 	if ((_renderFlags & RENDERFLAG_SKIPOPTIONALTEXT) && (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);
+	if (_renderFlags & RENDERFLAG_DOUBLECOORDS) {
+		destX = (READ_LE_UINT16(ptr) & 0x7FFF) * 2;
+		spriteRight = READ_LE_UINT16(ptr + 4) * 2 + 1;
+	} else {
+		destX = READ_LE_UINT16(ptr) & 0x7FFF;
+		spriteRight = READ_LE_UINT16(ptr + 4);
+	}
+
+	if (_renderFlags & RENDERFLAG_FROMSPLIT) {
+		destY = _vm->_video->_splitHeight1;
+		spriteBottom = READ_LE_UINT16(ptr + 6) - READ_LE_UINT16(ptr + 2);
+		if (_renderFlags & RENDERFLAG_DOUBLECOORDS)
+			spriteBottom *= 3;
+		spriteBottom += _vm->_video->_splitHeight1;
+		if (_renderFlags & RENDERFLAG_DOUBLECOORDS) {
+			spriteBottom += _backDeltaX;
+			destY += _backDeltaX;
+		}
+	} else {
+		if (_renderFlags & RENDERFLAG_DOUBLECOORDS) {
+			destY = READ_LE_UINT16(ptr + 2) * 2;
+			spriteBottom = READ_LE_UINT16(ptr + 6) * 2;
+		} else {
+			destY = READ_LE_UINT16(ptr + 2);
+			spriteBottom = READ_LE_UINT16(ptr + 6);
+		}
+	}
+
 	ptr += 8;
 
 	if (_renderFlags & RENDERFLAG_CAPTUREPUSH) {

Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp	2007-07-26 01:01:00 UTC (rev 28207)
+++ scummvm/trunk/engines/gob/game_v2.cpp	2007-07-26 03:17:54 UTC (rev 28208)
@@ -151,7 +151,7 @@
 				if (_totTextData->dataPtr != 0) {
 					Common::MemoryReadStream totTextData(_totTextData->dataPtr,
 							4294967295U);
-					_totTextData->itemsCount = MIN<int32>(totTextData.readSint16LE(), (size - 2) / 4);
+					_totTextData->itemsCount = totTextData.readSint16LE() & 0x3FFF;
 
 					_totTextData->items = new TotTextItem[_totTextData->itemsCount];
 					for (int i = 0; i < _totTextData->itemsCount; ++i) {

Modified: scummvm/trunk/engines/gob/inter_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v1.cpp	2007-07-26 01:01:00 UTC (rev 28207)
+++ scummvm/trunk/engines/gob/inter_v1.cpp	2007-07-26 03:17:54 UTC (rev 28208)
@@ -1908,6 +1908,15 @@
 	if (!_vm->_draw->_spritesArray[_vm->_draw->_destSurface])
 		return false;
 
+	if (_vm->_draw->_spriteRight < 0) {
+		_vm->_draw->_destSpriteX += _vm->_draw->_spriteRight - 1;
+		_vm->_draw->_spriteRight = -_vm->_draw->_spriteRight + 2;
+	}
+	if (_vm->_draw->_spriteBottom < 0) {
+		_vm->_draw->_destSpriteY += _vm->_draw->_spriteBottom - 1;
+		_vm->_draw->_spriteBottom = -_vm->_draw->_spriteBottom + 2;
+	}
+
 	_vm->_draw->spriteOperation(DRAW_FILLRECT);
 	return false;
 }


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