diff options
author | Johannes Schickel | 2013-08-03 02:22:59 +0200 |
---|---|---|
committer | Johannes Schickel | 2013-08-03 04:02:49 +0200 |
commit | f03dc05847a77661c2978619099ab18c82bb94f7 (patch) | |
tree | 066c607210d13fd814bc646753e22718a6487310 /graphics/surface.h | |
parent | dbef9fef3b65cfd74a25ecb8767e1ba396f5b3b1 (diff) | |
download | scummvm-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.h | 18 |
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. |