Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCUMM: Implement Macintosh GUI for the remaining SCUMM games #6326

Merged
merged 99 commits into from
Jan 1, 2025

Conversation

eriktorbjorn
Copy link
Member

@eriktorbjorn eriktorbjorn commented Dec 20, 2024

This is work in progress, but I don't know how much more time I will have before Christmas.

The goal is to implement the Mac GUI for the remaining V6 and V7 games, and Maniac Mansion. Here is the current status:

About screens have been implemented:

scummvm-tentacle-mac-00011

The demos have less fancy dialogs. Currently the sizes of the dialogs (but not the contents) are hard-coded. The demos on our downloads page are broken, but the ones I've been able to track down are at least temporarily available from https://drive.google.com/drive/folders/19quZK2R9A067El36tcG41dZSP0CnHEbv

scummvm-samnmax-mac-1-00000

Options dialogs have been implemented. There are some minor color differences, but the layout should be pixel perfect for all five dialogs. Settings are saved and applied, though this needs testing.

scummvm-tentacle-mac-00012

I think all of the menu items have been either implemented or disabled.

Save and load dialogs are there. Thumbnail support is there, too. I used an octree color quantization algorithm adapted from Dr. Dobb's Journal. This is clearly over-engineering, but I figured it could be cleaned up and moved into Graphics later.

scummvm-tentacle-mac-00011

As an extra bonus, I've done some work on the Fate of Atlantis demo.

scummvm-atlantis-mac-2-00009

Known issues, in rough order of seriousness:

  • Someone will have to test the localized versions. I only have the English ones, but at least there are no longer any hard-coded English texts in our dialogs.
  • Quitting while there is a dialog on screen makes the game graphics display for a split second before the game quits. It would be nice if it didn't.
  • Colors in the dialog aren't always exactly like the original. I think ScummVM handles the palettes too well, making all the desired colors available. It's a feature! That's my story, and I'm sticking with it!
  • Savegame thumbnails are not like the original. I consider that a feature, but if someone wants to implement it... The color quantization code should be cleaned up and probably moved to Graphics.
  • I'm currently disabling the Video Quality popup. I don't know what a disabled popup should look like, so I've just grayed out the down arrow on it. I tried creating a disabled popup in ResEdit, but it still looked and acted like an enabled one. Since the popup is now generated from game resources, there is an extra entry in it that I haven't figured out why. But it doesn't matter as long as the whole thing is disabled.
  • Are there any supported demos other than the English Sam & Max, The Dig, and Full Throttle? What about floppy versions of the full games?
  • I don't think we have any way of playing the Mac version of Maniac Mansion. (Though when we do, the Options dialog is implemented for that one too.)
  • I'm sure there are thing that need to be cleaned up a bit, since there's been some back and forth with the implementation.

@eriktorbjorn eriktorbjorn marked this pull request as draft December 20, 2024 15:54
@eriktorbjorn
Copy link
Member Author

The slider widgets should be fixed now:

scummvm-ft-mac-00001

@eriktorbjorn
Copy link
Member Author

I had forgotten about the demos. I only have the Dig demo on CD, and the ones on our downloads page don't seem to include the resource fork. My Dig demo seems to be working now, though.

scummvm-dig-demo-mac-00001

@eriktorbjorn
Copy link
Member Author

I'm planning on fixing the Fate of Atlantis Mac demo, at least partially. Enough that the About dialog looks ok and doesn't crash. From what I understand, it's not supposed to be interactive, but it is in ScummVM, so it's not a well supported demo anyway.

I'll do it in this branch to avoid conflicts.

