fakeBidiString accepts an argument named ignoreVerb. When it is set, we do
not reverse the current section at this point (only these 2 characters are
swapped, so that they'll be swapped back when reversing everything at once
afterwards).
But the condition above covers also end of string *current == 0 along with
the control characters, so on this case, the function still looked for the
newline character past the string buffer. On some cases, a previous string
that was written on the same buffer (the buffer is reused for every string
in the engine), can have newline exactly at this point, and we applied the
same logic, and swapped the newline with 0, which eventually resulted with
some garbled text from the previous buffer.
Fix by excluding end of buffer for this condition.
For example: 07 FF 07 21 00
The first 07 is the skull, then ff 07 21 appends the verb referenced in
variable 33. If this verb contains control characters, the result is
something like "07 FF 0A 0F 29 ... Some text".
Now, the bidi algorithm *doesn't* skip all the initial control characters
(they are skipped later in the loop), and it only reverses the text, but
the 07 remains in the beginning. The result is 07 FF 0A 0F 29 ... txet emoS
Use a similar technique like was done for INDY4 - Skip the initial 07
character, then append it in the end, and replace the original one with a
space. This gives 32 FF 0A 0F 29 ... txet emoS 07.
In some versions of Sam & Max, such as the French and German releases,
talking to Evelyn Morrison while wearing the bigfoot costume will
attach some lines to Max even though Sam's voice is used there.
The floppy intro uses different actors for Sam and Max themselves. There
is no need to slow down Sam's animation while Max beats up the
scientist, and the timing adjustments had to be re-done. The rest of the
workarounds from the CD version still apply.
- Attach actor talk texts to the appropriate text renderer and get rid of redundant code.
- Cleanup subtitle text handling.
- Fix handling of ^codes.
- Fix more regressions from last commit.
- Correct some x/y positioning.
(inspired by PR 3276 - this here has the desired effect, but actually allows the removal of hacks, workarounds and redundancy code instead of adding more of that sort)
The purpose is to have the same accurate font rendering that we already have in the Smush code also for the ingame texts. The original interpreters draw the text like that, so this is not a weirdo invention of mine.
This is still broken. The main purpose was to get as much code done as necessary to have it at least compile again and correctly run the Smush texts.
The rest still needs quite some work...
I experienced weird string modifications while trying to improve the text code. Turns out that this workaround will kick in even for 0 length strings and will lead to values being written to "negative" (before the original dst ptr argument) offsets.
This is just a small hack to address bug no. 12796 ("SCUMM: COMI: Object label line printed on the wrong spot"). It tries to apply the correct fix that we already have in SmushFont::drawStringWrap() to "normal" (non-Smush) blast strings.
In Monkey Island 2, after Rapp gives you his map piece it calls
script-109 to print a message about which map piece you just found.
But as soon as that message is displayed, it's erased by printing a
single space.
This wouldn't normally be much of a problem, but apparently in the
"ultimate talkie" version you will still hear the spoken line. This is
my attempt at bypassing the erasing.
I don't dare to patch the script itself, because I'm guessing all the
messages are hard-coded so it would have to recognize every
localization. Instead, it checks if a single space is printed from the
appropriate script, while there is a message pending and you are
carrying Rapp's map piece. I hope that's specific enough.
The text positions for the books in Indy 3 Mac only need to be adjusted
when using the low-resolution font. When using the Mac font, it works as
intended without changes.
The text rendering isn't pixel perfect compared to the original, but I
actually think ScummVM looks better. Maybe the original draws one
character at a time without compensating for when the character width
isn't even? That might account for text being slightly wider in the
original.
There's still the matter of exactly when the text box should be created
(sometimes text is drawn to it in several steps, and we don't want to
erase the old text), and when/how to remove the box.
Instead of trying to keep track of the real Mac screen coordinates in
the _charset data type, use the original 320x200 coordinates and only
scale up at the time of rendering.
Either way, the output is not pixel perfect, and this is much less error
prone.
Now if only text removal worked correctly...
The main purpose of this set of changes is to refactor the code to make
it easier to pass the name of the Macintosh resource file to other parts
of the engine (it used to be hard-coded in the music players), and to
scale-up the graphics by 2.
The actual font rendering is almost completely broken.