Commit Graph
99 Commits
Author SHA1 Message Date
Matthew Jimenez 77ee5a9007 IMAGE: Get palette class by reference on image decoders 2025-04-12 15:47:17 +03:00
Scott Percival 1d3c6271b2 GRAPHICS: Move Mac gamma curve to header 2025-03-25 12:17:34 +08:00
Torbjörn Andersson 5bc34ba177 SCUMM: MACGUI: Disable Maniac Mansion Mac GUI while paused
We do this by setting the _messageBannerActive flag. It's not really a
banner, I guess, but close enough. Also simplified the check a bit. Back
when it was just Loom and Indy 3, we checked if their custom banner
window had been created. But the message banner flag actually covers
that as well.
2025-03-03 11:29:05 +02:00
Torbjörn Andersson 33b065bfc5 SCUMM: Add option for gamma correction
This is currently only used for Macintosh games, but I kept the name of
the setting anonymous in case we ever need gamma correction for
something else.
2025-01-23 21:42:25 +02:00
Torbjörn Andersson 4149e3da21 SCUMM: MACGUI: Eliminate some code duplication 2025-01-10 22:18:39 +01:00
Torbjörn Andersson b9ad81692c SCUMM: MACGUI: Move menu updating (disabling save etc) into subclasses
The only thing that remains in MacGuiImpl is the simplest form of
save/load disabling. Neither Loom nor Last Crusade use that, as they
have additional conditions imposed on them.
2025-01-10 07:02:38 +01:00
Torbjörn Andersson 9b79e3136e SCUMM: MACGUI: Move comment to more appropriate spot 2025-01-10 06:31:45 +01:00
Torbjörn Andersson c192b98799 SCUMM: MACGUI: Disable permanently disabled menu items just once
There is no need to disable menu items that are meant to stay disabled
more than once. This also adds disabling of some Maniac Mansion-specific
stuff.

