aboutsummaryrefslogtreecommitdiff
path: root/backends/dc
diff options
context:
space:
mode:
authorMax Horn2004-06-25 22:11:48 +0000
committerMax Horn2004-06-25 22:11:48 +0000
commite5f90509a606819dec58b7642c9845373ae364d5 (patch)
treeb892289fd90878d306be42c236c18f6ea6bbf269 /backends/dc
parentde7c36f063eb4ee33b01bfb7be4186c7cb9fd704 (diff)
downloadscummvm-rg350-e5f90509a606819dec58b7642c9845373ae364d5.tar.gz
scummvm-rg350-e5f90509a606819dec58b7642c9845373ae364d5.tar.bz2
scummvm-rg350-e5f90509a606819dec58b7642c9845373ae364d5.zip
Cleaned up SaveFileManager stuff a little bit
svn-id: r14056
Diffstat (limited to 'backends/dc')
-rw-r--r--backends/dc/vmsave.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/backends/dc/vmsave.cpp b/backends/dc/vmsave.cpp
index b80742ee07..d695ae2638 100644
--- a/backends/dc/vmsave.cpp
+++ b/backends/dc/vmsave.cpp
@@ -222,9 +222,8 @@ private:
int pos, size;
char filename[16];
-protected:
- virtual int fread(void *buf, int size, int cnt);
- virtual int fwrite(const void *buf, int size, int cnt);
+ uint32 read(void *buf, uint32 cnt);
+ uint32 write(const void *buf, uint32 cnt);
public:
VMSave(const char *_filename, bool _saveOrLoad)
@@ -258,6 +257,7 @@ public:
};
class VMSaveManager : public SaveFileManager {
+public:
virtual SaveFile *open_savefile(const char *filename, const char *directory, bool saveOrLoad);
virtual void list_savefiles(const char *prefix, const char *directory, bool *marks, int num);
};
@@ -299,15 +299,15 @@ VMSave::~VMSave()
delete buffer;
}
-int VMSave::fread(void *buf, int sz, int cnt)
+uint32 VMSave::read(void *buf, uint32 cnt)
{
if (issave)
return -1;
- int nbyt = sz*cnt;
+ int nbyt = cnt;
if (pos + nbyt > size) {
- cnt = (size - pos)/sz;
- nbyt = sz*cnt;
+ cnt = (size - pos);
+ nbyt = cnt;
}
if (nbyt)
memcpy(buf, buffer + pos, nbyt);
@@ -315,15 +315,15 @@ int VMSave::fread(void *buf, int sz, int cnt)
return cnt;
}
-int VMSave::fwrite(const void *buf, int sz, int cnt)
+uint32 VMSave::write(const void *buf, uint32 cnt)
{
if (!issave)
return -1;
- int nbyt = sz*cnt;
+ int nbyt = cnt;
if (pos + nbyt > size) {
- cnt = (size - pos)/sz;
- nbyt = sz*cnt;
+ cnt = (size - pos);
+ nbyt = cnt;
}
if (nbyt)
memcpy(buffer + pos, buf, nbyt);