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.

svn-id: r22039
This commit is contained in:
Torbjörn Andersson 2006-04-19 20:04:53 +00:00
parent 70d23ccf29
commit 343dacdcf7

View File

@ -207,6 +207,11 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
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);