Commit graph

160 commits

Author SHA1 Message Date
Cameron Cawley
8f8e830780 SCUMM: Make more static data read only 2024-11-25 22:54:31 +02:00
Filippos Karapetis
a33ebbdedf SCUMM: Remove unused variable 2024-11-16 18:40:51 +02:00
AndywinXp
56847a1051 SCUMM: Fix warning
"operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]"
2024-08-18 20:23:09 +02:00
AndywinXp
a467ab6f3e SCUMM: MANIAC (Apple IIgs): Implement correct cursor and color for texts
Everything is white now :-) The C64-like cursor and text colors
are now available via the "Visual changes" enhancement.
2024-08-12 20:52:24 +02:00
AndywinXp
1379807833 SCUMM: v0: Fix regression of last letter of verb missing
Also remove a leftover debug comment
2024-08-11 14:16:09 +02:00
AndywinXp
0f87863c7b SCUMM: MANIAC/ZAK (C64): Make screen layout pixel-perfect
This closes and fixes #11971:
"SCUMM: MANIAC/ZAK C64: GUI & dialog text are incorrectly
positioned on screen, and cursor is improperly layered"

The ticket also mentions improperly layered cursor:
"the pointer cursors pass *behind* the various character sprites
on screen", but there's really nothing we can do about it,
our cursor handling is way too different to function like the original
(and anyway, it looks like a severe C64 hardware limitation quirk...)
2024-08-11 00:09:33 +02:00
AndywinXp
b0abcd0461 SCUMM: MANIAC (Apple IIgs): Fix all known gfx regressions
Poor Apple II version, it has been broken for at least a couple
of years :-)

All regressions were a byproduct of basically forgetting this
version existed when making changes which should have
(or should not have) targeted C64 games, which use the
same rendering routines and palettes as this one.

Fixes and closes #14765:
"SCUMM V0: MANIAC: APPLE II: Palette is incorrect."
2024-08-10 21:52:36 +02:00
AndywinXp
d78ec57ef5 SCUMM: MANIAC (NES): Improve inventory handling accuracy
The inventory is now scrollable starting from three objects,
and it is filled in inverse order (last object grabbed is the first
displayed).
2024-08-10 13:00:31 +02:00
athrxx
430844ba63 SCUMM: (MM) - fix bug no. 15276
("Highlighting of verbs wrong in v2 when hovering next to verb")
2024-07-24 23:36:08 +02:00
athrxx
3353aa7f89 SCUMM: (V1/V2) - fix minor mouse precision glitch
Inventory click y-detection was off by one pixel.
2024-07-24 23:30:46 +02:00
athrxx
b868dab4c5 SCUMM: (V3/FM-Towns) - partial fix for bug no. 15027
(INDY3 (FMTowns): Map lines are drawn incorrectly)

This fix addresses the part concerning the line width of the travel
marker. Turns out that SCUMM3 FM-Towns draws all boxes one
pixel wider and higher on virtual screens other than 1. This also
allows removal of a hack in ScummEngine_v5::o5_drawBox().

