Ticket #7993: simonsave.diff

File simonsave.diff, 2.1 KB (added by eriktorbjorn, 22 years ago)

Patch made against a July 27 snapshot

  • scummvm/saveload.cpp

    diff -ur ScummVM-cvs20020727/scummvm/saveload.cpp ScummVM-cvs20020727+hack/scummvm/saveload.cpp
    old new  
    164164        return true;
    165165}
    166166
    167 void Scumm::makeSavegameName(char *out, int slot, bool compatible)
     167char *Scumm::getSavegameDir()
    168168{
    169 
    170169        const char *dir = NULL;
    171170
    172171#ifdef _WIN32_WCE
     
    189188        if (dir == NULL)
    190189                dir = "";
    191190#endif
     191}
    192192
     193void Scumm::makeSavegameName(char *out, int slot, bool compatible)
     194{
    193195        // snprintf should be used here, but it's not portable enough
    194         sprintf(out, "%s%s.%c%.2d", dir, _exe_name, compatible ? 'c' : 's', slot);
     196        sprintf(out, "%s%s.%c%.2d", getSavegameDir(), _exe_name, compatible ? 'c' : 's', slot);
    195197}
    196198
    197199bool Scumm::getSavegameName(int slot, char *desc)
  • scummvm/scumm.h

    diff -ur ScummVM-cvs20020727/scummvm/scumm.h ScummVM-cvs20020727+hack/scummvm/scumm.h
    old new  
    477477        void saveOrLoad(Serializer *s);
    478478
    479479        bool getSavegameName(int slot, char *desc);
     480        char *getSavegameDir();
    480481        void makeSavegameName(char *out, int slot, bool compatible);
    481482        void saveLoadResource(Serializer *ser, int type, int index);
    482483
  • scummvm/simon/simon.cpp

    diff -ur ScummVM-cvs20020727/scummvm/simon/simon.cpp ScummVM-cvs20020727+hack/scummvm/simon/simon.cpp
    old new  
    2020 */
    2121
    2222#include "stdafx.h"
     23#include "scumm.h"
    2324#include "simon.h"
    2425#include <errno.h>
    2526
     
    44364437char *SimonState::gen_savename(int slot)
    44374438{
    44384439        static char buf[256];
    4439         const char *dir;
    44404440
    4441         /* perhaps getenv should be added to OSystem */
    4442 #ifndef _WIN32_WCE
    4443         dir = getenv("SCUMMVM_SAVEPATH");
    4444         if (dir == NULL)
    4445                 dir = "";
    4446 #else
    4447         dir = _game_path;
    4448 #endif
    4449 
    4450         sprintf(buf, "%sSAVE.%.3d", dir, slot);
     4441        // snprintf should be used here, but it's not portable enough
     4442        sprintf(buf, "%sSAVE.%.3d", g_scumm->getSavegameDir(), slot);
    44514443        return buf;
    44524444}