MI1VGA: Possible scroll arrow fix
|Reported by:||eriktorbjorn||Owned by:||fingolfin|
|Game:||Monkey Island 1|
I've taken a closer look at the second issue of bug #599442 ("MI1VGA: the last few glitches") -- the one with scroll arrows covering part of the text.
I've compared ScummVM to the original (that is, if you consider DOSBox to be a faithful rendition of the original), and the arrows are positioned correctly. The problem is that restoreVerbBG() thinks the arrows are wider than they really are, so it erases too much.
What this patch does is to make the charset renderer keep track of how wide the text it draws is (the arrows are being drawn as verb text, apparently) if you only consider the pixels that are actually painted. I originally intended to do the same for the text height but a) I couldn't get it to work properly for some reason, and b) it wasn't needed.
One possible reason I couldn't get it to work is that restoreBG() seems a bit dodgy. It has the lines
height = bottom - top; width = right - left;
which I take to mean that both height and width will be one too small. Well, width won't be since we already increase 'right' by one (with a FIXME comment), but what about height? On the other hand, even when "fixing" this I couldn't get it to work, so maybe I'm just mistaken.
My main concern about this patch is that it adds to a part of the code that already looks dangerously overloaded with strange variables. Maybe a cleaner solution would be to make restoreVerbBG() more clever, e.g. by drawing the verb string again, with the verb's background colour. But I couldn't see any easy way of doing that.
Ticket imported from: #643464. Ticket imported from: patches/242.