summaryrefslogtreecommitdiff
path: root/src/render/normalopenglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
committerAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
commit1e2a88e975019929c4c7e3154537865cc09550a6 (patch)
treeae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/render/normalopenglgraphics.cpp
parent6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff)
downloadmv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz
mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2
mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz
mv-1e2a88e975019929c4c7e3154537865cc09550a6.zip
Fix some code style issues
Diffstat (limited to 'src/render/normalopenglgraphics.cpp')
-rw-r--r--src/render/normalopenglgraphics.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp
index d3f49fd39..87b6a8a2a 100644
--- a/src/render/normalopenglgraphics.cpp
+++ b/src/render/normalopenglgraphics.cpp
@@ -493,9 +493,6 @@ void NormalOpenGLGraphics::drawImageCached(const Image *restrict const image,
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;
unsigned int vp = mVpCached;
@@ -503,6 +500,9 @@ void NormalOpenGLGraphics::drawImageCached(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;
@@ -567,14 +567,14 @@ void NormalOpenGLGraphics::drawPatternCached(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);
-
unsigned int vp = mVpCached;
const unsigned int vLimit = mMaxVertices * 4;
// 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;
@@ -708,9 +708,6 @@ void NormalOpenGLGraphics::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
@@ -726,6 +723,9 @@ void NormalOpenGLGraphics::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;
@@ -990,8 +990,6 @@ void NormalOpenGLGraphics::calcPatternInline(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;
@@ -1001,6 +999,8 @@ void NormalOpenGLGraphics::calcPatternInline(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;
@@ -1159,9 +1159,6 @@ void NormalOpenGLGraphics::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;
@@ -1172,6 +1169,9 @@ void NormalOpenGLGraphics::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;