Commit Graph
203 Commits
Author SHA1 Message Date
AndywinXp 81cee05840 SCUMM: Fix missable termination condition on strings parsing 2022-11-28 23:21:45 +01:00
Torbjörn Andersson bf0ecd47ff SCUMM: Implement message boxes for Mac Loom and Last Crusade
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.
2022-11-28 23:21:45 +01:00
athrxx 64a93af9ab SCUMM: fix bug no. 13935
("FT: buffer-overflow during ending credits")
2022-11-18 01:09:43 +01:00
sluicebox 2775987cba MACGUI: Expose font families in MacFontManager
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.
2022-11-06 23:05:20 -08:00
Le Philousophe 137b51d7ac SCUMM: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Donovan Watteau 0e81058cc7 SCUMM: Don't print unprintable chars in warnings and errors 2022-10-16 22:27:58 +03:00
athrxx 221f9c955f SCUMM: cleanup b4185bdf
Extend change to the versions to which it applies and update comment.
2022-08-15 23:11:54 +02:00
athrxx b4185bdf60 SCUMM: (LOOM/EGA) - fix bug 13763 (Inaccurate text position)
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).
2022-08-15 01:06:19 +02:00
athrxx 4248e22cbf SCUMM: (MI1/FM-TOWNS) - fix bug no. 13735
("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.
2022-08-03 17:03:25 +02:00
athrxx 33c2631290 SCUMM: (V2) - improve CGA and Hercules modes
Should be pixel-perfect now.
This change is only about SCUMM2 (ZAK/MM).
2022-07-15 15:40:16 +02:00
athrxx 97fbe867cb SCUMM: (MMv1/ZAKv1) - add support for CGA, CGA Composite and Hercules modes
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).
2022-07-10 01:04:38 +02:00
Eugene Sandulenko b49a5d8866 SCUMM: Fix clashing overridden methods 2022-05-29 17:22:47 +02:00
Orgad Shaneh 4034ab2335 SCUMM: Use true/false for bool member 2022-05-15 13:11:47 +03:00
Andrea Boscarino 47270487b6 SCUMM: Implement correct behavior for old style text overflow 2022-04-08 19:53:44 +02:00
Andrea Boscarino 5963241222 SCUMM: FT: Fix text bugs 2022-04-08 19:53:44 +02:00
athrxx dcae67025e SCUMM: fix build 2022-04-08 19:53:44 +02:00
athrxx 2e249f1d00 SCUMM: (SCUMM7/8) - reduce deprecated code
- remove version7/8 clauses from code parts that these versions no longer use
- also fix typo/bug (semicolon after if clause)
2022-04-08 19:53:44 +02:00
athrxx d9ca128863 SCUMM: (SCUMM7/8) - implement right alignment flag for text
The original has it, although it isn't used. It is not meant for right to left languages, it just right-aligns left-to-right texts. Since I'll only use it for Hebrew I have to upgrade it a bit...
2022-04-08 19:53:44 +02:00
athrxx f5f49d1b3f SCUMM: (SCUMM7/8) - improve ingame text wrapping and positioning for DIG and COMI
This fixes a couple of regressions (mostly camera related). For DIG it seems that the older version of the interpreter uses CharsetRenderClassic type text display while the newer version uses COMI style. I stick with the COMI style, but with the necessary tweeks to make it pixel perfect for all versions.

