diff options
Diffstat (limited to 'graphics/surface.h')
-rw-r--r-- | graphics/surface.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/graphics/surface.h b/graphics/surface.h index b08d4a5cb7..f1b2aa64ab 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -209,6 +209,30 @@ public: const Surface getSubArea(const Common::Rect &area) const; /** + * Copies a bitmap to the Surface internal buffer. The pixel format + * of buffer must match the pixel format of the Surface. + * + * @param buffer The buffer containing the graphics data source + * @param pitch The pitch of the buffer (number of bytes in a scanline) + * @param destX The x coordinate of the destination rectangle + * @param destY The y coordinate of the destination rectangle + * @param width The width of the destination rectangle + * @param height The height of the destination rectangle + */ + void copyRectToSurface(const void *buffer, int srcPitch, int destX, int destY, int width, int height); + /** + * Copies a bitmap to the Surface internal buffer. The pixel format + * of buffer must match the pixel format of the Surface. + * + * @param srcSurface The source of the bitmap data + * @param destX The x coordinate of the destination rectangle + * @param destY The y coordinate of the destination rectangle + * @param subRect The subRect of surface to be blitted + * @return + */ + void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect subRect); + + /** * Convert the data to another pixel format. * * This works in-place. This means it will not create an additional buffer @@ -310,7 +334,9 @@ public: */ struct SharedPtrSurfaceDeleter { void operator()(Surface *ptr) { - ptr->free(); + if (ptr) { + ptr->free(); + } delete ptr; } }; |