From 312e49b6eb987ebdce03439dea7a370406e101aa Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 21 Apr 2006 10:47:43 +0000 Subject: Adjust buffer sizes for conversation options, even for sprite id 1. This doesn't seem to match the original, but there are cases where even the first string is long enough to cause text corruption. For whatever reason, I have not been able to reproduce this text corruption with the original interpreter, though, so maybe we're missing some detail. Or maybe the original interpreter just gets lucky. svn-id: r22070 --- engines/simon/charset.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engines/simon/charset.cpp b/engines/simon/charset.cpp index 6f7b8e1c7e..51545c56d4 100644 --- a/engines/simon/charset.cpp +++ b/engines/simon/charset.cpp @@ -211,8 +211,14 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint // 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! - if (vga_sprite_id != 1) - WRITE_LE_UINT16(p + 8, READ_LE_UINT32(p) + width * height); + // + // The original seems to make an exception for sprite id 1, but + // even the first conversation option can be a long line. For + // some reason, I cannot reproduce the text corruption with the + // original interpreter, though, so maybe we're missing some + // detail here. Let's hope it's safe to always adjust the + // buffer size anyway. + WRITE_LE_UINT16(p + 8, READ_LE_UINT32(p) + width * height); } else { WRITE_BE_UINT16(p + 4, height); WRITE_BE_UINT16(p + 6, width); -- cgit v1.2.3