diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-04-09 14:45:27 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-10-18 08:21:32 +0000 |
commit | eb206d0a5a9b8d73b103c094e376c5e13cd4c218 (patch) | |
tree | 22b91f5bfd466e1894194822dfbef79550a6b0ef /src/graphics.cpp | |
parent | e7790891cf0bd6211b71d084044324a6e95573d8 (diff) | |
download | mana-eb206d0a5a9b8d73b103c094e376c5e13cd4c218.tar.gz mana-eb206d0a5a9b8d73b103c094e376c5e13cd4c218.tar.bz2 mana-eb206d0a5a9b8d73b103c094e376c5e13cd4c218.tar.xz mana-eb206d0a5a9b8d73b103c094e376c5e13cd4c218.zip |
Take only const pointers to images in Graphics
Helps making sure we're not modifying the images in the rendering code.
Re-applies 4eea727b7649726670d8963d11ab4fd429624b3e (and reverts
363f71157a8107190b3bd2ba656faf0a0e63ab36).
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r-- | src/graphics.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index 13089b0c..afdac4f6 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -39,7 +39,7 @@ void Graphics::updateSize(int width, int height, float /*scale*/) mHeight = height; } -bool Graphics::drawImage(Image *image, int x, int y) +bool Graphics::drawImage(const Image *image, int x, int y) { if (!image) return false; @@ -47,7 +47,7 @@ bool Graphics::drawImage(Image *image, int x, int y) return drawImage(image, 0, 0, x, y, image->getWidth(), image->getHeight()); } -bool Graphics::drawImageF(Image *image, float x, float y) +bool Graphics::drawImageF(const Image *image, float x, float y) { if (!image) return false; @@ -55,7 +55,7 @@ bool Graphics::drawImageF(Image *image, float x, float y) return drawImageF(image, 0, 0, x, y, image->getWidth(), image->getHeight()); } -bool Graphics::drawRescaledImageF(Image *image, int srcX, int srcY, float dstX, float dstY, int width, int height, float desiredWidth, float desiredHeight, bool useColor) +bool Graphics::drawRescaledImageF(const Image *image, int srcX, int srcY, float dstX, float dstY, int width, int height, float desiredWidth, float desiredHeight, bool useColor) { return drawRescaledImage(image, srcX, srcY, @@ -67,7 +67,7 @@ bool Graphics::drawRescaledImageF(Image *image, int srcX, int srcY, float dstX, useColor); } -bool Graphics::drawImage(Image *image, +bool Graphics::drawImage(const Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height, @@ -80,7 +80,7 @@ bool Graphics::drawImage(Image *image, width, height, useColor); } -bool Graphics::drawImageF(Image *image, int srcX, int srcY, float dstX, float dstY, int width, int height, bool useColor) +bool Graphics::drawImageF(const Image *image, int srcX, int srcY, float dstX, float dstY, int width, int height, bool useColor) { return drawRescaledImageF(image, srcX, srcY, @@ -89,7 +89,7 @@ bool Graphics::drawImageF(Image *image, int srcX, int srcY, float dstX, float ds width, height, useColor); } -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) { if (!image) return; @@ -99,11 +99,11 @@ void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h) } void Graphics::drawImageRect(int x, int y, int w, int h, - Image *topLeft, Image *topRight, - Image *bottomLeft, Image *bottomRight, - Image *top, Image *right, - Image *bottom, Image *left, - Image *center) + const Image *topLeft, const Image *topRight, + const Image *bottomLeft, const Image *bottomRight, + const Image *top, const Image *right, + const Image *bottom, const Image *left, + const Image *center) { pushClipArea(gcn::Rectangle(x, y, w, h)); |