diff options
author | Travis Howell | 2007-03-23 02:55:07 +0000 |
---|---|---|
committer | Travis Howell | 2007-03-23 02:55:07 +0000 |
commit | 5057c1b5c845a9cc4620ee82e609074eea3d4c8a (patch) | |
tree | 5cc3541ec4f0e1668c4f49242c482af49452530c /engines/scumm | |
parent | 989f7b67cb918c609a68b74955f2131ae682e96e (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/scumm/he/script_v80he.cpp | 16 |
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() { |