aboutsummaryrefslogtreecommitdiff
path: root/graphics/surface.h
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-03 02:22:59 +0200
committerJohannes Schickel2013-08-03 04:02:49 +0200
commitf03dc05847a77661c2978619099ab18c82bb94f7 (patch)
tree066c607210d13fd814bc646753e22718a6487310 /graphics/surface.h
parentdbef9fef3b65cfd74a25ecb8767e1ba396f5b3b1 (diff)
downloadscummvm-rg350-f03dc05847a77661c2978619099ab18c82bb94f7.tar.gz
scummvm-rg350-f03dc05847a77661c2978619099ab18c82bb94f7.tar.bz2
scummvm-rg350-f03dc05847a77661c2978619099ab18c82bb94f7.zip
GRAPHICS: Add an easy way to query 'pixels' of Surface.
This introduced getPixels which is a shortcut for getBasePtr(0, 0).
Diffstat (limited to 'graphics/surface.h')
-rw-r--r--graphics/surface.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/graphics/surface.h b/graphics/surface.h
index 6c9e464657..d685853009 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -78,6 +78,24 @@ struct Surface {
}
/**
+ * Return a pointer to the pixel data.
+ *
+ * @return Pointer to the pixel data.
+ */
+ inline const void *getPixels() const {
+ return pixels;
+ }
+
+ /**
+ * Return a pointer to the pixel data.
+ *
+ * @return Pointer to the pixel data.
+ */
+ inline void *getPixels() {
+ return pixels;
+ }
+
+ /**
* Return a pointer to the pixel at the specified point.
*
* @param x The x coordinate of the pixel.