COMI (I've tested English and Chinese) seemed to be pixel perfect without having to do much, same for DIG Chinese (new interpreter version). Even the verbs seem to be fine, although I haven't changed anything there yet (applies to COMI only afaik, I think DIG doesn't have text verbs).

DIG English (old interpreter version) is another matter. That one wraps text quite differently. Our version looked quite different from the original. But now it also seems to be fine. I even fixed a weirdo problem with the character width (It seems that the fonts have some kerning data; if we use that like we did the 'a' character gets displayed too narrow by 1 pixel. So all lines containing 'a' characters were slightly off). I have examined several strings in several camera settings for pixel perfect drawing in DIG and all seems good now...

FT: I'll do that separately. I haven't even checked if it needs any fixing. Maybe it is fine already. But it sure would be nice to get rid of any redundancies...
2022-04-08 19:53:44 +02:00
athrxx 0256e92c25 SCUMM: (SCUMM7/8) - reorganize font rendering - second part
- 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.
2022-04-08 19:53:44 +02:00
athrxx 1f56132725 SCUMM: (SCUMM7/8) - reorganize font rendering - first part
(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...
2022-04-08 19:53:44 +02:00
athrxx 7fe7b30459 SCUMM: (SCUMM5/FM-Towns) - minor cleanup 2022-04-08 19:53:44 +02:00
Andrea Boscarino 51394cc7bb SCUMM: COMI: Clean up code and separate SCUMM v7-8 code from v6 2022-04-08 19:53:44 +02:00
Andrea Boscarino 359a9718e7 SCUMM: COMI: Fix string wrapping when wrap flag is active 2022-04-08 19:53:44 +02:00
Torbjörn Andersson b66e84d57a SCUMM: Change "Use correct font spacing" to a game-specific enhancement
It doesn't make much sense to keep this as a separate option, when
fixing the font spacing is an enhancement specifically for the Mac
version of Indiana Jones and the Last Crusade.
2022-03-23 15:23:10 +01:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh ed5489929c SCUMM: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
trembyle 6e1135ee8a ENGINES: Revise language constants to ISO standards
* Use ISO-3166 country codes and ISO-639 language codes
2021-11-11 12:06:15 +01:00
Alexandre Detiste 6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
Torbjörn Andersson 63a83d7eaa SCUMM: Warn on unhandled escape sequences in Mac font renderer
This should, of course, never happen.
2021-10-19 19:24:31 +02:00
Torbjörn Andersson 11bf8833df SCUMM: Add setting for correct font spacing in Indy 3 Mac
For all the purists out there (I know there is at least one), the
default behavior is to try and emulate the original's slightly broken
font spacing. Even though I prefer correct spacing myself.
2021-10-19 19:24:31 +02:00
Torbjörn Andersson a67958a71f SCUMM: Implement the incorrect character spacing used in Indy 3 Mac
This is more guesswork, but seems to match the original for where I've
tried it. Next step is to implement an option to use the correct spacing
instead since it arguably looks better.
2021-10-19 19:24:31 +02:00
Torbjörn Andersson e81a016699 SCUMM: Move COMI getStringWidth() to CharsetRendererNut
As far as I know, that's the only game that uses the Nut charset
renderer.
2021-10-19 19:24:31 +02:00
Torbjörn Andersson c3ce996275 SCUMM: Add braces to empty loop
It's mandatory in our code formatting conventions.
2021-10-19 19:24:31 +02:00
Torbjörn Andersson 4cf42c6dac SCUMM: Center text better in Mac Loom (bug #12984)
Measure the whole string before dividing the length by 2 to get the
low-res width of the string. Before, each character width was divided
which led to rounding errors. The result is better, but not pixel
perfect. I'm not sure what I'm still getting wrong.
2021-10-19 19:24:31 +02:00
Torbjörn Andersson c2354dc862 SCUMM: Position text better in Indy 3 Mac (bug #12983)
The text positioning seemed to be correct in all cases I checked (which
admittedly weren't all of them). The original spaces characters
differently, but I would say that the original does it wrong. I typed
the same text in ResEdit, and it came out the way ScummVM draws it.

I see no reason for being that bug compatible with the original.
2021-10-13 08:16:08 +02:00
Torbjörn Andersson d3de644b62 SCUMM: Space lines in Indy 3 text boxes like the original (bug #12983)
I didn't think anyone would notice that the lines of the Indy 3 text
boxes were spaced slightly differently in ScummVM than in the original.
I realized it wouldn't be as tricky as first thought to fix that, though
I may clean it up a bit later.

This fixes a tiny part of bug #12983.
2021-10-12 20:14:08 +02:00
athrxx bfd8c8ed8c SCUMM: whitespace 2021-08-16 18:29:47 +02:00
athrxx f35b1f1125 SCUMM: (COMI) - add comment and some cleanup
- removed obsolete (and incorrectly implemented) COMI Chinese handling
- some preparations to make it easier if we would want to get rid of SmushFont::getStringWidth() in favour of this
2021-08-16 18:23:09 +02:00
Andrea Boscarino 5dfe57d230 SCUMM: COMI: Attempt at a proper fix to getStringWidth 2021-08-16 17:46:09 +02:00
Torbjörn Andersson d73bb1c87e SCUMM: Implement shaded text in Macintosh b/w mode
I just need to test Loom a bit more. Indy 3 should be pretty safe, since
most of the text is printed in text boxes, which never use shaded text.
2021-07-13 09:53:36 +02:00
Torbjörn Andersson 71581fdff4 SCUMM: Make text either white or black in Macintosh b/w mode
I still need to add code for drawing disabled text for the Loom notes
and Indy 3 verbs.
2021-07-13 09:53:36 +02:00
Torbjörn Andersson e275b07e00 SCUMM: Fix thinko in CharsetRendererMac::getFontHeight()
It should only return the actual font height for Indy 3's font 1, and
even there it's not actually needed at the moment. I'm guessing this
error is why I saw some text rendering errors in Mac Loom, where lines
of text were spaced too far apart. Though strangely, I never managed to
reproduce it.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson aac9b8296d SCUMM: Remove font 1 warning. It has served its purpose.
My conclusion is that font 0 and font 1 are the same font in the Mac
version. In the DOS version, font 1 is a bolder font.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson 50259adc4f SCUMM: Fix shadowed text in Indy 3 Mac 2021-06-30 14:59:55 +02:00
Torbjörn Andersson 8f216fe7b8 SCUMM: Fiddle with font height in Indy 3 Mac
It's still not pixel perfect, but I think it looks fine for now.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson 52fbee9ec7 SCUMM: Fix removing of the text box
That takes care of most of the remaining glitches, at least in the early
game.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson cfe270c8af SCUMM: Render the Indy 3 Mac text box to a separate surface.
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.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson 9d2d6b60c8 SCUMM: Some more work on the Indy 3 Mac text box.
I'm starting to reconsider the exact way I'm doing this, so this is a
good place to commit what's there, before tearing it up.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson 319492e83a SCUMM: Add function for drawing Indy 3 Mac text box
Well, the border and title at least. I still need to get the text to be
drawn inside, and remove the box once it's done.
2021-06-30 14:59:55 +02:00