summaryrefslogtreecommitdiff
path: root/src/render
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
parent6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff)
downloadManaVerse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz
ManaVerse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2
ManaVerse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz
ManaVerse-1e2a88e975019929c4c7e3154537865cc09550a6.zip
Fix some code style issues
Diffstat (limited to 'src/render')
-rw-r--r--src/render/normalopenglgraphics.cpp28
-rw-r--r--src/render/nullopenglgraphics.cpp18
2 files changed, 23 insertions, 23 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;
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;