diff options
author | Andrei Karas <akaras@inbox.ru> | 2020-02-23 09:30:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2020-02-23 09:30:51 +0300 |
commit | 1e2a88e975019929c4c7e3154537865cc09550a6 (patch) | |
tree | ae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/render/nullopenglgraphics.cpp | |
parent | 6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff) | |
download | manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2 manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.zip |
Fix some code style issues
Diffstat (limited to 'src/render/nullopenglgraphics.cpp')
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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<float>(image->mTexWidth); - const float th = static_cast<float>(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<float>(image->mTexWidth); + const float th = static_cast<float>(image->mTexHeight); + const float texX1 = static_cast<float>(srcX) / tw; const float texY1 = static_cast<float>(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<float>(image->mTexWidth); - const float th = static_cast<float>(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<float>(image->mTexWidth); + const float th = static_cast<float>(image->mTexHeight); + const float texX1 = static_cast<float>(srcX) / tw; const float texY1 = static_cast<float>(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<float>(image->mTexWidth); - const float th = static_cast<float>(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<float>(image->mTexWidth); + const float th = static_cast<float>(image->mTexHeight); + const float texX1 = static_cast<float>(srcX) / tw; const float texY1 = static_cast<float>(srcY) / th; |