[Scummvm-cvs-logs] SF.net SVN: scummvm: [22039] scummvm/trunk/engines/simon/charset.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Wed Apr 19 13:29:40 CEST 2006


Revision: 22039
Author:   eriktorbjorn
Date:     2006-04-19 13:04:53 -0700 (Wed, 19 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22039&view=rev

Log Message:
-----------
Fix text corruption with long FF conversation options. The renderString()
function has to adjust the buffer offsets, or a long string can spill over into
the next buffer. (Or, in the test case I used, into the next *two* buffers.)

It would probably be safe - but apparently unnecessary? - to make this change
for the Simon games as well.

Modified Paths:
--------------
    scummvm/trunk/engines/simon/charset.cpp
Modified: scummvm/trunk/engines/simon/charset.cpp
===================================================================
--- scummvm/trunk/engines/simon/charset.cpp	2006-04-19 18:14:28 UTC (rev 22038)
+++ scummvm/trunk/engines/simon/charset.cpp	2006-04-19 20:04:53 UTC (rev 22039)
@@ -207,6 +207,11 @@
 	if (getGameType() == GType_FF) {
 		WRITE_LE_UINT16(p + 4, height);
 		WRITE_LE_UINT16(p + 6, width);
+		// We need to adjust the offset to the next buffer to be right
+		// after this one. By default, each buffer is only 9000 bytes
+		// long. A two-line string can very well be more than twice
+		// that size!
+		WRITE_LE_UINT16(p + 8, READ_LE_UINT32(p) + width * height);
 	} else {
 		WRITE_BE_UINT16(p + 4, height);
 		WRITE_BE_UINT16(p + 6, width);


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