diff options
author | Johannes Schickel | 2013-08-03 03:42:37 +0200 |
---|---|---|
committer | Johannes Schickel | 2013-08-03 04:02:54 +0200 |
commit | 260ec7a430b34f75ec6c30f0f8f444bb7397341e (patch) | |
tree | 21f0d8db06474c2219fad4489f66a80b5e62d734 /graphics/surface.cpp | |
parent | 767f0d8ca9114ea05cc1e8c5dc1940cc9718c306 (diff) | |
download | scummvm-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.cpp')
-rw-r--r-- | graphics/surface.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/graphics/surface.cpp b/graphics/surface.cpp index 010389c9fa..728c6db12c 100644 --- a/graphics/surface.cpp +++ b/graphics/surface.cpp @@ -82,6 +82,14 @@ void Surface::free() { format = PixelFormat(); } +void Surface::init(uint16 width, uint16 height, uint16 newPitch, void *newPixels, const PixelFormat &f) { + w = width; + h = height; + pitch = newPitch; + pixels = newPixels; + format = f; +} + void Surface::copyFrom(const Surface &surf) { create(surf.w, surf.h, surf.format); if (surf.pitch == pitch) { |