Commit Graph
192 Commits
Author SHA1 Message Date
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
Torbjörn Andersson 82cde1fa05 SCUMM: For now, remap font 1 to font 0 in Indy 3 Mac
It's tempting to think that font 1 is supposed to be a bold version of
font 0, but that donsn't match the screenshots I've seen.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson 0ffe2ada11 SCUMM: Allow more than one Mac font
Indiana Jones and the Last Crusade uses two fonts, thoug at the moment
it uses the wrong font during the intro. I'm not sure why.
2021-06-30 14:59:55 +02:00
Eugene Sandulenko 44fbf427ef SCUMM: Added support for Japanese Mac Dig 2021-06-11 12:31:32 +02:00
Torbjörn Andersson f8c4fe63e3 SCUMM: Hack Mac Loom note names to never be light gray
Note names can be drawn in three different colors: Dark gray for notes
you don't know, light gray for notes you know, and white for notes
you're using.

Or at least, that's how the DOS version does it. But there, notes
automatically go back to light gray once the draft is done. In the Mac
version, that doesn't seem to happen. And judging by how it behaves when
running it in a Mac emulator, known notes are always white.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson c0c072f4c4 SCUMM: Add hack against Mac Loom distaff glitch
Here is what I think happens: When text is removed, the text surface is
cleared in its entirety. This means that the next time the screen is
updated, it may redraw the low-resolution background. Since this has no
information about the high-resolution text, any such text is lost.

The distaff notes and note names are drawn in with the high-resolution
font. When using the distaff, only the note name is redrawn, not the
note itself. The way screen updates are handled, a larger area than just
the note name gets redrawn, and then part of the note may be cleared
away.

To get around this, when a note name is drawn on the distaff the text
surface is also updated with the note itself. (There is no need to
redraw the note, since we can assume it's already on screen, and we
don't want to bother with getting the color right.)

The only time the printChar() function prints note names should be on
the distaff. The Practice Mode box is handled by drawChar() instead.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson cdfe9b5b4c SCUMM: Add practice mode box for Mac Loom
Unlike the PC version, the practice mode box appears to be hard-coded in
the Mac version. The script that draws the box in the PC version just
sets variables in the Mac version. This implementation is based on
screenshots.

To keep things a bit saner, I've split out the Mac-specific drawing to
its own file.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson 620d885eac SCUMM: Clarify comment about shadowed text in Mac Loom 2021-05-17 18:44:29 +02:00
Torbjörn Andersson 9051349f31 SCUMM: Always draw notes and note names with a shadow in Mac Loom
But apparently the shadow for notes is a bit different from what I draw.
I have to figure that one out later.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson 3ef517d2a1 SCUMM: Fix some memory leaks
I forgot to free the streams after asking the Mac resource manager for a
resource.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson 93cbb988a6 SCUMM: Some fixes that I'm not sure exactly what they do
I don't know what these fixes do exactly, but judging by the old code
they should be there.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson 5c0c64bc5a SCUMM: Fixed black screen after loading savegame.
I misunderstood the purpose of _textSurface. Now text is drawn to the
Mac screen, and a text mask is drawn to the _textSurface. I hope that's
better.

Still no luck with the non-disappearing text at the start of the game
though.
2021-05-17 18:44:29 +02:00