Ticket #7993: simonsave.2.diff

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

Corrected patch against a July 29 snapshot

  • scummvm/saveload.cpp

    diff -ur ScummVM-cvs20020729/scummvm/saveload.cpp ScummVM-cvs20020729+simon/scummvm/saveload.cpp
    old new  
    164164        return true;
    165165}
    166166
    167 void Scumm::makeSavegameName(char *out, int slot, bool compatible)
     167const char *Scumm::getSavegameDir()
    168168{
    169 
    170169        const char *dir = NULL;
    171170
    172171#ifdef _WIN32_WCE
     
    190189                dir = "";
    191190#endif
    192191
     192        return dir;
     193}
     194
     195void Scumm::makeSavegameName(char *out, int slot, bool compatible)
     196{
    193197        // 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);
     198        sprintf(out, "%s%s.%c%.2d", getSavegameDir(), _exe_name, compatible ? 'c' : 's', slot);
    195199}
    196200
    197201bool Scumm::getSavegameName(int slot, char *desc)
  • scummvm/scumm.h

    diff -ur ScummVM-cvs20020729/scummvm/scumm.h ScummVM-cvs20020729+simon/scummvm/scumm.h
    old new  
    485485        void saveOrLoad(Serializer *s);
    486486
    487487        bool getSavegameName(int slot, char *desc);
     488        const char *getSavegameDir();
    488489        void makeSavegameName(char *out, int slot, bool compatible);
    489490        void saveLoadResource(Serializer *ser, int type, int index);
    490491
  • scummvm/simon/simon.cpp

    diff -ur ScummVM-cvs20020729/scummvm/simon/simon.cpp ScummVM-cvs20020729+simon/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}
    44534445