Ticket #7252: extrapath.patch

File extrapath.patch, 2.8 KB (added by fingolfin, 16 years ago)

Patch which makes extrapath used by all file operations

  • base/main.cpp

    RCS file: /cvsroot/scummvm/scummvm/base/main.cpp,v
    retrieving revision 1.45
    diff -u -d -r1.45 main.cpp
     
    3434#include "base/plugins.h"
    3535#include "base/version.h"
    3636#include "common/config-manager.h"
     37#include "common/file.h"
    3738#include "common/scaler.h"      // For GFX_NORMAL
    3839#include "common/timer.h"
    3940#include "gui/newgui.h"
     
    259260        Engine *engine = detector.createEngine(system);
    260261        assert(engine);
    261262
     263        // Add extrapath (if any) to the directory search list
     264        if (ConfMan.hasKey("extrapath"))
     265                File::addDefaultDirectory(ConfMan.get("extrapath"));
     266
    262267        // Run the game engine
    263268        engine->go();
    264269
  • graphics/animation.cpp

    RCS file: /cvsroot/scummvm/scummvm/graphics/animation.cpp,v
    retrieving revision 1.10
    diff -u -d -r1.10 animation.cpp
     
    4747
    4848
    4949bool BaseAnimationState::init(const char *name) {
    50         const Common::String ePath = ConfMan.get("extrapath");
    51 
    5250#ifdef USE_MPEG2
    5351        char tempFile[512];
    5452
     
    6563
    6664        File f;
    6765
    68         if (!f.open(tempFile) && !f.open(tempFile, File::kFileReadMode, ePath.c_str())) {
     66        if (!f.open(tempFile)) {
    6967                warning("Cutscene: %s palette missing", tempFile);
    7068                return false;
    7169        }
     
    114112        // Open MPEG2 stream
    115113        mpgfile = new File();
    116114        sprintf(tempFile, "%s.mp2", name);
    117         if (!mpgfile->open(tempFile) &&
    118             !mpgfile->open(tempFile, File::kFileReadMode, ePath.c_str())) {
     115        if (!mpgfile->open(tempFile)) {
    119116                warning("Cutscene: Could not open %s", tempFile);
    120117                return false;
    121118        }
     
    134131
    135132        // Play audio
    136133        bgSoundStream = AudioStream::openStreamFile(name);
    137         if (bgSoundStream == NULL)
    138                 bgSoundStream = AudioStream::openStreamFile(name, ePath.c_str());
    139134
    140135        if (bgSoundStream != NULL) {
    141136                _snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false);
  • sword1/resman.cpp

    RCS file: /cvsroot/scummvm/scummvm/sword1/resman.cpp,v
    retrieving revision 1.18
    diff -u -d -r1.18 resman.cpp
     
    5858void ResMan::loadCluDescript(const char *fileName) {
    5959        File resFile;
    6060        resFile.open(fileName);
    61         if (!resFile.isOpen()) {
    62                 // Uh-uh, file not found. Perhaps we're playing straight from CD2?
    63                 // Check the Extra Path.
    64                 const Common::String ePath = ConfMan.get("extrapath");
    65                 resFile.open(fileName, File::kFileReadMode, ePath.c_str());
    66         }
    6761
    6862        if (!resFile.isOpen()) {
    6963                char msg[512];