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

KYRA: Don't require the Mac version of Legend of Kyrandia to be installed #3552

Merged
merged 12 commits into from Nov 22, 2021

Conversation

@eriktorbjorn
Copy link
Member

@eriktorbjorn eriktorbjorn commented Nov 19, 2021

The Macintosh version of The Legend of Kyrandia that I have is a non-talkie version distributed on CD. This version is supported now that arthxx added a music driver for it.

Annoyingly though, the game data files aren't unpacked on the CD. Instead, everything is inside a self-extracting StuffIt installer. This means that in order to play the game in ScummVM, you have to install the game (probably using a Mac emulator) and then copy the files from the emulated hard disk. Not the smooth kind of experience we want people to have.

This is my attempt at adding support for playing the game directly from the files on the CD, without having to go through the installation process. This is the first time I've worked with the Archive class, but hopefully I got it right.

Obviously it needs more testing. I've only tried it a little bit past the intro. But it appears to work.

This doesn't work. Not even close.
I will have to look out for memory leaks later.
This fixes a Valgrind warning on exit, I believe.
The game appears to be entirely playable from the StuffIt installer now,
but I haven't tested past the start of the game.
@athrxx
Copy link
Member

@athrxx athrxx commented Nov 19, 2021

Very cool to have that feature for the Mac version.
Also, very clean and unobstrusive implementation.
I'll do a quick test asap and then we can merge this...

Loading

@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Nov 20, 2021

Thank you. The only improvement I'm considering right now is if the music code should ask the engine for a pointer to the StuffIt archive, instead of creating its own.

Loading

@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Nov 20, 2021

Also, I was never quite sure of the difference between _files and _protectedFiles etc, so let me know if anything needs to be fixed in that respect.

Loading

@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Nov 20, 2021

The very fact that it's reading Mac resources from a file inside a StuffIt archive that it got from the data fork of a Macintosh executable, and it all somehow seems to work, is enough to make my head spin. :-)

Loading

athrxx and others added 3 commits Nov 20, 2021
(get rid of separate archive object in the sound code)
Now that the audio drive uses the same StuffIt archive as the rest of
the engine (thanks for the help with that!), it no longer needs to
verify that the installer file is present.
We use the same method for finding both the unpacked Legend of Kyrandia
executable and the Legend of Kyrandia installer, so there's no need for
duplicate code.
@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Nov 21, 2021

That's the last bit of cleanup that I've been meaning to make. I'll try to give it a bit of testing (at least up to entering Timbermist Wood) tomorrow. If that works, it's probably good enough to merge. (According to arthxx, "If it starts up fine with sound it should actually be okay. There isn't really anything happening with regard to resource management afterwards.")

Loading

@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Nov 22, 2021

The very fact that it's reading Mac resources from a file inside a StuffIt archive that it got from the data fork of a Macintosh executable, and it all somehow seems to work, is enough to make my head spin. :-)

Loading

@eriktorbjorn
Copy link
Member Author

@eriktorbjorn eriktorbjorn commented Nov 22, 2021

I've played both the extracted and unextracted version up to the point where you meet Darm in the Timbermist Wood. I didn't notice any issues related to this pull request.

Loading

No need to allocate a new one for each iteration.
@eriktorbjorn eriktorbjorn merged commit 8394f85 into scummvm:master Nov 22, 2021
8 checks passed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants