From 8eadc834ed3e8439836f7dc87390a56a1164ec11 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Fri, 13 Aug 2010 14:45:52 -0600 Subject: 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 --- src/resources/resourcemanager.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/resources/resourcemanager.h') 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 free(). * - * @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 NULL 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. -- cgit v1.2.3-60-g2f50