I don't know if this can happen with savegames from any released version
of ScummVM, or if it's just my savegames while working on the Mac GUI.
But let's err on the side of caution and remap bad font IDs to the
sensible default font.
This is the first, and so far only, widget that doesn't correspond
directly to a single dialog item. Instead, it combines two picture
widgets (which are made invisible to keep them out of the way), neatly
solving my problem with keeping track of the background under the slider
handle.
Also rewrote the Mac dialog event loop for better accuracy (it is now
possible to click and hold down the mouse over a widget, move the mouse
out of it, and then move it back it again), and - hopefully - improved
flexibility.
Plus some other minor cleanups along the way.
My goal right now is to move all font drawing that isn't explicitly
handled by scripts into the Mac GUI. The Indy 3 speech boxes will
probably be moved into the Mac GUI as well, since they're a bit special.
This means the charset class will only have to keep track of the game
font, which will remove some odd special cases.
These include:
- Stray "-" characters (actually, "_") in dialogues
- Graphical glitches when scrolling dialog choices horizontally
With this commit we finally close issue #10447
My intuition for MI1 Jap was correct, but the code had to be moved elsewhere.
This as a bonus finally yields pixel perfect positioning for text for INDY4 as well.
This is still just a mock-up, and a bad one at that. It will all be for
nought unless I can figure out how to wire up these buttons to the SCUMM
verbs.
...this was painful to research. Check the comment on string.cpp for a detailed
explaination on how text centering supposedly works on this particular version.
This fixes the biggest issue of #10447, but there are still things left to do about it.
This gives the JAP text a black background, like the original, and corrects the
line spacing when string wrapping occurs. The only thing remaining should be
fixing the string wrapping method, which seems to be different from the v5 one.
I'm committing this as is, while leaving final integration to someone
else. Note that this doesn't really replicate the original Mac GUI (e.g.
the quit dialog is nothing like the original), but at least the pause
dialog looks right. And that's what matters to me.
MacFontManager didn't have a mechanism to report which fonts it loaded
from an external resource. It also requires that any fonts that aren't
built-in be explicitly registered by name by the client before they can
be used. This combination meant that a client couldn't load fonts from
an external file and use them by their properties (id / size / style).
SCI contains Mac fonts in its executable along with a table that maps
each SCI font id to a Mac font id and size. The font name isn't a part
of this since the Classic Mac Toolbox API took id / size / style as
input when drawing text.
Now MacFontManager exposes the font families it has loaded along with
their names. This allows a client to see which fonts were loaded,
register them by name, and proceed to use them with the existing API.
I am going to clean this up a bit after confirming the behavior of the other v1-3 games. I bet that it it is the same thing (only that it probably doesn't matter, due to the text display being restricted to the top of the screen and the verb screen).
("Inaccurate verb rendering in Monkey 1 FM-TOWNS)"
Actually, this is rather an emulation of an original bug than a fix...
I have also included a fix in the charset renderer that I noticed, but I don't think that one actually matters anywhere.
I haven't added a fix for exisiting saves. It would require another version bump and it is really not important enough.
This does not improve anything about these modes for v2 and v3, except:
- brighter CGA colors
- v2 will also get the more accurate Hercules mouse cursor
I will do improve v2/v3 as separate tasks. v3 seems to be mostly fine, anyway, except for the actors (we dither them just like the backgrounds, but that looks different in DOSBox).