From 1e2a88e975019929c4c7e3154537865cc09550a6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 23 Feb 2020 09:30:51 +0300 Subject: Fix some code style issues --- src/render/nullopenglgraphics.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/render/nullopenglgraphics.cpp') diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 81a65d82a..6a97e77e1 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -271,9 +271,6 @@ void NullOpenGLGraphics::drawPatternInline(const Image *restrict const image, if (iw == 0 || ih == 0) return; - const float tw = static_cast(image->mTexWidth); - const float th = static_cast(image->mTexHeight); - setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE @@ -289,6 +286,9 @@ void NullOpenGLGraphics::drawPatternInline(const Image *restrict const image, // Draw a set of textured rectangles if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) { + const float tw = static_cast(image->mTexWidth); + const float th = static_cast(image->mTexHeight); + const float texX1 = static_cast(srcX) / tw; const float texY1 = static_cast(srcY) / th; @@ -610,9 +610,6 @@ void NullOpenGLGraphics::calcPatternInline(ImageVertexes *restrict const vert, const int srcX = imageRect.x; const int srcY = imageRect.y; - const float tw = static_cast(image->mTexWidth); - const float th = static_cast(image->mTexHeight); - const unsigned int vLimit = mMaxVertices * 4; OpenGLGraphicsVertexes &ogl = vert->ogl; @@ -621,6 +618,9 @@ void NullOpenGLGraphics::calcPatternInline(ImageVertexes *restrict const vert, // Draw a set of textured rectangles if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) { + const float tw = static_cast(image->mTexWidth); + const float th = static_cast(image->mTexHeight); + const float texX1 = static_cast(srcX) / tw; const float texY1 = static_cast(srcY) / th; @@ -816,9 +816,6 @@ void NullOpenGLGraphics::calcTileVertexesInline(ImageVertexes * const int srcX = imageRect.x; const int srcY = imageRect.y; - const float tw = static_cast(image->mTexWidth); - const float th = static_cast(image->mTexHeight); - const unsigned int vLimit = mMaxVertices * 4; OpenGLGraphicsVertexes &ogl = vert->ogl; @@ -829,6 +826,9 @@ void NullOpenGLGraphics::calcTileVertexesInline(ImageVertexes * // Draw a set of textured rectangles if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) { + const float tw = static_cast(image->mTexWidth); + const float th = static_cast(image->mTexHeight); + const float texX1 = static_cast(srcX) / tw; const float texY1 = static_cast(srcY) / th; -- cgit v1.2.3-60-g2f50