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.
(Loom (VGA) - Graphical glitches where some text appears over previous line and the wood musical note disappear)
The glitch is caused by a workaround in ScummEngine::actorTalk(). Removing it will make the original bug (speech animations for empty text strings) reappear. I have located the code which prevents that in LOOM DOS EGA disasm and added that. The FM-Towns versions don't have such code, but I do not get that weird speech animations either. So it seems to be fixed in a different manner there...
The patch no longer works and actually causes slightly incorrect text display in COMI, because the strings in language.tab are not 100% identical with the resource strings.
- COMI adds a y-Offset of 2 in CJK mode.
- The shadowed glyphs are used for all CJK font drawing, not only Korean. Also, the char height has to be adjusted by one pixel for the shadow.
This is basically a hack, but the original does it just like that. It ensures that certain CJK message strings at the bottom of the screen won't get cut off.
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.
- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
After the initial changes just to scummvm/gui for u32, this commit includes the whole project
- Widget creations now always have u32 descriptions, labels, or tooltips
- Message dialogs make use of default arguments instead of providing the same argument explicitly
- encode String::format properly before passing on as argument where necessary
- Modify hugo utils (yesNoBox and notify box) to use u32
- Also provide fake constructors for the above which redirect to the u32 constructor
- Convert all keymap descriptions to u32 across all engines
- showConfirmationDialog in mohawk now uses u32
- showScummVMDialog also uses u32
- Scumm engine has dialogs now which use u32
- General fixes and wrapping convertToU32String for setLabels and related functions
- Add a fake constructor to MesssageDialog which redirects to the u32 constructor