From 7e8e9bf3d1e718758298b8fb5ccc6a0f296d5b9c Mon Sep 17 00:00:00 2001 From: richiesams Date: Wed, 14 Aug 2013 19:42:56 -0500 Subject: GRAPHICS: Create copyRectToSurface member function --- graphics/surface.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'graphics/surface.h') diff --git a/graphics/surface.h b/graphics/surface.h index b08d4a5cb7..ad52ed8238 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -208,6 +208,19 @@ 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 x The x coordinate of the destination rectangle + * @param y 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 pitch, int x, int y, int width, int height); + /** * Convert the data to another pixel format. * -- cgit v1.2.3 From 6f4e80e36e7729bd2137a1a2bde712521861b0b3 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Thu, 12 Sep 2013 09:30:28 -0500 Subject: ZVISION: Add wrapper function for copyRectToSurface Also rename some arguments to make them more clear --- graphics/surface.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'graphics/surface.h') diff --git a/graphics/surface.h b/graphics/surface.h index ad52ed8238..1492e71e68 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -214,12 +214,23 @@ public: * * @param buffer The buffer containing the graphics data source * @param pitch The pitch of the buffer (number of bytes in a scanline) - * @param x The x coordinate of the destination rectangle - * @param y The y coordinate of the destination rectangle + * @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 pitch, int x, int y, int width, int height); + void copyRectToSurface(const void *buffer, int pitch, 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. -- cgit v1.2.3 From 701250efb57ef94e35d2b7b6f0d6d045b713e6f5 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Sun, 22 Sep 2013 15:53:15 -0500 Subject: GRAPHICS: Remove variable shadowing --- graphics/surface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphics/surface.h') diff --git a/graphics/surface.h b/graphics/surface.h index 1492e71e68..07e289b0bb 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -219,7 +219,7 @@ public: * @param width The width of the destination rectangle * @param height The height of the destination rectangle */ - void copyRectToSurface(const void *buffer, int pitch, int destX, int destY, int width, int height); + 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. -- cgit v1.2.3