Maniac Mansion seems to be running fairly well (user friendlyness issues
aside), though we need to figure out how to suppress the Mac GUI while
the game is paused. I also had it hang on me once on quit. No idea why.
2025-01-05 17:33:57 +01:00
Torbjörn Andersson 042e83d78a SCUMM: MACGUI: Initial support for Maniac Mansion
There is currently no user friendly way to do this. You have to unpack
the Maniac Mansion files (since the game is not detected from the "Day
of the Tentacle Data" file), and then you have to put a copy of the Day
of the Tentacle Mac executable where ScummVM can find it (e.g. in the
same directory) because that's where the menus and dialogs are.

Known issues:

"About" shows the credits screen for Day of the Tentacle,
but the original behavior isn't much better: It just shows a black
screen.

The "Sound" menu should be disabled. There are some things I would like
to rearrange before looking into that, though.
2025-01-05 16:33:53 +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 d192e864f1 SCUMM: MACGUI: Suppress Mac GUI if a message banner is active
This is similar to the fix we already had for Loom and Last Crusade,
except now we also look for the SCUMM engine's own message banners.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson ba6b348cf5 SCUMM: MACGUI: Word wrap static text widgets by default
This simplifies support for translated versions of v6-7 games where
apparently they sometimes kept the English texts and just added another
text on top of it.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson e88c6fbfba SCUMM: MACGUI: Don't crash on restart if there is no restart dialog
Full Throttle and The Dig don't have one, for one thing. At the moment,
we just restart without asking. Let's see how annoying that becomes.
2025-01-01 14:41:20 +02:00
athrxx 9c6d67b6a1 SCUMM: (SCUMM6/7/Mac) - implement sound mute menu option 2025-01-01 14:41:20 +02:00
athrxx eeff511c1d SCUMM: (SAM/Mac) - fix icon color init/remap
I just added a step that is present in the second resource processing
loop of MacGuiImpl::createDialog(), but not in the first one.

(fixes at least SAM German, but possibly other things, too)
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 0e82eec28c SCUMM: MACGUI: Use the Mac Window Manager menu activation callback
I hope this will put a stop to the infrequent wrong palette when menus
were opened.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson e199e1c9e5 SCUMM: MACGUI: Add thumbnail support to V6-7 open dialog. Kind of.
I mean, the color quantization is so broken it's not even funny, but it
is updating the thumbnail when the selection changes, and that's a
direct result of yesterday's dialog event loop restructuring. So I count
this as a win. Let's commit it before I break anything even worse.
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 4a0de6e4c7 SCUMM: MACGUI: Remove hardcoded "Game" menu name 2025-01-01 14:41:20 +02:00
Torbjörn Andersson c45ea28c5d SCUMM: MACGUI: Read menu IDs from MBAR resource where available
This should get rid of the last hard-coded English text for v6-7 games.
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 3dcd69ed18 SCUMM: MACGUI: Silence warning about unknown DITL item
We know type 7 are controls, we just don't know (yet) what to do with
them. At the very least, we may be able to extract some texts from the
corresponding CNTL resource.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson a26f5c1853 SCUMM: MACGUI: Fix major oops when dealing with "user items" in dialogs
I had forgotten to skip the data for the user item when parsing the DITL
resource. For most games this made no difference because the size was 0.
But for Day of the Tentacle, that was not the case. It turns out that a
lot of stuff that I was drawing manually was there all along!
2025-01-01 14:41:20 +02:00
Torbjörn Andersson b807285ee6 SCUMM: MACGUI: Minor cleanup 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 6ecaf36e71 SCUMM: MACGUI: Hopefully fix crash with non-English v6-7 games 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 9d943381ac SCUMM: MACGUI: Attempt to fix menu glitch for earlier games
This is getting a bit messy.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 7572fba8f3 SCUMM: MACGUI: Hopefully fix palette regression
Opening the quit dialog wouldn't always update the palette.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 4145ac26d9 SCUMM: MACGUI: Fix memory leaks 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 16380da1f7 SCUMM: MACGUI: Add support for The Dig Mac demo
This one uses a regular dialog for About. Unfortunately, our Sam & Max
and Full Throttle Mac demos don't have any resource fork, and our Fate
of Atlantis Mac demo has an unrecognized string table.
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 e718203314 SCUMM: MACGUI: Add mechanism to override the calculated slider stops
Useful for the v6-7 sliders, which have to line up with the markings.
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 ad87f9305b SCUMM: MACGUI: Fix palette regression with monochrome images 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 2d1ad751b0 SCUMM: MACGUI: Add missing static graphics to Sam & Max options dialog 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 25c304f892 SCUMM: MACGUI: Fix bugs in icon loader, plus early v6-7 options dialog
This isn't really ready for use, but I want to commit because I embark
on another experiment.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 15a059ddbd SCUMM: MACGUI: Implement much of the remaining v6-7 menus 2025-01-01 14:41:20 +02:00
Torbjörn Andersson 60fff6d344 SCUMM: MACGUI: Initial v6/v7 save/load dialogs, plus other fixes 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 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 3d62119b70 SCUMM: MACGUI: Very early (very broken) work on the v6-v7 quit dialog
Apparently we need to figure out the appropriate size from the DITL
resource, which doesn't contain that information yet ResEdit somehow
remembers it? Hmm...
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 5cb4e6bae0 SCUMM: MACGUI: Add missing menu for v6-v7
I don't know why I thought they should have one menu less.
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 1822cad2cc SCUMM: MACGUI: First attempt at black screen while menu is open
This doesn't quite work, but I want to save this before trying to fix
it, because it could get so much worse...
2025-01-01 14:41:20 +02:00
Torbjörn Andersson 1510972a6d SCUMM: MACGUI: Add very broken Mac GUI for v6 and v7 2025-01-01 14:41:20 +02:00
Cameron Cawley 8d9614ccd5 GRAPHICS: MACGUI: Extend the font ID enum 2024-12-09 23:24:23 +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
Torbjörn Andersson da3bcfbd21 SCUMM: MACGUI: Never fail to initialize the Mac GUI for Loom/Indy3
These games need the Mac GUI for more than just the menus and dialogs,
so for now if the initialization fails (i.e. the STRS resource was not
recognized, and could not be loaded) just disable the original GUI and
keep going.
2024-11-18 06:52:17 +01:00
Torbjörn Andersson 840e59c402 SCUMM: MACGUI: Fall back on using no Mac GUI for unrecognized versions
Rather than crashing, allow the user to continue playing the
unrecognized Mac version, albeit without the Mac GUI. Certain other Mac
aspects may still survive.
2024-11-14 21:30:54 +02:00
Torbjörn Andersson 3c62ce1f5a SCUMM: MACGUI: Remove unnecessary blank lines 2024-11-01 10:34:50 +01:00