Commit Graph
20 Commits
Author SHA1 Message Date
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