aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/queen/resource.cpp10
-rw-r--r--engines/queen/resource.h2
2 files changed, 3 insertions, 9 deletions
diff --git a/engines/queen/resource.cpp b/engines/queen/resource.cpp
index 6f75439376..753ca1ff4e 100644
--- a/engines/queen/resource.cpp
+++ b/engines/queen/resource.cpp
@@ -107,7 +107,7 @@ ResourceEntry *Resource::resourceEntry(const char *filename) const {
return re;
}
-uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size, bool useMalloc) {
+uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size) {
ResourceEntry *re = resourceEntry(filename);
assert(re != NULL);
uint32 sz = re->size - skipBytes;
@@ -115,13 +115,7 @@ uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size,
*size = sz;
}
- byte *dstBuf;
- if (useMalloc) {
- dstBuf = (byte *)malloc(sz);
- } else {
- dstBuf = new byte[sz];
- }
-
+ byte *dstBuf = new byte[sz];
_resourceFile.seek(re->offset + skipBytes);
_resourceFile.read(dstBuf, sz);
return dstBuf;
diff --git a/engines/queen/resource.h b/engines/queen/resource.h
index 3ff5c1e2fc..98b4ef46fb 100644
--- a/engines/queen/resource.h
+++ b/engines/queen/resource.h
@@ -65,7 +65,7 @@ public:
~Resource();
//! loads the specified from the resource file
- uint8 *loadFile(const char *filename, uint32 skipBytes = 0, uint32 *size = NULL, bool useMalloc = false);
+ uint8 *loadFile(const char *filename, uint32 skipBytes = 0, uint32 *size = NULL);
//! returns true if the file is present in the resource
bool fileExists(const char *filename) const { return resourceEntry(filename) != NULL; }