Ticket #8973: ps2-trunk.patch

File ps2-trunk.patch, 4.9 KB (added by SF/mac_es, 15 years ago)
  • backends/platform/ps2/savefilemgr.h

    =================================================================== 
     
    2626#ifndef __SAVEFILEMGR_H__
    2727#define __SAVEFILEMGR_H__
    2828
    29 // #include "common/savefile.h"
     29//#include "common/savefile.h"
    3030#include "backends/saves/default/default-saves.h"
     31#include "common/zlib.h"
    3132
    3233class Gs2dScreen;
    3334class OSystem_PS2;
  • backends/platform/ps2/savefilemgr.cpp

    =================================================================== 
     
    2424 */
    2525
    2626#include "common/config-manager.h"
    27 #include "backends/saves/compressed/compressed-saves.h"
     27
    2828
    2929#ifdef __USE_LIBMC__
    3030        #include <libmc.h>
     
    124124                if(!file.exists())
    125125                        return NULL;
    126126
    127                 sf = file.openForReading();
     127                sf = file.createReadStream ();
    128128
    129129        } else {
    130130                Common::FSNode file = savePath.getChild(filename);
     
    132132                if(!file.exists())
    133133                        return NULL;
    134134
    135                 sf = file.openForReading();
     135                sf = file.createReadStream ();
    136136        }
    137137
    138138        // _screen->wantAnim(false);
    139139
    140         return wrapInSaveFile(sf);
     140        return Common::wrapCompressedReadStream(sf);
    141141}
    142142
    143143Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const char *filename) {
     
    177177                }
    178178
    179179                Common::FSNode file(path);
    180                 sf = file.openForWriting();
     180                sf = file.createWriteStream();
    181181                free(game);
    182182                free(ext);
    183183        } else {
    184184                Common::FSNode file = savePath.getChild(filename);
    185                 sf = file.openForWriting();
     185                sf = file.createWriteStream();
    186186        }
    187187
    188188        _screen->wantAnim(false);
    189         return wrapOutSaveFile(sf);
     189        return Common::wrapCompressedWriteStream(sf);
    190190}
    191191
    192192bool Ps2SaveFileManager::removeSavefile(const char *filename) {
  • backends/platform/ps2/systemps2.h

    =================================================================== 
     
    2626#ifndef SYSTEMPS2_H
    2727#define SYSTEMPS2_H
    2828
    29 #include "common/system.h"
     29#include "backends/base-backend.h"
     30#include "graphics/colormasks.h"
     31#include "backends/events/default/default-events.h"
    3032
    3133class DefaultTimerManager;
    3234class DefaultSaveFileManager;
     
    5355        class MixerImpl;
    5456};
    5557
    56 class OSystem_PS2 : public OSystem {
     58class OSystem_PS2 : public BaseBackend {
    5759public:
    5860        OSystem_PS2(const char *elfPath);
    5961        virtual ~OSystem_PS2(void);
     
    108110
    109111        virtual void quit();
    110112
    111         virtual Common::SeekableReadStream *openConfigFileForReading();
    112         virtual Common::WriteStream *openConfigFileForWriting();
     113        virtual Common::SeekableReadStream *createConfigReadStream ();
     114        virtual Common::WriteStream *createConfigWriteStream ();
    113115
    114116        virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<1555>(); }
    115117
     
    134136        bool runningFromHost(void);
    135137        int getBootDevice() { return _bootDevice; }
    136138
     139        virtual int16 getOverlayHeight()  { return getHeight(); }
     140        virtual int16 getOverlayWidth()   { return getWidth(); }
     141       
     142
    137143private:
    138144        void startIrxModules(int numModules, IrxReference *modules);
    139145
  • backends/platform/ps2/systemps2.cpp

    =================================================================== 
     
    945945        _configFile = strdup(path);
    946946}
    947947
    948 Common::SeekableReadStream *OSystem_PS2::openConfigFileForReading() {
     948Common::SeekableReadStream *OSystem_PS2::createConfigReadStream () {
    949949        Common::FSNode file(_configFile);
    950         return file.openForReading();
     950        return file.createReadStream();
    951951}
    952952   
    953 Common::WriteStream *OSystem_PS2::openConfigFileForWriting() {
     953Common::WriteStream *OSystem_PS2::createConfigWriteStream () {
    954954        Common::FSNode file(_configFile);
    955         return file.openForWriting();
     955        return file.createWriteStream();
    956956}
     957
     958
     959       
  • backends/fs/ps2/ps2-fs.cpp

    =================================================================== 
     
    111111        virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
    112112        virtual AbstractFSNode *getParent() const;
    113113
    114         virtual Common::SeekableReadStream *openForReading();
    115         virtual Common::WriteStream *openForWriting();
     114        virtual Common::SeekableReadStream *createReadStream();
     115        virtual Common::WriteStream *createWriteStream();
    116116
    117117        int getDev() { return 0; };
    118118};
     
    503503                return "WTF ???";
    504504}
    505505
    506 Common::SeekableReadStream *Ps2FilesystemNode::openForReading() {
     506Common::SeekableReadStream *Ps2FilesystemNode::createReadStream() {
    507507        Common::SeekableReadStream *ss = StdioStream::makeFromPath(getPath().c_str(), false);
    508508        return ss;
    509509}
    510510
    511 Common::WriteStream *Ps2FilesystemNode::openForWriting() {
     511Common::WriteStream *Ps2FilesystemNode::createWriteStream() {
    512512        return StdioStream::makeFromPath(getPath().c_str(), true);
    513513}