aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/script_v80he.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-03-23 02:55:07 +0000
committerTravis Howell2007-03-23 02:55:07 +0000
commit5057c1b5c845a9cc4620ee82e609074eea3d4c8a (patch)
tree5cc3541ec4f0e1668c4f49242c482af49452530c /engines/scumm/he/script_v80he.cpp
parent989f7b67cb918c609a68b74955f2131ae682e96e (diff)
downloadscummvm-rg350-5057c1b5c845a9cc4620ee82e609074eea3d4c8a.tar.gz
scummvm-rg350-5057c1b5c845a9cc4620ee82e609074eea3d4c8a.tar.bz2
scummvm-rg350-5057c1b5c845a9cc4620ee82e609074eea3d4c8a.zip
Change getFileSize opcode, to check for files via SaveFileManager too. Fixes loading the high score table in the mini game of SPY Fox 2.
svn-id: r26279
Diffstat (limited to 'engines/scumm/he/script_v80he.cpp')
-rw-r--r--engines/scumm/he/script_v80he.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp
index ca1c7fd839..1d7cc37e33 100644
--- a/engines/scumm/he/script_v80he.cpp
+++ b/engines/scumm/he/script_v80he.cpp
@@ -25,6 +25,7 @@
#include "common/config-file.h"
#include "common/config-manager.h"
+#include "common/savefile.h"
#include "common/str.h"
#include "scumm/actor.h"
@@ -403,13 +404,20 @@ void ScummEngine_v80he::o80_getFileSize() {
copyScriptString(filename, sizeof(filename));
convertFilePath(filename);
- Common::File f;
- if (!f.open((char *)filename)) {
+ Common::SeekableReadStream *f = _saveFileMan->openForLoading((const char *)filename);
+ if (!f) {
+ Common::File *file = new Common::File();
+ file->open((const char *)filename, Common::File::kFileReadMode);
+ f = file;
+ }
+
+ if (!f) {
push(-1);
} else {
- push(f.size());
- f.close();
+ push(f->size());
}
+
+ delete f;
}
void ScummEngine_v80he::o80_stringToInt() {