Commit Graph
43 Commits
Author SHA1 Message Date
Le Philousophe d77cf892c6 SCUMM: Don't use deprecated primitives 2025-01-24 12:11:17 +01:00
Torbjörn Andersson d3a61d71b2 SCUMM: MACGUI: Add drawRoundRect() method to Mac dialog window
It will still trigger warnings about using a deprecated method, but now
it's clearly documented that this should be replaced with something that
matches QuickDraw's rounded rects.
2025-01-06 08:55:19 +01:00
Torbjörn Andersson b7ac5bc106 SCUMM: MACGUI: Use Graphics::maskBlit() for masked blitting
Not that this is going to make any difference in performance, I think,
but it's a good way to test that the cicn loader is doing the right
thing when constructing that mask.
2025-01-03 12:47:46 +01:00
Torbjörn Andersson a1db6d8f6d IMAGE: Make the mask a Surface instead of a buffer
This is consistent with other masking.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson c474edcf97 SCUMM: MACGUI: Simplify word wrapping in demo About dialogs
Now that we use \n instead of \r, the word wrapper should be able to
handle the strings just fine.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 76f9ea673f SCUMM: MACGUI: Fix palette glitch 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 2c7b998cec SCUMM: MACGUI: Rework the dialog window event loop
Each dialog now has an event queue. The runDialog() method consumes all
ScummVM events and transforms them into dialog events. This should make
it easier to have widgets depend on each other, e.g. I want the v6-7
Open dialog to update the thumbnail picture.

This may have caused regressions, but initial tests seemed promising.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 3e56e56ee7 SCUMM: MACGUI: Generate pop-up menus from the DITL resource
This way we no longer hard-code English texts.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson ac9e6adef9 SCUMM: MACGUI: Renamed the drop down list to pop-up menu
For consistency with Inside Machintosh.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson a40fcc5401 SCUMM: MACGUI: Add support for icon masks
This fixes transparency for the slider widget handles in v6-7 games.
Someone may want to adjust the image decoder later, but it will do for
now. Not all icons have useful masks, but some do.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 892f847a6a SCUMM: MACGUI: Use correct bounds for icons
They're not all 32x32 pixels.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 96067ff55a SCUMM: MACGUI: Preliminary work on image slider to support V6-7 sliders
I'm committing this while I consider how to get transparency to work for
the slider handle.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 281c2bacbc SCUMM: MACGUI: Combine MacIcon and MacPicture into a single widget 2025-01-01 14:41:20 +02:00
Torbjörn Andersson c6b5fb6876 SCUMM: MACGUI: Work in progress on the drop down list widget 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 7380767714 SCUMM: MACGUI: Add missing static graphics to DOTT options dialog
Also fixed some palette issues along the way.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson e5b964a24c SCUMM: MACGUI: Complete rework of v6-7 window palettes
When a dialog window is created now, all palettes from the individual
widgets (icons and pictures) are collected and combined into a single
palette. The widget palettes are remapped to this. The icon decoder is
now a proper image decoder, which makes icons and pictures very similar
to handle.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson af2a1231cb SCUMM: MACGUI: Use the real palette, not the engine palette
The engine palette doesn't always properly reflect what's on screen
(e.g. during SMUSH movies), so we have to use the real palette.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson d253793b22 SCUMM: MACGUI: Black out the screen for all v6-7 dialogs
I.e. not just when opening them from the menu.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson f35329a88f SCUMM: MACGUI: Simplify v6-v7 dialog border drawing 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 9159dfa273 SCUMM: MACGUI: Small cleanup 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 03c6e54643 SCUMM: MACGUI: Implement the rest of the V6-7 quit dialog
It's getting a bit messy, but I'm just exploring...
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 97ced3166c SCUMM: MACGUI: Optimize Mac palette handling (bug #15492)
Previously, every palette change in a game get passed on to the Mac
Window Manager, which would then have to look up new colors for drawing
Mac GUI stuff. This was fine for some games, but later ones do a lot of
palette animations, which could slow things down.

Now the Mac Window Manager gets the new palette only when it's about to
draw the Mac menu, or when it's about to draw a dialog (since those can
be triggered outside of the menu).

