From 5a1007fa3e827c03bb86db71cb26dfd4c485f28d Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 14 Jan 2005 12:43:28 +0000 Subject: Extended Image with methods to get width, height and draw a pattern and made Window widget use it. --- src/resources/image.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/resources/image.h') diff --git a/src/resources/image.h b/src/resources/image.h index 363dabde..8f956324 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -62,6 +62,16 @@ class Image : public Resource */ void unload(); + /** + * Returns the width of the image. + */ + int getWidth(); + + /** + * Returns the height of the image. + */ + int getHeight(); + /** * Creates a new image with the desired clipping rectangle. * @return NULL if creation failed and a valid @@ -70,12 +80,18 @@ class Image : public Resource Image* createSubImage(int x, int y, int width, int height); /** - * Attempts to blit the internal image onto the screen. + * Blits the internal image onto the screen. + * * @return true if the image was blitted properly - * false otherwise. + * false otherwise. */ bool draw(BITMAP *screen, int x, int y); + /** + * Does a pattern fill on the given area. + */ + void drawPattern(BITMAP *screen, int x, int y, int w, int h); + protected: //SDL_Rect screenRect; //SDL_Surface *image; -- cgit v1.2.3-70-g09d2