@eriktorbjorn eriktorbjorn force-pushed the scumm-macgui-v67 branch 2 times, most recently from 09de713 to 1f40deb Compare December 26, 2024 15:25
Torbjörn Andersson added 22 commits December 27, 2024 20:21
I was bypassing it by going directly to the palette manager.
This doesn't quite work, but I want to save this before trying to fix
it, because it could get so much worse...
Also made some functions overridable, one of which should keep the game
from crashing on exit.
I don't know why I thought they should have one menu less.
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...
It's getting a bit messy, but I'm just exploring...
I.e. not just when opening them from the menu.
Oddly enough, only Day of the Tentacle (and, by extension, Maniac
Mansion) seems to have one?
The shortcut command doesn't work, though.
But the whole palette save/restore thing doesn't work properly here. I
guess we need to save the actual 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.
This isn't really ready for use, but I want to commit because I embark
on another experiment.
We have visitors, so I'm not going to turn up the volume to verify that
the volume sliders work correctly!
@athrxx
Copy link
Contributor

athrxx commented Dec 29, 2024

I have added the music and sfx mute menu options for SCUMM6.
That leaves the volume controls in the options dialog. These should be more straightforward...

I don't have FT Mac. But I could imagine that for the "Spooled Music" option you can just do what I did for the SCUMM6 sound menu. I did insert v7 code into syncSoundSettings, but it is untested, since I don't have it.

Torbjörn Andersson added 9 commits December 29, 2024 19:43
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.
With the exception of Maniac Mansion, the Mac version apparently uses
1-9 instead of 0-9 as the text speed interval.
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.
That was easy! bringing up the Mac menu pauses the game, and "to resume
playing again, choose Resume Game from he Game menu, or simply click the
mouse somewhere away from the menubar."

Well, we don't do the latter. But doing the former is just a matter of
doing... well, nothing.
Primarily for the Mac GUI, where the sound would pause but the movie
would keep playing. There's still something awkward about bringing up
the Mac GUI during Full Throttle's biker fights, but once they're there
they seem to work fine.
@eriktorbjorn
Copy link
Member Author

I think that the GUI not woking correctly when the game is paused is the only known issue I would consider blocking.

My suggestion would be to suppress the GUI while the game is paused by anything else than the GUI itself.

Torbjörn Andersson added 3 commits December 30, 2024 07:07
Perhaps this will fix the remaining Mac GUI SMUSH glitch?
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.
@eriktorbjorn
Copy link
Member Author

I think I've fixed so that the Mac GUI is inactive while there is a pause banner on screen. Actually, I just extended the already existing if (_bannerWindow) check to if (_bannerWindow || _vm->_messageBannerActive). I hope that's the only such case. If not, we'll have to deal with them as they are discovered.

So, barring any regressions with the older games, or other last minute issues, I've done everything I set out to do here. And then some. Anything else can probably be dealt with in-tree, I think.

@eriktorbjorn eriktorbjorn marked this pull request as ready for review December 30, 2024 12:54
image/image_decoder.h Outdated Show resolved Hide resolved
Torbjörn Andersson added 5 commits December 30, 2024 16:07
This is consistent with other masking.
This should be in graphics, not engines/scumm/macgui but I'm keeping it
here for now to avoid conflict, because there's been some activity in
graphics lately.
It's theoretically possible that the node will only have one child, and
then the number of leaves will stay the same.
@eriktorbjorn
Copy link
Member Author

I've backported the pause banner fix to 2.9. It doesn't seem to corrupt the graphics in the older games, but loading a game while paused is still confusing.

Torbjörn Andersson added 2 commits January 1, 2025 10:37
Mostly comments, but I also don't understand why reduceTree() would
reduce the height of the entire octree, and not just the subtree it is
pruning. So I've changed that, but added a comment to describe what I
did there.
Copy link
Member

@bluegr bluegr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! LGTM

// There are several possible approaches to picking the node to
// reduce. Picking the one with the largest number of pixels
// may leave more color for fine details. Picking the one with
// the smallest may will sacrifice detail, but may preserve
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be wrong, but does "may will" work here, or is it an oversight?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's my error. I'll fix it later. Thanks!

@bluegr
Copy link
Member

bluegr commented Jan 1, 2025

Thanks for your work @eriktorbjorn! This is in a good state to be merged.

We've talked with @AndywinXp, and he has no objection to merge this.

Merging. Any further work on this can be done in-tree

@bluegr bluegr merged commit 9bd992e into scummvm:master Jan 1, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants