Ticket #9112: scumm_mac_resfork.diff

File scumm_mac_resfork.diff, 1.3 KB (added by SF/mthreepwood, 14 years ago)

Patch against HEAD

  • resource_he.cpp

     
    3838#include "common/stream.h"
    3939#include "common/system.h"
    4040
     41#ifdef MACOSX
     42#include "common/config-manager.h"
     43#include "backends/fs/stdiostream.h"
     44#endif
     45
    4146namespace Scumm {
    4247
    4348#define LE16(x)      ((x) = TO_LE_16(x))
     
    11511156        Common::File in;
    11521157        int size;
    11531158
     1159#ifdef MACOSX
     1160        if (_fileName.empty())
     1161                _fileName = _vm->generateFilename(-3) + "/..namedfork/rsrc";
     1162
     1163        // HACK: Open the resource fork using the path and directly through StdioStream
     1164        if (!in.open(StdioStream::makeFromPath(ConfMan.get("path") + "/" + _fileName, false), _fileName))
     1165                error("Could not open resource fork: %s", _fileName.c_str());
     1166#else
    11541167        if (_fileName.empty()) { // We are running for the first time
    11551168                _fileName = _vm->generateFilename(-3);
    11561169
     
    11721185                }
    11731186        } else
    11741187                in.open(_fileName);
     1188#endif
    11751189
    11761190        if (!in.isOpen()) {
    11771191                error("Cannot open file %s", _fileName.c_str());
     
    11811195        if (_resOffset == -1) {
    11821196                if (!init(in))
    11831197                        error("Resource fork is missing in file '%s'", _fileName.c_str());
    1184                 in.close();
    1185                 in.open(_fileName);
    11861198        }
    11871199
    11881200        *buf = getResource(in, "crsr", 1000 + id, &size);