diff options
author | Joost Peters | 2003-09-29 22:27:08 +0000 |
---|---|---|
committer | Joost Peters | 2003-09-29 22:27:08 +0000 |
commit | 0c93377f5d4e8dd8e8f40fc6505630f439d232f5 (patch) | |
tree | 835c5ca3874ad270aec098ebe88e34fe6f3cbd60 /queen/resource.cpp | |
parent | e342878f84aaeaa43625e584ff8c89c95f7d2c52 (diff) | |
download | scummvm-rg350-0c93377f5d4e8dd8e8f40fc6505630f439d232f5.tar.gz scummvm-rg350-0c93377f5d4e8dd8e8f40fc6505630f439d232f5.tar.bz2 scummvm-rg350-0c93377f5d4e8dd8e8f40fc6505630f439d232f5.zip |
added BANK code from Gregory + minor change to loadFile()
svn-id: r10491
Diffstat (limited to 'queen/resource.cpp')
-rw-r--r-- | queen/resource.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/queen/resource.cpp b/queen/resource.cpp index aca4fb0f2c..1a0e7345f9 100644 --- a/queen/resource.cpp +++ b/queen/resource.cpp @@ -115,15 +115,19 @@ uint32 QueenResource::fileOffset(const char *filename) { return _gameVersion->resourceTable[resourceIndex(filename)].offset; } -uint8 *QueenResource::loadFile(const char *filename) { +uint8 *QueenResource::loadFile(const char *filename, uint32 skipBytes) { uint32 size = fileSize(filename); byte *mem = new byte[size]; - //skip 20 byte header - _resourceFile->seek(fileOffset(filename) + 20, SEEK_SET); - _resourceFile->read(mem, size - 20); + // skip 'skipBytes' bytes (useful for headers) + _resourceFile->seek(fileOffset(filename) + skipBytes, SEEK_SET); + _resourceFile->read(mem, size - skipBytes); return mem; } +bool QueenResource::exists(const char *filename) { + return resourceIndex(filename) >= 0; +} + const char *QueenResource::JASVersion() { static char versionStr[6]; if (_gameVersion->isDemo) |