[Scummvm-cvs-logs] SF.net SVN: scummvm:[48053] scummvm/trunk/engines/gob
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Sat Feb 13 22:59:46 CET 2010
Revision: 48053
http://scummvm.svn.sourceforge.net/scummvm/?rev=48053&view=rev
Author: strangerke
Date: 2010-02-13 21:59:45 +0000 (Sat, 13 Feb 2010)
Log Message:
-----------
Fascination:
- Fix a potential bug in winDraw
- Add a hack (and a todo) to work around the missing texts and windows in Amiga, Atari and early PC floppy version.
Modified Paths:
--------------
scummvm/trunk/engines/gob/draw.cpp
scummvm/trunk/engines/gob/resources.cpp
Modified: scummvm/trunk/engines/gob/draw.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw.cpp 2010-02-13 17:46:44 UTC (rev 48052)
+++ scummvm/trunk/engines/gob/draw.cpp 2010-02-13 21:59:45 UTC (rev 48053)
@@ -974,7 +974,7 @@
case DRAW_LOADSPRITE: // 5 - Uncompress and load a sprite
// TODO: check the implementation, currently dirty cut and paste of DRAW_SPRITE code
- resource = _vm->_game->_resources->getResource((uint16) _spriteLeft,
+ resource = _vm->_game->_resources->getResource((_spriteLeft & 0x3FFF),
&_spriteRight, &_spriteBottom);
if (!resource) {
Modified: scummvm/trunk/engines/gob/resources.cpp
===================================================================
--- scummvm/trunk/engines/gob/resources.cpp 2010-02-13 17:46:44 UTC (rev 48052)
+++ scummvm/trunk/engines/gob/resources.cpp 2010-02-13 21:59:45 UTC (rev 48053)
@@ -277,6 +277,7 @@
_totResStart = totProps.scriptEnd;
_totSize = stream->size() - _totResStart;
+
if (_totSize <= 0)
return false;
@@ -571,8 +572,14 @@
if ((totItem.offset == 0xFFFF) || (totItem.size == 0))
return 0;
- if ((totItem.offset + totItem.size) > (_totTextTable->size))
- return 0;
+ if ((totItem.offset + totItem.size) > (_totTextTable->size)) {
+// HACK: Some Fascination versions (Amiga, Atari and first PC floppies) have a different header, which is a problem here.
+// TODO: Handle that in a proper way
+ if ((_vm->getGameType() == kGameTypeFascination) & (_totTextTable->size < 0))
+ warning("totTextTable with negative size id:%d offset:%d in file %s : (size: %d)", id, totItem.offset, totItem.size, _totFile.c_str(), _totTextTable->size);
+ else
+ return 0;
+ }
return new TextItem(_totTextTable->data + totItem.offset, totItem.size);
}
@@ -701,8 +708,10 @@
int32 offset = _totResourceTable->dataOffset + totItem.offset - _totResStart;
- if ((offset < 0) || (((uint32) (offset + totItem.size)) > _totSize))
+ if ((offset < 0) || (((uint32) (offset + totItem.size)) > _totSize)) {
+ warning("Skipping data id:%d offset:%d size :%d in file %s : out of _totTextTable", totItem.index, totItem.offset, totItem.size, _totFile.c_str());
return 0;
+ }
return _totData + offset;
}
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