diff options
author | Chris Apers | 2006-06-03 11:16:48 +0000 |
---|---|---|
committer | Chris Apers | 2006-06-03 11:16:48 +0000 |
commit | 6b3b516f9e2cd690e5af34a7307c483494426ac0 (patch) | |
tree | 140131c81370cfdeeaf4a6638fd3cdc49d556e9a | |
parent | 3a78221832188dd42d7f96c884fc20650d982286 (diff) | |
download | scummvm-rg350-6b3b516f9e2cd690e5af34a7307c483494426ac0.tar.gz scummvm-rg350-6b3b516f9e2cd690e5af34a7307c483494426ac0.tar.bz2 scummvm-rg350-6b3b516f9e2cd690e5af34a7307c483494426ac0.zip |
Added missing functions and fixed saving with AGI engine
svn-id: r22865
-rwxr-xr-x | backends/PalmOS/Src/be_save.cpp | 20 | ||||
-rw-r--r-- | backends/PalmOS/Src/extend.cpp | 2 |
2 files changed, 18 insertions, 4 deletions
diff --git a/backends/PalmOS/Src/be_save.cpp b/backends/PalmOS/Src/be_save.cpp index 9842edfd72..f905a1a522 100755 --- a/backends/PalmOS/Src/be_save.cpp +++ b/backends/PalmOS/Src/be_save.cpp @@ -46,9 +46,22 @@ public: uint32 read(void *buf, uint32 size); uint32 write(const void *buf, uint32 size); - - void skip(uint32 offset) { - ::fseek(fh, offset, SEEK_CUR); + + uint32 pos() const { + assert(fh); + return ftell(fh); + } + uint32 size() const { + assert(fh); + uint32 oldPos = ftell(fh); + fseek(fh, 0, SEEK_END); + uint32 length = ftell(fh); + fseek(fh, oldPos, SEEK_SET); + return length; + } + void seek(int32 offs, int whence = SEEK_SET) { + assert(fh); + fseek(fh, offs, whence); } }; @@ -90,6 +103,7 @@ Common::SaveFile *PalmSaveFileManager::openSavefile(const char *filename, bool s char buf[256]; strncpy(buf, getSavePath(), sizeof(buf)); + strncat(buf, "/", 1); strncat(buf, filename, sizeof(buf)); return makeSaveFile(buf, saveOrLoad); diff --git a/backends/PalmOS/Src/extend.cpp b/backends/PalmOS/Src/extend.cpp index 302f414a81..297eb28c16 100644 --- a/backends/PalmOS/Src/extend.cpp +++ b/backends/PalmOS/Src/extend.cpp @@ -27,7 +27,7 @@ #include "modulesrsc.h" -const Char *SCUMMVM_SAVEPATH = "/PALM/Programs/ScummVM/Saved/"; +const Char *SCUMMVM_SAVEPATH = "/PALM/Programs/ScummVM/Saved"; void PalmFatalError(const Char *err) { WinSetDrawWindow(WinGetDisplayWindow()); |