#9112 closed patch
HE: Resource Forks on Mac OS X
Reported by: | SF/mthreepwood | Owned by: | sev- |
---|---|---|---|
Priority: | normal | Component: | Port: Mac OS X |
Version: | Keywords: | ||
Cc: | Game: |
Description
This patch adds support for opening the resource fork directly on Mac OS X. Previously, the games that required the resource fork could not be used on Mac OS X without mangling the files. It's slightly hackish in that I'm calling StdioStream directly (though in a #ifdef MACOSX block), but it was the cleanest way I could think of. I tested this with Let's Explore the Jungle with Buzzy (Macintosh, obviously) on Mac OS X 10.5.8 x86.
Ticket imported from: #2901515. Ticket imported from: patches/1217.
Attachments (4)
Change History (21)
by , 15 years ago
Attachment: | scumm_mac_resfork.diff added |
---|
comment:1 by , 15 years ago
Max, could you take a look at this?
Matthew, I wonder why are you removing the reopening file code at lines 1184 and 1185?
comment:2 by , 15 years ago
Owner: | set to |
---|
comment:3 by , 15 years ago
There's two reasons why I removed that: a) It wouldn't be calling the same StdioStream::makeFromPath function as before, and more importantly b) It's not necessary to have in the first place ;)
comment:4 by , 15 years ago
I moved Mac Resource manager to separate class in Common. What I see now is that your code on Macs will work only with files with resource fork, and will stop working with extracted forks.
Can you modify your code so this will be as a fallback? And of course, move it to common/mancresman.cpp. I could do it, but I completely unable to test it.
comment:5 by , 15 years ago
Owner: | changed from | to
---|
comment:6 by , 15 years ago
I purposely made the code not work with the extracted forks. I don't think users who legally use the game will be using the MacBinary format for their game. I don't see any benefit in letting Mac OS X use the MacBinary code here.
I will add an updated patch soon.
comment:7 by , 15 years ago
I'm adding an updated patch which does the following: - Make MacResManager API more sensible by adding a open/close functions and returning a Common::SeekableReadStream pointer from getResource() instead of a byte pointer (and an int pointer parameter). - Rename convertCursor() to convertCrsrCursor() because there are many types of cursors that can be found in resource forks - Use a uint32 tagID instead of a const char* as the tagID - Move the checks for the filename to MacResManager (.bin, .rsrc, etc.) - Added the Mac OS X specific code into MacResManager
However, I left my games at home that would use this code and I am unable to test until, by the earliest, Friday night.
comment:8 by , 15 years ago
Owner: | changed from | to
---|
comment:9 by , 15 years ago
Just tested this patch and it works fine. Assigning back to sev to have a look at it.
by , 15 years ago
Attachment: | resfork_macosx_alt.diff added |
---|
Patch with dumped forks on OSX too (r47618)
comment:10 by , 15 years ago
One last update: Here's a version that still allows for dumped forks to still be used on OS X.
comment:11 by , 15 years ago
Updating again:
1) Refactor out some of the code to separate raw/MacBinary, etc. 2) Add support for reading the data fork portion of MacBinary files 3) For files without the data fork embedded, getDataFork() will return a pointer to the regular file 4) Add hasDataFork() and hasResFork() functions 5) Add (untested) support for the AppleDouble format used when copying on OS X from a HFS(+) to non-HFS(+) file system to maintain the data fork
comment:12 by , 15 years ago
Would be nice if there were an edit function on these tickets...
In regards to #5, it can be removed if the rest of the patch is acceptable and you don't want to commit the untested code.
comment:13 by , 15 years ago
The patch looks pretty good now. The only thing that it does not apply anymore to trunk. Could you please update it, so I test for regressions?
comment:14 by , 15 years ago
My bad. On new OS patch utility requires -p parameter to understand the patches.
I tested for regressions and committed as is. Still I did not tested in on MacOS, but judging by the code it should work.
comment:15 by , 15 years ago
Status: | new → closed |
---|
comment:17 by , 6 years ago
Component: | → Port: Mac OS X |
---|
Patch against HEAD