I also fixed the old style pause/restart banners, since they incorrectly
used drawBox() for line drawing (which would be glitchy with the now
verdrawing drawBox(). The positive outcome is that we no have original
looking FM-Towns banners (only in Japanese, though, since - unlike the
original - we don't run the English version in 640x480).

The changed method of drawing and removing the banner also fixes
the removal of the black country borders on the map. But it will still
be removed below the pause banner and in the spots where the travel
marker passes the border. So that has to be addressed separately.
2024-04-30 23:29:53 +02:00
Torbjörn Andersson
fb2bd1166d SCUMM: Split up gfx_mac.cpp into new macgui directory
The Mac GUI code is getting unwieldy, and this is an attempt at breaking
it up into more manageable chunks.
2023-12-22 15:09:06 +01:00
Torbjörn Andersson
ec1ab82283 SCUMM: Initial work on a common MacGui class that handles Mac menus etc.
This will be used for Last Crusade and Loom. Loom is currently the more
broken of the two, though.
2023-11-18 18:47:39 +01:00
AndywinXp
1b40a6c932 SCUMM: MI1 (SegaCD Jap): Fix remaining text rendering issues
These include:
- Stray "-" characters (actually, "_") in dialogues
- Graphical glitches when scrolling dialog choices horizontally

With this commit we finally close issue #10447
2023-11-13 10:17:55 +01:00
Torbjörn Andersson
2223c96395 SCUMM: More Indy 3 Mac GUI cleanups 2023-10-16 17:40:29 +02:00
Torbjörn Andersson
a67b1e9758 SCUMM: Remove Indy 3 Mac GUI verb script check
It seems it's no longer needed. Also, cleaned up naming a bit so that
instead of "active" and "visible", the GUI is now "allowed" and
"active".
2023-10-16 17:40:29 +02:00
Torbjörn Andersson
44b7558756 SCUMM: Remove Indy 3 Mac hacks that are no longer needed 2023-10-16 17:40:29 +02:00
Torbjörn Andersson
6bc9ccadef SCUMM: Fix clicking on Indy 3 Mac GUI sentence line 2023-10-16 17:40:29 +02:00
Torbjörn Andersson
fd63cf734d SCUMM: Hopefully fix Indy 3 Mac verb shortcut keys 2023-10-16 17:40:29 +02:00
Torbjörn Andersson
62af893348 SCUMM: Major (incomplete) refactoring of Indy 3 Mac GUI
Widgets are now proper objects. I'm back to the point where verbs work
again, but not the inventory. Still, this is too scary not to commit now
that it's beginning to work again.
2023-10-16 17:40:29 +02:00
Torbjörn Andersson
b8d5096d7c SCUMM: Some more Indy 3 Mac inventory work 2023-10-16 17:40:29 +02:00
Torbjörn Andersson
eeac1b24ef SCUMM: Indy 3 Mac responds to verbs now 2023-10-16 17:40:29 +02:00
Torbjörn Andersson
f37152d468 SCUMM: Indy 3 Mac is actually drawing scripted buttons now
This is by no means the final code for it, but it's still a good place
to commit.
2023-10-16 17:40:29 +02:00
Torbjörn Andersson
716cd6e0e5 SCUMM: Remove Indy 3 Mac GUI mock-up. Begin work on proper GUI.
The goal is to make the interface as simple as possible, and to put as
much of the knowledge of what's going on into MacIndy3Gui itself.
2023-10-16 17:40:29 +02: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
athrxx
1290da84ca SCUMM: (INDY3) - fix "what is" bug
(the verb should not be usable on actors)
2023-10-15 22:14:53 +02:00
athrxx
829572057c SCUMM: minor code style fixes 2022-10-17 23:03:04 +02:00
athrxx
7ba7d259c7 SCUMM: (SAM) - fix bug no. 13761
(Can't shoot names during the credits)
2022-08-21 01:38:04 +02:00
athrxx
319e50fc35 SCUMM: (LOOM/VGA Talkie) - improve verb handling
- get rid of weird hackery in o5_verbOps
- make sure the verbs are properly restored after loading a savegame
2022-08-10 15:27:23 +02:00
Donovan Watteau
27f9a460b5 JANITORIAL: Fix "the the" and similar typos 2022-07-29 19:36:40 +03:00
athrxx
f28300f27f SCUMM: (V1) - add support for CGA black & white 2022-07-11 18:16:29 +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
athrxx
123e6d10b6 SCUMM: (COMI/CJK) - fix verb drawing regression 2022-04-08 19:53:44 +02:00
athrxx
acb665c109 SCUMM: (SCUMM7/8) - cleanup (text) verb drawing and Hebrew right-to-left drawing
(SCUMM7/8 only)
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
de4513cdff SCUMM: (SCUMM7/8) - implement original text formatting flags for more flexibility 2022-04-08 19:53:44 +02:00
athrxx
78835f0318 SCUMM: (SCUMM7/8) - start cleaning up text verb drawing
(this commit actually makes more of a mess than it cleans up anything and it also kills Hebrew, but it's easier for me not to squash this)
2022-04-08 19:53:44 +02:00
Torbjörn Andersson
9d9b6be671 SCUMM: Hack around Mac Loom text glitch
When using Straw To Gold (either on Loom island or in the Blacksmiths's
cell), the "gold" / "straw" texts overlap each other. This does not
happen in the original. Normally, script 8 would be responsible for
erasing that part of the screen, I think, but the Mac version does
things differently than the DOS version and I can't figure out how to
get it to work properly.

Maybe it's all down to differences in how we implement the
high-resolution text rendering in ScummVM? I'm adding a hack to fix it
for now, but if anyone has a better solution I'd be happy to see it go.

Fortunately, only two games use this, and the hack only affects one of
them. I've played through the game - again - without seeing any
regressions.
2022-04-06 11:40:58 +02: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
Torbjörn Andersson
5f2bf42f84 SCUMM: Changed the workaround for verbs drawn in room 80
It turns out that checking the room height causes verbs not to be
redrawn after reading books. Let's just limit it to room 80, and hope
there aren't any other cases.
2021-06-30 14:59:55 +02:00
Torbjörn Andersson
276381dac2 SCUMM: Work around problem with inactive verbs being drawn in a scene
There is at least one scene in the game where inactive verbs are drawn,
and then the scene background is drawn over them. This should mean the
verbs are no longer visible, but the way we implement high-resolution
text on a scaled low-resolution background all text is assumed to have a
text mask on the text surface.

We work around this by only drawin verbs in standard rooms, where
"standard" is defined as being 128 pixels tall.
2021-06-30 14:59:55 +02:00
Orgad Shaneh
8047607908 SCUMM: Fix unclickable centered verbs
Fixes #12552
2021-05-17 22:16:56 +03:00
Filippos Karapetis
cb6a107499 SCUMM: Limit x-range of selection workaround to Hebrew versions
Fixes bug #12552
2021-05-17 02:08:21 +03:00
Orgad Shaneh
c8fc484c37 SCUMM: Fix X-range of selection for Hebrew on scumm<7
curRect.left is assigned in the script, and it is not modified. right is
assigned with the screen width - original left.

This results in bad highlighting of the verbs all over the line width,
instead of being limited to the actual string.

Due to that, sometimes the selection range of the up/down arrows overlaps
with some of the verbs, and then these verbs cannot be selected.

Solve by storing the original left value, and using it as initial x
position for the string (the actual right-to-left manipulation is done in
drawString()), and modify the value of curRect.left to match the string
that was actually drawn.

This bug is similar to the one that was fixed in 58e921eb87, but the
solution that was done there for v7 and v8 cannot work here, because the
string logic is much more complicated.
2021-04-26 21:26:41 +03:00
Orgad Shaneh
58e921eb87 SCUMM: Fix wrong rect for verbs on Hebrew
The value of left is applied from the script all the time, and was
replaced in drawVerb.

The problem with this approach is that redrawVerbs maps the mouse
location to verb index *before* calling drawVerb, so the rectangles it
compares against are invalid in X-axis (right is always _screenWidth -
1, and left is always 5).

This caused several bugs:
* Each verb was clickable all over the screen's width, although it was
  not highlighted.
* If the mouse was between 2 verbs, long above short, the Y-axis has 6
  overlapping pixels (e.g. 1: 330-360, 2: 354-384). Scanning is done
  bottom-up, so 1 was highlighted, but 2 was selected because of the
  previous bullet.
* The text on Hebrew was aligned to the right without any padding. Other
  languages have left = 5.

Fixed by setting right instead of left when applying the script, and
adjusting left in drawVerb. Other languages are not affected.

Another issue, unrelated to language selection: A verb that was split to
2 lines was clickable all over the screen's width. That's because
curRect.right was set beyond the _screenWidth, and it was not trimmed to
the first (longer) line's length. On Hebrew, curRect.left became
negative. This is also fixed in this commit.
2021-03-08 11:57:30 +02:00
sluicebox
93eeffc84d JANITORIAL: Update old bug tracker numbers 2021-03-03 02:15:05 +02:00
BLooperZ
f76d858e6a SCUMM: COMI: fix hebrew multiline dialogue 2021-02-04 22:25:39 +02:00
BLooperZ
7f8b584aa3 SCUMM: remove commented out code 2020-01-01 00:31:21 +01:00