Commit graph

89 commits

Author SHA1 Message Date
Filippos Karapetis
f1d7176954 SCUMM: Initialize class members 2024-11-16 18:56:32 +02:00
athrxx
6857eb56ba SCUMM: (LOOM/EGA/AMIGA) - add missing shadow mode
(bug no. 15030)

I have verified that neither the FM-Towns versions nor
INDY3 VGA have that mode. I don't know about Indy 3 EGA
(I presume not, but it would be worth checking).

I have verified (as can be seen in the ticket) that the original
seems to glitch on that new shadow mode in varying ways.
I haven't found the cause of it yet (current state of guessing:
glitchy text mask). And I am not sure if we need to replicate
the glitch, anyway...
2024-03-20 23:26:09 +01:00
athrxx
0baa6b593a SCUMM: coverity fixes 2024-01-30 00:35:45 +01:00
Le Philousophe
17f09bb48c SCUMM: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Torbjörn Andersson
26b5c50195 SCUMM: Clean up Mac GUI things, and plug a few memory leaks
I've also added hard-coded button corners for the smaller buttons. It's
still a hack, but a useful one.
2023-11-18 18:47:39 +01:00
Torbjörn Andersson
5f51200454 SCUMM: Move Indy 3 Mac text box drawing into MacIndy3Gui 2023-11-18 18:47:39 +01:00
Torbjörn Andersson
3a7593a8c7 SCUMM: Mac GUI restructuring
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.
2023-11-18 18:47:39 +01:00
AndywinXp
c128cf9848 SCUMM: INDY4 (DOS/Mac Jap): Implement accurate Jap horizontal font kerning
As usual, taken from disasm. There is also vertical kerning to be
considered, but I will tackle that at a later date.
2023-11-10 18:42:38 +01:00
AndywinXp
4e081dde81 SCUMM: INDY4 (DOS/V): Fix crashes related to charset rendering
The text is still not accurate, but at least it doesn't crash...
2023-11-08 00:21:32 +01:00
Torbjörn Andersson
c6d1a256ef SCUMM: Moved Mac Indy 3 GUI into its own class
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.
2023-10-16 17:40:29 +02:00
Torbjörn Andersson
1d154df781 SCUMM: Use Geneva for Indy 3 Mac GUI
Font rendering is broken at the moment. I have to figure out if it's a
problem with my code, or with the Mac Font class.
2023-10-16 17:40:29 +02:00
Torbjörn Andersson
70d15976fe SCUMM: Convert CharsetRendererMac to use MacFontManager
This will make it much easier to use the system fonts with bold and/or
outline, which Last Crusade will need.
2023-10-16 17:40:29 +02:00
Vladimir Serbinenko
95bddb7e5b SCUMM: Add negative spacing for Japanese mac atlantis
This is like what the original does
2023-05-10 13:18:20 +02:00
Vladimir Serbinenko
61c9683c70 SCUMM: Rename bytesPerPixel to bitsPerPixel in font
Its values make no sense for bytes per pixel but do for bits per pixel
The actual code is unchanged, it's a pure rename
2023-05-10 13:18:20 +02: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
Eugene Sandulenko
b49a5d8866
SCUMM: Fix clashing overridden methods 2022-05-29 17:22:47 +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
37e58e8420 SCUMM: (SCUMM7/8) - minor fix to string escape code handling
(the old values do not get restored)
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
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
trembyle
c740f96f63 COMMON: Normalize and document language maintenance
* Add documentation to add or maintain language values
* Fix and reorder existing entries to match ISO standards
2021-11-11 12:06:15 +01:00
Eugene Sandulenko
c9cf81874a
SCUMM: Added override keywords 2021-10-19 21:10:19 +03: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
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
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
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
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
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
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
85ba3876e4 SCUMM: Fix Mac text rendering.
The font renderer now remembers if the previous character ended on an
odd X coordinate, and compensates for that when calculating the next
character's position.

Maybe there's a more elegant way to do it, but it will do for now. The
rendering appears identical to the original, at least for the test case
I'm using.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
27420f78d4 SCUMM: Simplified Mac font rendering
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...
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
5b70ddd802 SCUMM: Fix text color and shadow
Text positioning is still all over the place, though.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
fbefa65da9 SCUMM: Mark screen as dirty in the Mac font renderer
The difficulty buttons are now drawn almost correctly, even if little
else is. (The text position appears to be slightly wrong.)
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
819cfb8383 SCUMM: Initial work on Mac Loom font renderer
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.
2021-05-17 18:44:29 +02:00
wonst719
4246929148 SCUMM: Move CharsetRenderer::isScummvmKorTarget() to ScummEngine 2020-11-08 13:34:44 +09:00
Eugene Sandulenko
100688c225 SCUMM: Moved out Korean-specific code into separate methods 2020-11-06 19:53:05 +01:00
wonst719
145617ce69 SCUMM: Hacks for alternative Korean line-break 2020-11-06 19:35:34 +01:00
wonst719
345771f574 SCUMM: Add multi-font support for Korean fan translated games 2020-11-06 19:29:47 +01:00
athrxx
afef3d71cb SCUMM: (DIG/CJK) - fix blast text rendering and positioning
- fix getStringWidth()
- fix string translation
- skip special newline character when drawing text
2020-10-24 17:58:28 +02:00
athrxx
09a9f4b158 SCUMM: (DIG/CJK) - fix 'invalid escape code' error in Chinese intro
(the '^' char could occasionally appear as the second byte in a 2byte character)
2020-10-24 17:58:28 +02:00