Additionally, the Mac Window Manager now triggers the auto-opening of
the menu in the event handler, not in the drawing code. Otherwise the
menu would be drawn once before the SCUMM Mac GUI could notice that the
menu was visible, causing an ugly color glitch.
2024-11-20 11:39:25 +02:00
Filippos Karapetis 498b4bb503 SCUMM: Remove unused variables 2024-11-16 18:40:51 +02:00
Torbjörn Andersson 15daa77e03 SCUMM: MACGUI: Add defines for some magic numbers 2024-10-28 08:24:59 +01:00
Torbjörn Andersson 95ad13f678 SCUMM: MACGUI: Eliminate more hard-coded widget IDs
Instead of referring to widgets by their ID (really just an index into
an array), now we ask the dialog for the Nth instance of a widget of a
particular type. So we still need to know in which order buttons and
such are defined, but it should still be a lot easier to read and a lot
less prone to error.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 74c57ebc4e SCUMM: MACGUI: Make standard open/close dialogs more robust
Widget IDs are now assigned immediately when adding a widget to a
dialog, and we no longer hard-code widget IDs for those dialogs.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 261b4019d5 SCUMM: MACGUI: Scribble on the fake Mac menu bar when opening dialogs
On a real Mac, the menu bar remains interactive while dialogs are shown.
This is only useful for the Edit menu during the Save dialog, and we
don't implement the Edit menu anyway. Ours is just decorative, but now
it looks a bit more like the original: Menus are grayed out or, for
About dialogs, the Apple menu is still highlighted.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 1c3d41edf7 SCUMM: MACGUI: Move default save/load into macgui_impl.cpp
Plus some other minor cleanups. As far as I can tell, Last Crusade is
the only one of the games that doesn't use the system save/load dialogs,
so it makes sense to me to let the base GUI implement it.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 823942358c SCUMM: MACGUI: Improve the rendering of "Monkey Island 2"
I think this is the correct rendering: Italics + Bold + Outline drawn
twice, once pixel apart. But ScummVM spaces the letters too closely
together. It could perhaps be fixed by adding Extended, but when I
mocked it up in a Mac emulator I didn't have to use that.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson d91e4c354f SCUMM: MACGUI: Clean up the "extra bold" About style
There is nothing "extra" about it. It's just a bold version of a font
that looks bold to begin with. I probably experimented with Geneva bold
before arriving at this, but now the special drawing for it is no longer
needed.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 9d5f734a7c SCUMM: MACGUI: Add initial work on MI2 About dialog
This is incomplete, but there are font rendering issues that others are
going to have to help me with, and this provides a test case. "Monkey
Island 2" is close enough that I may be able to figure it out soon, but
for "LeChuck's Revenge" the font manager picks a different font than the
one I asked for. (TTF instead of a bitmap font, I believe?)
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 3670cd934b SCUMM: MACGUI: Remove last hard-coded colors from common code 2024-10-28 08:24:59 +01:00
Torbjörn Andersson 61f19fa472 SCUMM: MACGUI: Remove palette handling for PICT images
We used to be able to use an unused area of the palette for the PICT
image's own palette. That will of course be quite impossible when
supporting 256 color games, so map the colors to the closest available
ones instead. That seems to be what the original interpreter did anyway.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 94ffe09168 SCUMM: MACGUI: Remove most hard-coded blacks and whites from common code
Only 16 color games will be allowed to refer to the hard-coded colors.
This is a first step towards eliminating them from the code that's also
used by 256 color games.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 469ff7e63c SCUMM: MACGUI: Add initial version of MI1 Mac About dialog
Our PICT loader currently can't handle the graphics resources, but all
the texts and timing should be in place.
2024-10-28 08:24:59 +01:00
Torbjörn Andersson 2b0877f3bb SCUMM: MACGUI: Update mouse cursor on mouse up after unfocusing widget
If we do it before the widget is unfocused, we may end up with a beam
cursor outside of an edit widget, until the mouse moves again.
2024-10-05 19:47:49 +02:00
Torbjörn Andersson aa42c9c038 SCUMM: MACGUI: Copy the menu bar to Mac screen when a dialog is shown
This is to allow the "beam" cursor to be correctly drawn if it ever
moves that far up. There is no reason for it to, but it can happen if
you drag it outside the dialog window while selecting text.
2024-10-05 19:39:45 +02:00
Torbjörn Andersson 4a86b0be1c SCUMM: MACGUI: Fix beam cursor crash
This would happen if, while selecting text in an editable text widget,
you dragged the cursor too far down and outside of the dialog box. There
is no sensible reason to do this, but I was trying to mimic the original
behavior.

This was a regression from when the Mac screen height was increased from
400 to 480 pixels. The beam cursor is drawn manually, rather than by the
backend, because it's supposed to invert the background it's drawn over.

I did notice another regression, albeit a minor one: If you drag the
beam cursor to the top of the screen, it will corrupt the menu bar. I
think this is because the menu bar isn't drawn on the Mac screen. To
fix, we would have to copy the actual screen buffer instead, but I think
the only way of doing this is using lockScreen() and that's inefficient.

At least it shouldn't crash any more.
2024-10-05 10:13:09 +02:00
AndywinXp 918e349040 SCUMM: INDY3/LOOM (Mac): Draw fake widgets in open/save windows
These are fake widgets because we won't ever have,
within ScummVM, an use for the real ones.

Now the dialogs are more accurate and prettier. :-)
2024-10-04 20:52:32 +02:00
Torbjörn Andersson 059aa3dcff SCUMM: Remove unnecessary qualifiers 2023-12-22 15:09:06 +01:00
Torbjörn Andersson 1226b9ca3f SCUMM: Clean up some includes 2023-12-22 15:09:06 +01:00
Torbjörn Andersson c7ab59293f SCUMM: Split MacGui into MacGui and MacGuiImpl
The idea here is to expose a much smaller part of the MacGui headers to
the SCUMM engine, but introducing a new class that simply relays calls
to the actual Mac GUI. I hope this will allow me to further untangle
things.
2023-12-22 15:09:06 +01: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