From 4eea727b7649726670d8963d11ab4fd429624b3e Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Sun, 29 Jul 2012 22:08:40 +0200 Subject: Graphics: take only const pointers to images. Acked-by: Erik Schilling --- src/graphics.cpp | 6 +++--- src/graphics.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/graphics.cpp b/src/graphics.cpp index 7b56d974..8bd16faa 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -146,7 +146,7 @@ int Graphics::getHeight() const return mHeight; } -bool Graphics::drawImage(Image *image, int x, int y) +bool Graphics::drawImage(const Image *image, int x, int y) { if (image) return drawImage(image, 0, 0, x, y, image->mBounds.w, image->mBounds.h); @@ -193,7 +193,7 @@ bool Graphics::drawRescaledImage(Image *image, int srcX, int srcY, return returnValue; } -bool Graphics::drawImage(Image *image, int srcX, int srcY, int dstX, int dstY, +bool Graphics::drawImage(const Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height, bool) { // Check that preconditions for blitting are met. @@ -228,7 +228,7 @@ void Graphics::drawImage(gcn::Image const *image, int srcX, int srcY, drawImage(srcImage->getImage(), srcX, srcY, dstX, dstY, width, height, true); } -void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h) +void Graphics::drawImagePattern(const Image *image, int x, int y, int w, int h) { // Check that preconditions for blitting are met. if (!mTarget || !image) diff --git a/src/graphics.h b/src/graphics.h index 6a17aab4..c70e7978 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -99,7 +99,7 @@ class Graphics : public gcn::SDLGraphics * @return true if the image was blitted properly * false otherwise. */ - bool drawImage(Image *image, int x, int y); + bool drawImage(const Image *image, int x, int y); /** * Overrides with our own drawing method. @@ -135,13 +135,13 @@ class Graphics : public gcn::SDLGraphics * @return true if the image was blitted properly * false otherwise. */ - virtual bool drawImage(Image *image, + virtual bool drawImage(const Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height, bool useColor = false); - virtual void drawImagePattern(Image *image, + virtual void drawImagePattern(const Image *image, int x, int y, int w, int h); -- cgit v1.2.3-60-g2f50