diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-11-21 04:08:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-11-21 13:19:22 +0300 |
commit | 459c2c3a6decbd5576760040f566f1544645c3ac (patch) | |
tree | 16917971820b11a99acc4f875f977811e4474670 | |
parent | 08d0c6de4aa164c690d94622e4a6a6ea57a9efaf (diff) | |
download | plus-459c2c3a6decbd5576760040f566f1544645c3ac.tar.gz plus-459c2c3a6decbd5576760040f566f1544645c3ac.tar.bz2 plus-459c2c3a6decbd5576760040f566f1544645c3ac.tar.xz plus-459c2c3a6decbd5576760040f566f1544645c3ac.zip |
Add some consts to draw backend.
-rw-r--r-- | src/graphics.cpp | 14 | ||||
-rw-r--r-- | src/graphics.h | 14 | ||||
-rw-r--r-- | src/graphicsvertexes.cpp | 5 | ||||
-rw-r--r-- | src/graphicsvertexes.h | 7 | ||||
-rw-r--r-- | src/mobileopenglgraphics.cpp | 44 | ||||
-rw-r--r-- | src/mobileopenglgraphics.h | 22 | ||||
-rw-r--r-- | src/normalopenglgraphics.cpp | 48 | ||||
-rw-r--r-- | src/normalopenglgraphics.h | 26 | ||||
-rw-r--r-- | src/safeopenglgraphics.cpp | 11 | ||||
-rw-r--r-- | src/safeopenglgraphics.h | 10 |
10 files changed, 107 insertions, 94 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index a0a9a9c12..16a1de4a2 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -369,7 +369,7 @@ bool Graphics::drawImage(const Image *image, int x, int y) } } -bool Graphics::drawRescaledImage(Image *const image, int srcX, int srcY, +bool Graphics::drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, @@ -659,12 +659,12 @@ void Graphics::drawImageRect2(GraphicsVertexes *const vert, } } -void Graphics::drawImagePattern2(GraphicsVertexes *const vert, +void Graphics::drawImagePattern2(const GraphicsVertexes *const vert, const Image *const img) { // here not checking input parameters - std::vector<DoubleRect*> *const arr = vert->getRectsSDL(); + const std::vector<DoubleRect*> *const arr = vert->getRectsSDLconst(); for (std::vector<DoubleRect*>::const_iterator it = arr->begin(), it_end = arr->end(); it != it_end; ++it) @@ -742,7 +742,7 @@ bool Graphics::calcImageRect(GraphicsVertexes *const vert, void Graphics::calcImagePattern(GraphicsVertexes* const vert, const Image *const image, const int x, const int y, - const int w, const int h) + const int w, const int h) const { // Check that preconditions for blitting are met. if (!vert || !mTarget || !image || !image->mSDLSurface || !vert->sdl) @@ -794,11 +794,11 @@ void Graphics::calcImagePattern(GraphicsVertexes* const vert, void Graphics::calcTile(ImageVertexes *const vert A_UNUSED, const Image *const image A_UNUSED, - int x A_UNUSED, int y A_UNUSED) + int x A_UNUSED, int y A_UNUSED) const { } -void Graphics::calcTile(ImageVertexes *const vert, int x, int y) +void Graphics::calcTile(ImageVertexes *const vert, int x, int y) const { // Check that preconditions for blitting are met. if (!vert || !vert->image || !vert->image->mSDLSurface) @@ -828,7 +828,7 @@ void Graphics::calcTile(ImageVertexes *const vert, int x, int y) } } -void Graphics::drawTile(ImageVertexes *const vert) +void Graphics::drawTile(const ImageVertexes *const vert) { // vert and img must be != 0 const Image *const img = vert->image; diff --git a/src/graphics.h b/src/graphics.h index 6ef38350a..7a5dc41a5 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -139,7 +139,7 @@ class Graphics : public gcn::SDLGraphics /** * Draws a resclaled version of the image */ - bool drawRescaledImage(Image *const image, + bool drawRescaledImage(const Image *const image, const int srcX, const int srcY, const int dstX, const int dstY, const int width, const int height, @@ -155,7 +155,7 @@ class Graphics : public gcn::SDLGraphics /** * Draws a resclaled version of the image */ - virtual bool drawRescaledImage(Image *const image, int srcX, + virtual bool drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, @@ -214,19 +214,19 @@ class Graphics : public gcn::SDLGraphics virtual void calcImagePattern(GraphicsVertexes *const vert, const Image *const image, const int x, const int y, - const int w, const int h); + const int w, const int h) const; virtual void calcTile(ImageVertexes *const vert, - const Image *const image, int x, int y); + const Image *const image, int x, int y) const; - virtual void calcTile(ImageVertexes *const vert, int x, int y); + virtual void calcTile(ImageVertexes *const vert, int x, int y) const; - virtual void drawTile(ImageVertexes *const vert); + virtual void drawTile(const ImageVertexes *const vert); virtual void drawImageRect2(GraphicsVertexes *const vert, const ImageRect &imgRect); - virtual void drawImagePattern2(GraphicsVertexes *const vert, + virtual void drawImagePattern2(const GraphicsVertexes *const vert, const Image *const img); bool calcWindow(GraphicsVertexes *const vert, diff --git a/src/graphicsvertexes.cpp b/src/graphicsvertexes.cpp index aefe594fd..3574ffe27 100644 --- a/src/graphicsvertexes.cpp +++ b/src/graphicsvertexes.cpp @@ -270,6 +270,11 @@ std::vector<DoubleRect*> *GraphicsVertexes::getRectsSDL() return &sdl[mPtr].mList; } +const std::vector<DoubleRect*> *GraphicsVertexes::getRectsSDLconst() const +{ + return &sdl[mPtr].mList; +} + ImageVertexes::ImageVertexes() : image(nullptr) { diff --git a/src/graphicsvertexes.h b/src/graphicsvertexes.h index dbec25395..cce9491c1 100644 --- a/src/graphicsvertexes.h +++ b/src/graphicsvertexes.h @@ -146,7 +146,7 @@ class ImageVertexes final ~ImageVertexes(); - Image *image; + const Image *image; DoubleRects sdl; #ifdef USE_OPENGL @@ -181,6 +181,8 @@ class GraphicsVertexes final std::vector<DoubleRect*> *getRectsSDL(); + const std::vector<DoubleRect*> *getRectsSDLconst() const; + void incPtr(const int num = 1) { mPtr += num; } @@ -190,6 +192,9 @@ class GraphicsVertexes final #ifdef USE_OPENGL NormalOpenGLGraphicsVertexes &getOGL() A_WARN_UNUSED { return ogl[mPtr]; } + + const NormalOpenGLGraphicsVertexes &getOGLconst() const A_WARN_UNUSED + { return ogl[mPtr]; } #endif int getX() const A_WARN_UNUSED diff --git a/src/mobileopenglgraphics.cpp b/src/mobileopenglgraphics.cpp index dcfe18a92..0a4029621 100644 --- a/src/mobileopenglgraphics.cpp +++ b/src/mobileopenglgraphics.cpp @@ -220,8 +220,9 @@ bool MobileOpenGLGraphics::drawImage2(const Image *const image, return true; } -bool MobileOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, - int srcY, int dstX, int dstY, +bool MobileOpenGLGraphics::drawRescaledImage(const Image *const image, + int srcX, int srcY, + int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -234,8 +235,9 @@ bool MobileOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, useColor, true); } -bool MobileOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, - int srcY, int dstX, int dstY, +bool MobileOpenGLGraphics::drawRescaledImage(const Image *const image, + int srcX, int srcY, + int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -500,7 +502,8 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, // } } -void MobileOpenGLGraphics::drawImagePattern2(GraphicsVertexes *const vert, +void MobileOpenGLGraphics::drawImagePattern2(const GraphicsVertexes + *const vert, const Image *const image) { if (!image) @@ -513,25 +516,26 @@ void MobileOpenGLGraphics::drawImagePattern2(GraphicsVertexes *const vert, bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); setTexturingAndBlending(true); - drawVertexes(vert->getOGL()); + drawVertexes(vert->getOGLconst()); } -inline void MobileOpenGLGraphics::drawVertexes(NormalOpenGLGraphicsVertexes +inline void MobileOpenGLGraphics::drawVertexes(const + NormalOpenGLGraphicsVertexes &ogl) { - std::vector<GLshort*> &shortVertPool = ogl.mShortVertPool; + const std::vector<GLshort*> &shortVertPool = ogl.mShortVertPool; std::vector<GLshort*>::const_iterator iv; - std::vector<GLshort*>::const_iterator iv_end = shortVertPool.end(); - std::vector<int> &vp = ogl.mVp; + const std::vector<GLshort*>::const_iterator iv_end = shortVertPool.end(); + const std::vector<int> &vp = ogl.mVp; std::vector<int>::const_iterator ivp; - std::vector<int>::const_iterator ivp_end = vp.end(); + const std::vector<int>::const_iterator ivp_end = vp.end(); // Draw a set of textured rectangles // if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) { - std::vector<GLfloat*> &floatTexPool = ogl.mFloatTexPool; + const std::vector<GLfloat*> &floatTexPool = ogl.mFloatTexPool; std::vector<GLfloat*>::const_iterator ft; - std::vector<GLfloat*>::const_iterator ft_end = floatTexPool.end(); + const std::vector<GLfloat*>::const_iterator ft_end = floatTexPool.end(); for (iv = shortVertPool.begin(), ft = floatTexPool.begin(), ivp = vp.begin(); @@ -547,7 +551,7 @@ inline void MobileOpenGLGraphics::drawVertexes(NormalOpenGLGraphicsVertexes void MobileOpenGLGraphics::calcImagePattern(GraphicsVertexes *const vert, const Image *const image, const int x, const int y, - const int w, const int h) + const int w, const int h) const { if (!image) { @@ -651,7 +655,7 @@ void MobileOpenGLGraphics::calcImagePattern(GraphicsVertexes *const vert, void MobileOpenGLGraphics::calcTile(ImageVertexes *const vert, const Image *const image, - int dstX, int dstY) + int dstX, int dstY) const { if (!vert || !image) return; @@ -735,11 +739,11 @@ void MobileOpenGLGraphics::calcTile(ImageVertexes *const vert, ogl.switchVp(vp); } -void MobileOpenGLGraphics::drawTile(ImageVertexes *const vert) +void MobileOpenGLGraphics::drawTile(const ImageVertexes *const vert) { if (!vert) return; - Image *image = vert->image; + const Image *image = vert->image; setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE @@ -1001,7 +1005,7 @@ void MobileOpenGLGraphics::setTexturingAndBlending(bool enable) } void MobileOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, - bool filled) + const bool filled) { BLOCK_START("Graphics::drawRectangle") setTexturingAndBlending(false); @@ -1111,7 +1115,7 @@ void MobileOpenGLGraphics::bindTexture(GLenum target, GLuint texture) } } -inline void MobileOpenGLGraphics::drawTriangleArrayfs(int size) +inline void MobileOpenGLGraphics::drawTriangleArrayfs(const int size) { glVertexPointer(2, GL_SHORT, 0, mShortVertArray); glTexCoordPointer(2, GL_FLOAT, 0, mFloatTexArray); @@ -1137,7 +1141,7 @@ inline void MobileOpenGLGraphics::drawTriangleArrayfs(GLshort *const glDrawArrays(GL_TRIANGLES, 0, size / 2); } -inline void MobileOpenGLGraphics::drawLineArrays(int size) +inline void MobileOpenGLGraphics::drawLineArrays(const int size) { glVertexPointer(2, GL_SHORT, 0, mShortVertArray); diff --git a/src/mobileopenglgraphics.h b/src/mobileopenglgraphics.h index 046fb1f0e..78d24d5fc 100644 --- a/src/mobileopenglgraphics.h +++ b/src/mobileopenglgraphics.h @@ -62,7 +62,7 @@ class MobileOpenGLGraphics final : public Graphics /** * Draws a resclaled version of the image */ - bool drawRescaledImage(Image *const image, int srcX, int srcY, + bool drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -71,7 +71,7 @@ class MobileOpenGLGraphics final : public Graphics /** * Used to get the smooth rescale option over the standard function. */ - bool drawRescaledImage(Image *const image, int srcX, int srcY, + bool drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -93,14 +93,14 @@ class MobileOpenGLGraphics final : public Graphics void calcImagePattern(GraphicsVertexes *const vert, const Image *const image, const int x, const int y, - const int w, const int h) override; + const int w, const int h) const override; void calcTile(ImageVertexes *const vert, const Image *const image, - int x, int y) override; + int x, int y) const override; - void drawTile(ImageVertexes *const vert) override; + void drawTile(const ImageVertexes *const vert) override; - void drawImagePattern2(GraphicsVertexes *const vert, + void drawImagePattern2(const GraphicsVertexes *const vert, const Image *const image) override; void updateScreen() override; @@ -119,7 +119,7 @@ class MobileOpenGLGraphics final : public Graphics void drawLine(int x1, int y1, int x2, int y2); - void drawRectangle(const gcn::Rectangle &rect, bool filled); + void drawRectangle(const gcn::Rectangle &rect, const bool filled); void drawRectangle(const gcn::Rectangle &rect); @@ -131,11 +131,11 @@ class MobileOpenGLGraphics final : public Graphics GLfloat *floatTexArray, const int size); - inline void drawTriangleArrayfs(int size); + inline void drawTriangleArrayfs(const int size); - inline void drawLineArrays(int size); + inline void drawLineArrays(const int size); - inline void drawVertexes(NormalOpenGLGraphicsVertexes &ogl); + inline void drawVertexes(const NormalOpenGLGraphicsVertexes &ogl); void initArrays() override; @@ -177,8 +177,6 @@ class MobileOpenGLGraphics final : public Graphics void setTexturingAndBlending(bool enable); - void logString(const char *format, GLenum num); - void updateMemoryInfo(); void debugBindTexture(const Image *image); diff --git a/src/normalopenglgraphics.cpp b/src/normalopenglgraphics.cpp index 188a57d69..eff2a62b9 100644 --- a/src/normalopenglgraphics.cpp +++ b/src/normalopenglgraphics.cpp @@ -263,7 +263,7 @@ bool NormalOpenGLGraphics::drawImage2(const Image *const image, return true; } -bool NormalOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, +bool NormalOpenGLGraphics::drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, @@ -277,8 +277,9 @@ bool NormalOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, useColor, true); } -bool NormalOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, - int srcY, int dstX, int dstY, +bool NormalOpenGLGraphics::drawRescaledImage(const Image *const image, + int srcX, int srcY, + int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -618,7 +619,7 @@ void NormalOpenGLGraphics::drawRescaledImagePattern(const Image *const image, } } -void NormalOpenGLGraphics::drawImagePattern2(GraphicsVertexes *const vert, +void NormalOpenGLGraphics::drawImagePattern2(const GraphicsVertexes *const vert, const Image *const image) { if (!image) @@ -631,25 +632,26 @@ void NormalOpenGLGraphics::drawImagePattern2(GraphicsVertexes *const vert, bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); setTexturingAndBlending(true); - drawVertexes(vert->getOGL()); + drawVertexes(vert->getOGLconst()); } -inline void NormalOpenGLGraphics::drawVertexes(NormalOpenGLGraphicsVertexes +inline void NormalOpenGLGraphics::drawVertexes(const + NormalOpenGLGraphicsVertexes &ogl) { - std::vector<GLint*> &intVertPool = ogl.mIntVertPool; + const std::vector<GLint*> &intVertPool = ogl.mIntVertPool; std::vector<GLint*>::const_iterator iv; - std::vector<GLint*>::const_iterator iv_end = intVertPool.end(); - std::vector<int> &vp = ogl.mVp; + const std::vector<GLint*>::const_iterator iv_end = intVertPool.end(); + const std::vector<int> &vp = ogl.mVp; std::vector<int>::const_iterator ivp; - std::vector<int>::const_iterator ivp_end = vp.end(); + const std::vector<int>::const_iterator ivp_end = vp.end(); // Draw a set of textured rectangles if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) { - std::vector<GLfloat*> &floatTexPool = ogl.mFloatTexPool; + const std::vector<GLfloat*> &floatTexPool = ogl.mFloatTexPool; std::vector<GLfloat*>::const_iterator ft; - std::vector<GLfloat*>::const_iterator ft_end = floatTexPool.end(); + const std::vector<GLfloat*>::const_iterator ft_end = floatTexPool.end(); for (iv = intVertPool.begin(), ft = floatTexPool.begin(), ivp = vp.begin(); @@ -662,9 +664,9 @@ inline void NormalOpenGLGraphics::drawVertexes(NormalOpenGLGraphicsVertexes } else { - std::vector<GLint*> &intTexPool = ogl.mIntTexPool; + const std::vector<GLint*> &intTexPool = ogl.mIntTexPool; std::vector<GLint*>::const_iterator it; - std::vector<GLint*>::const_iterator it_end = intTexPool.end(); + const std::vector<GLint*>::const_iterator it_end = intTexPool.end(); for (iv = intVertPool.begin(), it = intTexPool.begin(), ivp = vp.begin(); @@ -680,7 +682,7 @@ inline void NormalOpenGLGraphics::drawVertexes(NormalOpenGLGraphicsVertexes void NormalOpenGLGraphics::calcImagePattern(GraphicsVertexes *const vert, const Image *const image, const int x, const int y, - const int w, const int h) + const int w, const int h) const { if (!image) { @@ -820,7 +822,7 @@ void NormalOpenGLGraphics::calcImagePattern(GraphicsVertexes *const vert, void NormalOpenGLGraphics::calcTile(ImageVertexes *const vert, const Image *const image, - int dstX, int dstY) + int dstX, int dstY) const { if (!vert || !image) return; @@ -930,11 +932,11 @@ void NormalOpenGLGraphics::calcTile(ImageVertexes *const vert, ogl.switchVp(vp); } -void NormalOpenGLGraphics::drawTile(ImageVertexes *const vert) +void NormalOpenGLGraphics::drawTile(const ImageVertexes *const vert) { if (!vert) return; - Image *image = vert->image; + const Image *image = vert->image; setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE @@ -1196,7 +1198,7 @@ void NormalOpenGLGraphics::setTexturingAndBlending(bool enable) } void NormalOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, - bool filled) + const bool filled) { BLOCK_START("Graphics::drawRectangle") const float offset = filled ? 0 : 0.5f; @@ -1286,7 +1288,7 @@ void NormalOpenGLGraphics::bindTexture(GLenum target, GLuint texture) } } -inline void NormalOpenGLGraphics::drawQuadArrayfi(int size) +inline void NormalOpenGLGraphics::drawQuadArrayfi(const int size) { glVertexPointer(2, GL_INT, 0, mIntVertArray); glTexCoordPointer(2, GL_FLOAT, 0, mFloatTexArray); @@ -1310,7 +1312,7 @@ inline void NormalOpenGLGraphics::drawQuadArrayfi(GLint *const intVertArray, glDrawArrays(GL_QUADS, 0, size / 2); } -inline void NormalOpenGLGraphics::drawQuadArrayii(int size) +inline void NormalOpenGLGraphics::drawQuadArrayii(const int size) { glVertexPointer(2, GL_INT, 0, mIntVertArray); glTexCoordPointer(2, GL_INT, 0, mIntTexArray); @@ -1334,7 +1336,7 @@ inline void NormalOpenGLGraphics::drawQuadArrayii(GLint *const intVertArray, glDrawArrays(GL_QUADS, 0, size / 2); } -inline void NormalOpenGLGraphics::drawLineArrayi(int size) +inline void NormalOpenGLGraphics::drawLineArrayi(const int size) { glVertexPointer(2, GL_INT, 0, mIntVertArray); @@ -1344,7 +1346,7 @@ inline void NormalOpenGLGraphics::drawLineArrayi(int size) glDrawArrays(GL_LINES, 0, size / 2); } -inline void NormalOpenGLGraphics::drawLineArrayf(int size) +inline void NormalOpenGLGraphics::drawLineArrayf(const int size) { glVertexPointer(2, GL_FLOAT, 0, mFloatTexArray); diff --git a/src/normalopenglgraphics.h b/src/normalopenglgraphics.h index 5894aa957..0c5bb40ac 100644 --- a/src/normalopenglgraphics.h +++ b/src/normalopenglgraphics.h @@ -62,7 +62,7 @@ class NormalOpenGLGraphics final : public Graphics /** * Draws a resclaled version of the image */ - bool drawRescaledImage(Image *const image, int srcX, int srcY, + bool drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -71,7 +71,7 @@ class NormalOpenGLGraphics final : public Graphics /** * Used to get the smooth rescale option over the standard function. */ - bool drawRescaledImage(Image *const image, int srcX, int srcY, + bool drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -93,14 +93,14 @@ class NormalOpenGLGraphics final : public Graphics void calcImagePattern(GraphicsVertexes *const vert, const Image *const image, const int x, const int y, - const int w, const int h) override; + const int w, const int h) const override; void calcTile(ImageVertexes *const vert, const Image *const image, - int x, int y) override; + int x, int y) const override; - void drawTile(ImageVertexes *const vert) override; + void drawTile(const ImageVertexes *const vert) override; - void drawImagePattern2(GraphicsVertexes *const vert, + void drawImagePattern2(const GraphicsVertexes *const vert, const Image *const image) override; void updateScreen() override; @@ -119,7 +119,7 @@ class NormalOpenGLGraphics final : public Graphics void drawLine(int x1, int y1, int x2, int y2); - void drawRectangle(const gcn::Rectangle &rect, bool filled); + void drawRectangle(const gcn::Rectangle &rect, const bool filled); void drawRectangle(const gcn::Rectangle &rect); @@ -127,23 +127,23 @@ class NormalOpenGLGraphics final : public Graphics void setTargetPlane(int width, int height); - inline void drawQuadArrayfi(int size); + inline void drawQuadArrayfi(const int size); inline void drawQuadArrayfi(GLint *intVertArray, GLfloat *floatTexArray, const int size); - inline void drawQuadArrayii(int size); + inline void drawQuadArrayii(const int size); inline void drawQuadArrayii(GLint *intVertArray, GLint *intTexArray, const int size); - inline void drawLineArrayi(int size); + inline void drawLineArrayi(const int size); - inline void drawLineArrayf(int size); + inline void drawLineArrayf(const int size); - inline void drawVertexes(NormalOpenGLGraphicsVertexes &ogl); + inline void drawVertexes(const NormalOpenGLGraphicsVertexes &ogl); void initArrays() override; @@ -185,8 +185,6 @@ class NormalOpenGLGraphics final : public Graphics void setTexturingAndBlending(bool enable); - void logString(const char *format, GLenum num); - void updateMemoryInfo(); void debugBindTexture(const Image *image); diff --git a/src/safeopenglgraphics.cpp b/src/safeopenglgraphics.cpp index 9ca2340d0..6142627f1 100644 --- a/src/safeopenglgraphics.cpp +++ b/src/safeopenglgraphics.cpp @@ -169,7 +169,7 @@ bool SafeOpenGLGraphics::drawImage2(const Image *const image, return true; } -bool SafeOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, +bool SafeOpenGLGraphics::drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, @@ -183,7 +183,7 @@ bool SafeOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, useColor, true); } -bool SafeOpenGLGraphics::drawRescaledImage(Image *const image, int srcX, +bool SafeOpenGLGraphics::drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, @@ -355,11 +355,11 @@ bool SafeOpenGLGraphics::calcImageRect(GraphicsVertexes *const vert, void SafeOpenGLGraphics::calcTile(ImageVertexes *const vert A_UNUSED, const Image *const image A_UNUSED, - int x A_UNUSED, int y A_UNUSED) + int x A_UNUSED, int y A_UNUSED) const { } -void SafeOpenGLGraphics::drawTile(ImageVertexes *const vert A_UNUSED) +void SafeOpenGLGraphics::drawTile(const ImageVertexes *const vert A_UNUSED) { } @@ -592,7 +592,8 @@ void SafeOpenGLGraphics::setTexturingAndBlending(bool enable) } } -void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, bool filled) +void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, + const bool filled) { BLOCK_START("Graphics::drawRectangle") const float offset = filled ? 0 : 0.5f; diff --git a/src/safeopenglgraphics.h b/src/safeopenglgraphics.h index b377874ad..1b84689df 100644 --- a/src/safeopenglgraphics.h +++ b/src/safeopenglgraphics.h @@ -55,7 +55,7 @@ class SafeOpenGLGraphics final : public Graphics /** * Draws a resclaled version of the image */ - bool drawRescaledImage(Image *const image, int srcX, int srcY, + bool drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -64,7 +64,7 @@ class SafeOpenGLGraphics final : public Graphics /** * Used to get the smooth rescale option over the standard function. */ - bool drawRescaledImage(Image *const image, int srcX, int srcY, + bool drawRescaledImage(const Image *const image, int srcX, int srcY, int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, @@ -100,9 +100,9 @@ class SafeOpenGLGraphics final : public Graphics const ImageRect &imgRect) override; void calcTile(ImageVertexes *const vert, const Image *const image, - int x, int y) override; + int x, int y) const override; - void drawTile(ImageVertexes *const vert) override; + void drawTile(const ImageVertexes *const vert) override; void updateScreen() override; @@ -120,7 +120,7 @@ class SafeOpenGLGraphics final : public Graphics void drawLine(int x1, int y1, int x2, int y2); - void drawRectangle(const gcn::Rectangle &rect, bool filled); + void drawRectangle(const gcn::Rectangle &rect, const bool filled); void drawRectangle(const gcn::Rectangle &rect); |