summaryrefslogtreecommitdiff
path: root/src/openglgraphics.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-09 14:45:27 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-10-18 08:21:32 +0000
commiteb206d0a5a9b8d73b103c094e376c5e13cd4c218 (patch)
tree22b91f5bfd466e1894194822dfbef79550a6b0ef /src/openglgraphics.cpp
parente7790891cf0bd6211b71d084044324a6e95573d8 (diff)
downloadmana-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/openglgraphics.cpp')
-rw-r--r--src/openglgraphics.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 56c16586..cb242ff7 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -154,7 +154,7 @@ void OpenGLGraphics::updateSize(int windowWidth, int windowHeight, float scale)
glOrtho(0.0, (double)mWidth, (double)mHeight, 0.0, -1.0, 1.0);
}
-static inline void drawRescaledQuad(Image *image,
+static inline void drawRescaledQuad(const Image *image,
int srcX, int srcY,
float dstX, float dstY,
int width, int height,
@@ -218,7 +218,7 @@ static inline void drawRescaledQuad(Image *image,
}
-bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY,
+bool OpenGLGraphics::drawRescaledImage(const Image *image, int srcX, int srcY,
int dstX, int dstY,
int width, int height,
int desiredWidth, int desiredHeight,
@@ -229,7 +229,7 @@ bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY,
useColor);
}
-bool OpenGLGraphics::drawRescaledImageF(Image *image, int srcX, int srcY,
+bool OpenGLGraphics::drawRescaledImageF(const Image *image, int srcX, int srcY,
float dstX, float dstY,
int width, int height,
float desiredWidth, float desiredHeight,
@@ -263,7 +263,7 @@ bool OpenGLGraphics::drawRescaledImageF(Image *image, int srcX, int srcY,
return true;
}
-void OpenGLGraphics::drawImagePattern(Image *image, int x, int y, int w, int h)
+void OpenGLGraphics::drawImagePattern(const Image *image, int x, int y, int w, int h)
{
if (!image)
return;
@@ -394,7 +394,7 @@ void OpenGLGraphics::drawImagePattern(Image *image, int x, int y, int w, int h)
static_cast<GLubyte>(mColor.a));
}
-void OpenGLGraphics::drawRescaledImagePattern(Image *image,
+void OpenGLGraphics::drawRescaledImagePattern(const Image *image,
int x, int y,
int w, int h,
int scaledWidth,
@@ -653,7 +653,7 @@ void OpenGLGraphics::popClipArea()
glScissor(x, y, width, height);
}
-void OpenGLGraphics::setColor(const gcn::Color& color)
+void OpenGLGraphics::setColor(const gcn::Color &color)
{
Graphics::setColor(color);
glColor4ub(color.r, color.g, color.b, color.a);
@@ -684,12 +684,12 @@ void OpenGLGraphics::drawLine(int x1, int y1, int x2, int y2)
glEnd();
}
-void OpenGLGraphics::drawRectangle(const gcn::Rectangle& rect)
+void OpenGLGraphics::drawRectangle(const gcn::Rectangle &rect)
{
drawRectangle(rect, false);
}
-void OpenGLGraphics::fillRectangle(const gcn::Rectangle& rect)
+void OpenGLGraphics::fillRectangle(const gcn::Rectangle &rect)
{
drawRectangle(rect, true);
}
@@ -732,7 +732,7 @@ void OpenGLGraphics::setTexturingAndBlending(bool enable)
}
}
-void OpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, bool filled)
+void OpenGLGraphics::drawRectangle(const gcn::Rectangle &rect, bool filled)
{
const float offset = filled ? 0 : 0.5f;