aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/resource.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2007-07-29 17:21:21 +0000
committerJohannes Schickel2007-07-29 17:21:21 +0000
commit65abeadcf60f730856f1222573189f2605507729 (patch)
treeec695339dc0112d4cfb4973527ad300983cc93cf /engines/kyra/resource.cpp
parent4fd3678713757620a4f4d2a7f6e408375995fdf0 (diff)
downloadscummvm-rg350-65abeadcf60f730856f1222573189f2605507729.tar.gz
scummvm-rg350-65abeadcf60f730856f1222573189f2605507729.tar.bz2
scummvm-rg350-65abeadcf60f730856f1222573189f2605507729.zip
Fixed bug in Resource::getFileHandle.
svn-id: r28306
Diffstat (limited to 'engines/kyra/resource.cpp')
-rw-r--r--engines/kyra/resource.cpp13
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;
}
}