aboutsummaryrefslogtreecommitdiff
path: root/graphics/surface.h
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-03 03:42:37 +0200
committerJohannes Schickel2013-08-03 04:02:54 +0200
commit260ec7a430b34f75ec6c30f0f8f444bb7397341e (patch)
tree21f0d8db06474c2219fad4489f66a80b5e62d734 /graphics/surface.h
parent767f0d8ca9114ea05cc1e8c5dc1940cc9718c306 (diff)
downloadscummvm-rg350-260ec7a430b34f75ec6c30f0f8f444bb7397341e.tar.gz
scummvm-rg350-260ec7a430b34f75ec6c30f0f8f444bb7397341e.tar.bz2
scummvm-rg350-260ec7a430b34f75ec6c30f0f8f444bb7397341e.zip
GRAPHICS: Add two new methods to change 'pixels' of a Surface.
One method is a simpler setter for 'pixels'. The other one can be used to setup a Surface with custom data.
Diffstat (limited to 'graphics/surface.h')
-rw-r--r--graphics/surface.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/graphics/surface.h b/graphics/surface.h
index d685853009..8ce2cf3ecc 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -96,6 +96,15 @@ struct Surface {
}
/**
+ * Sets the pixel data.
+ *
+ * Note that this is a simply setter. Be careful what you are doing!
+ *
+ * @param newPixels The new pixel data.
+ */
+ void setPixels(void *newPixels) { pixels = newPixels; }
+
+ /**
* Return a pointer to the pixel at the specified point.
*
* @param x The x coordinate of the pixel.
@@ -140,6 +149,20 @@ struct Surface {
void free();
/**
+ * Set up the Surface with user specified data.
+ *
+ * Note that this simply sets the 'internal' attributes of the Surface. It
+ * will not take care of freeing old data via free or similar!
+ *
+ * @param width Width of the pixel data.
+ * @param height Height of the pixel data.
+ * @param pitch The pitch of the pixel data.
+ * @param pixels The pixel data itself.
+ * @param format The pixel format of the pixel data.
+ */
+ void init(uint16 width, uint16 height, uint16 pitch, void *pixels, const PixelFormat &format);
+
+ /**
* Copy the data from another Surface.
*
* Note that this calls free on the current surface, to assure it being