summaryrefslogtreecommitdiff
path: root/src/resources/image.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-01-22 18:31:25 +0100
committerAndrei Karas <akaras@inbox.ru>2012-01-24 21:46:13 +0300
commitb4e47fb41a19ca09c02bcd009b28cb7c3caa2256 (patch)
treeeada17175623f6281a83aced143bb0940758a547 /src/resources/image.h
parent80f61e80228aa0fa617961a4ec30d954fcb15eba (diff)
downloadmv-b4e47fb41a19ca09c02bcd009b28cb7c3caa2256.tar.gz
mv-b4e47fb41a19ca09c02bcd009b28cb7c3caa2256.tar.bz2
mv-b4e47fb41a19ca09c02bcd009b28cb7c3caa2256.tar.xz
mv-b4e47fb41a19ca09c02bcd009b28cb7c3caa2256.zip
Use SDL_RWops directly on top of PhysFS
This avoids the creation of a temporary buffer containing a complete file for the sole purpose of wrapping it up in an SDL_RWops. The necessary wrapper is by Ryan C. Gordon and is included in the PhysFS repository under 'extras'. Reviewed-by: Yohann Ferreira Conflicts: mana.files src/CMakeLists.txt src/resources/resourcemanager.cpp src/resources/soundeffect.cpp
Diffstat (limited to 'src/resources/image.h')
-rw-r--r--src/resources/image.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/resources/image.h b/src/resources/image.h
index a9f5722cd..d22ed4be2 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -66,28 +66,25 @@ class Image : public Resource
virtual ~Image();
/**
- * Loads an image from a buffer in memory.
+ * Loads an image from an SDL_RWops structure.
*
- * @param buffer The memory buffer containing the image data.
- * @param bufferSize The size of the memory buffer in bytes.
+ * @param rw The SDL_RWops to load the image from.
*
* @return <code>NULL</code> if an error occurred, a valid pointer
* otherwise.
*/
- static Resource *load(void *buffer, unsigned bufferSize);
+ static Resource *load(SDL_RWops *rw);
/**
- * Loads an image from a buffer in memory and recolors it.
+ * Loads an image from an SDL_RWops structure and recolors it.
*
- * @param buffer The memory buffer containing the image data.
- * @param bufferSize The size of the memory buffer in bytes.
+ * @param rw The SDL_RWops to load the image from.
* @param dye The dye used to recolor the image.
*
* @return <code>NULL</code> if an error occurred, a valid pointer
* otherwise.
*/
- static Resource *load(void *buffer, unsigned bufferSize,
- Dye const &dye);
+ static Resource *load(SDL_RWops *rw, Dye const &dye);
/**
* Loads an image from an SDL surface.