From 6b3b516f9e2cd690e5af34a7307c483494426ac0 Mon Sep 17 00:00:00 2001 From: Chris Apers Date: Sat, 3 Jun 2006 11:16:48 +0000 Subject: Added missing functions and fixed saving with AGI engine svn-id: r22865 --- backends/PalmOS/Src/be_save.cpp | 20 +++++++++++++++++--- backends/PalmOS/Src/extend.cpp | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'backends') 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()); -- cgit v1.2.3