summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-13 14:45:52 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-13 18:43:16 -0600
commit8eadc834ed3e8439836f7dc87390a56a1164ec11 (patch)
tree36cf9915914517b137d488a40d1f61265867723d /src/resources/resourcemanager.h
parent6d315d0e61f419636021476582a49ab0b1f1b5e9 (diff)
downloadmana-8eadc834ed3e8439836f7dc87390a56a1164ec11.tar.gz
mana-8eadc834ed3e8439836f7dc87390a56a1164ec11.tar.bz2
mana-8eadc834ed3e8439836f7dc87390a56a1164ec11.tar.xz
mana-8eadc834ed3e8439836f7dc87390a56a1164ec11.zip
Simplify handling of compressed files
ResourceManager will now check for ".gz" and act appropriately (unless told not to). Compression handling functions are now in new utils/zlib files, along with a function to load a file from drive, uncompressing it if it ends in ".gz". Reviewed-by: Freeyorp
Diffstat (limited to 'src/resources/resourcemanager.h')
-rw-r--r--src/resources/resourcemanager.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index e1aed521..28ab4725 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -183,13 +183,16 @@ class ResourceManager
* Allocates data into a buffer pointer for raw data loading. The
* returned data is expected to be freed using <code>free()</code>.
*
- * @param fileName The name of the file to be loaded.
- * @param fileSize The size of the file that was loaded.
+ * @param filename The name of the file to be loaded.
+ * @param filesize The size of the file that was loaded.
+ * @param inflate True to uncompress the file if the filename ends in
+ * ".gz", false to ignore that.
*
* @return An allocated byte array containing the data that was loaded,
* or <code>NULL</code> on fail.
*/
- void *loadFile(const std::string &fileName, int &fileSize);
+ void *loadFile(const std::string &filename, int &filesize,
+ bool inflate = true);
/**
* Retrieves the contents of a text file.