aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/resource_rsc.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2009-11-25 20:43:49 +0000
committerEugene Sandulenko2009-11-25 20:43:49 +0000
commit12828d3aafb5c235b47644e1bed4063651dc114b (patch)
treeb3c1ef5e31a4e6fc70ddfc05e6afb5a93053fec1 /engines/saga/resource_rsc.cpp
parent413a048a0605a4d43b33dddd0883face5e2c257c (diff)
downloadscummvm-rg350-12828d3aafb5c235b47644e1bed4063651dc114b.tar.gz
scummvm-rg350-12828d3aafb5c235b47644e1bed4063651dc114b.tar.bz2
scummvm-rg350-12828d3aafb5c235b47644e1bed4063651dc114b.zip
Cache resource file size to avoid excess file->size() calls.
svn-id: r46138
Diffstat (limited to 'engines/saga/resource_rsc.cpp')
-rw-r--r--engines/saga/resource_rsc.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/saga/resource_rsc.cpp b/engines/saga/resource_rsc.cpp
index 17b330ea5e..035db7723a 100644
--- a/engines/saga/resource_rsc.cpp
+++ b/engines/saga/resource_rsc.cpp
@@ -98,7 +98,7 @@ bool Resource_RSC::loadMacContext(ResourceContext *context) {
byte macNameLen;
bool notSagaContext = false;
- if (context->file->size() < RSC_MIN_FILESIZE + MAC_BINARY_HEADER_SIZE) {
+ if (context->fileSize < RSC_MIN_FILESIZE + MAC_BINARY_HEADER_SIZE) {
return false;
}
@@ -128,8 +128,8 @@ bool Resource_RSC::loadMacContext(ResourceContext *context) {
macDataLength = context->file->readUint32BE();
macMapLength = context->file->readUint32BE();
- if (macDataOffset >= (uint)context->file->size() || macMapOffset >= (uint)context->file->size() ||
- macDataLength + macMapLength > (uint)context->file->size()) {
+ if (macDataOffset >= (uint)context->fileSize || macMapOffset >= (uint)context->fileSize ||
+ macDataLength + macMapLength > (uint)context->fileSize) {
return false;
}