diff options
author | Johannes Schickel | 2007-07-29 17:21:21 +0000 |
---|---|---|
committer | Johannes Schickel | 2007-07-29 17:21:21 +0000 |
commit | 65abeadcf60f730856f1222573189f2605507729 (patch) | |
tree | ec695339dc0112d4cfb4973527ad300983cc93cf | |
parent | 4fd3678713757620a4f4d2a7f6e408375995fdf0 (diff) | |
download | scummvm-rg350-65abeadcf60f730856f1222573189f2605507729.tar.gz scummvm-rg350-65abeadcf60f730856f1222573189f2605507729.tar.bz2 scummvm-rg350-65abeadcf60f730856f1222573189f2605507729.zip |
Fixed bug in Resource::getFileHandle.
svn-id: r28306
-rw-r--r-- | engines/kyra/resource.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index fa333bf8bd..b8d7eb3f64 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -220,8 +220,11 @@ uint8 *Resource::fileData(const char *file, uint32 *size) const { bool Resource::getFileHandle(const char *file, uint32 *size, Common::File &filehandle) { filehandle.close(); - if (filehandle.open(file)) + if (filehandle.open(file)) { + if (size) + *size = filehandle.size(); return true; + } uint fileHash = Common::hashit_lower(file); for (ResIterator start = _pakfiles.begin() ;start != _pakfiles.end(); ++start) { @@ -229,12 +232,14 @@ bool Resource::getFileHandle(const char *file, uint32 *size, Common::File &fileh continue; if ((*start)->getFileHandle(fileHash, filehandle)) { - - *size = (*start)->getFileSize(fileHash); + uint32 tSize = (*start)->getFileSize(fileHash); - if (!(*size)) + if (!tSize) continue; + if (size) + *size = tSize; + return true; } } |