diff options
author | Joost Peters | 2003-10-28 13:27:37 +0000 |
---|---|---|
committer | Joost Peters | 2003-10-28 13:27:37 +0000 |
commit | 31a8ef2e7fd276e8b78f61bbc7bd013abd2e784a (patch) | |
tree | cb614adef906772941b9634764a9a73d5b2c1939 /queen | |
parent | e02fe63f2eab159ab9f35fe270e10435665c9d6b (diff) | |
download | scummvm-rg350-31a8ef2e7fd276e8b78f61bbc7bd013abd2e784a.tar.gz scummvm-rg350-31a8ef2e7fd276e8b78f61bbc7bd013abd2e784a.tar.bz2 scummvm-rg350-31a8ef2e7fd276e8b78f61bbc7bd013abd2e784a.zip |
cleanup
svn-id: r10989
Diffstat (limited to 'queen')
-rw-r--r-- | queen/resource.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/queen/resource.cpp b/queen/resource.cpp index ed3ef1071d..8c29c35456 100644 --- a/queen/resource.cpp +++ b/queen/resource.cpp @@ -142,23 +142,17 @@ uint32 Resource::fileOffset(const char *filename) { } uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, byte *dstBuf) { - uint32 size = fileSize(filename); + uint32 size = fileSize(filename) - skipBytes; if (dstBuf == NULL) dstBuf = new byte[size]; // skip 'skipBytes' bytes (useful for headers) _resourceFile->seek(fileOffset(filename) + skipBytes, SEEK_SET); - _resourceFile->read(dstBuf, size - skipBytes); + _resourceFile->read(dstBuf, size); return dstBuf; } uint8 *Resource::loadFileMalloc(const char *filename, uint32 skipBytes, byte *dstBuf) { - uint32 size = fileSize(filename); - if (dstBuf == NULL) - dstBuf = (byte *)malloc(size); - // skip 'skipBytes' bytes (useful for headers) - _resourceFile->seek(fileOffset(filename) + skipBytes, SEEK_SET); - _resourceFile->read(dstBuf, size - skipBytes); - return dstBuf; + return loadFile(filename, skipBytes, (byte *)malloc(fileSize(filename) - skipBytes)); } bool Resource::exists(const char *filename) { |