summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/graphics.cpp18
-rw-r--r--src/render/mobileopengl2graphics.cpp58
-rw-r--r--src/render/mobileopenglgraphics.cpp2
-rw-r--r--src/render/modernopenglgraphics.cpp26
-rw-r--r--src/render/normalopenglgraphics.cpp10
-rw-r--r--src/render/safeopenglgraphics.cpp8
-rw-r--r--src/render/sdlgraphics.cpp6
-rw-r--r--src/render/shaders/shader.cpp2
-rw-r--r--src/render/shaders/shaderprogram.cpp2
-rw-r--r--src/render/shaders/shadersmanager.cpp2
10 files changed, 67 insertions, 67 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index 9b584f9bb..42b313bd4 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -516,23 +516,23 @@ bool Graphics::videoInfo() restrict2
return false;
logger->log("Possible to create hardware surfaces: %s",
- ((vi->hw_available) != 0u ? "yes" : "no"));
+ ((vi->hw_available) != 0U ? "yes" : "no"));
logger->log("Window manager available: %s",
- ((vi->wm_available) != 0u ? "yes" : "no"));
+ ((vi->wm_available) != 0U ? "yes" : "no"));
logger->log("Accelerated hardware to hardware blits: %s",
- ((vi->blit_hw) != 0u ? "yes" : "no"));
+ ((vi->blit_hw) != 0U ? "yes" : "no"));
logger->log("Accelerated hardware to hardware colorkey blits: %s",
- ((vi->blit_hw_CC) != 0u ? "yes" : "no"));
+ ((vi->blit_hw_CC) != 0U ? "yes" : "no"));
logger->log("Accelerated hardware to hardware alpha blits: %s",
- ((vi->blit_hw_A) != 0u ? "yes" : "no"));
+ ((vi->blit_hw_A) != 0U ? "yes" : "no"));
logger->log("Accelerated software to hardware blits: %s",
- ((vi->blit_sw) != 0u ? "yes" : "no"));
+ ((vi->blit_sw) != 0U ? "yes" : "no"));
logger->log("Accelerated software to hardware colorkey blits: %s",
- ((vi->blit_sw_CC) != 0u ? "yes" : "no"));
+ ((vi->blit_sw_CC) != 0U ? "yes" : "no"));
logger->log("Accelerated software to hardware alpha blits: %s",
- ((vi->blit_sw_A) != 0u ? "yes" : "no"));
+ ((vi->blit_sw_A) != 0U ? "yes" : "no"));
logger->log("Accelerated color fills: %s",
- ((vi->blit_fill) != 0u ? "yes" : "no"));
+ ((vi->blit_fill) != 0U ? "yes" : "no"));
#endif // USE_SDL2
return true;
diff --git a/src/render/mobileopengl2graphics.cpp b/src/render/mobileopengl2graphics.cpp
index 36f6263d1..73579005a 100644
--- a/src/render/mobileopengl2graphics.cpp
+++ b/src/render/mobileopengl2graphics.cpp
@@ -129,10 +129,10 @@ MobileOpenGL2Graphics::~MobileOpenGL2Graphics()
void MobileOpenGL2Graphics::deleteGLObjects() restrict2
{
delete2(mProgram);
- if (mVbo != 0u)
+ if (mVbo != 0U)
mglDeleteBuffers(1, &mVbo);
#ifndef __native_client__
- if (mVao != 0u)
+ if (mVao != 0U)
mglDeleteVertexArrays(1, &mVao);
#endif // __native_client__
}
@@ -172,7 +172,7 @@ void MobileOpenGL2Graphics::postInit() restrict2
logger->safeError("Shader creation error. See manaplus.log.");
}
mProgramId = mProgram->getProgramId();
- if (mProgramId == 0u)
+ if (mProgramId == 0U)
logger->safeError("Shaders compilation error.");
logger->log("Shaders compilation done.");
@@ -186,19 +186,19 @@ void MobileOpenGL2Graphics::postInit() restrict2
mTextureColorUniform = mglGetUniformLocation(mProgramId, "alpha");
mTextureSizeUniform = mglGetUniformLocation(mProgramId, "textureSize");
- mglUniform1f(mTextureColorUniform, 1.0f);
+ mglUniform1f(mTextureColorUniform, 1.0F);
mglVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, nullptr);
mglEnableVertexAttribArray(0);
mAttributesBinded = mVbo;
mglUniform2f(mScreenUniform,
- static_cast<float>(mWidth) / 2.0f,
- static_cast<float>(mHeight) / 2.0f);
+ static_cast<float>(mWidth) / 2.0F,
+ static_cast<float>(mHeight) / 2.0F);
// for safty init texture size to 1x1
mglUniform2f(mTextureSizeUniform,
- 1.0f,
- 1.0f);
+ 1.0F,
+ 1.0F);
mglUniform4f(mSimpleColorUniform,
0.0F,
0.0F,
@@ -946,7 +946,7 @@ void MobileOpenGL2Graphics::drawPoint(int x, int y) restrict2
const ClipRect &clipArea = mClipStack.top();
GLfloat vertices[] =
{
- toGL(x + clipArea.xOffset), toGL(y + clipArea.yOffset), 0.0f, 0.0f
+ toGL(x + clipArea.xOffset), toGL(y + clipArea.yOffset), 0.0F, 0.0F
};
mglBufferData(GL_ARRAY_BUFFER, sizeof(vertices),
vertices, GL_STREAM_DRAW);
@@ -967,8 +967,8 @@ void MobileOpenGL2Graphics::drawLine(int x1, int y1,
const ClipRect &clipArea = mClipStack.top();
GLfloat vertices[] =
{
- toGL(x1 + clipArea.xOffset), toGL(y1 + clipArea.yOffset), 0.0f, 0.0f,
- toGL(x2 + clipArea.xOffset), toGL(y2 + clipArea.yOffset), 0.0f, 0.0f
+ toGL(x1 + clipArea.xOffset), toGL(y1 + clipArea.yOffset), 0.0F, 0.0F,
+ toGL(x2 + clipArea.xOffset), toGL(y2 + clipArea.yOffset), 0.0F, 0.0F
};
mglBufferData(GL_ARRAY_BUFFER, sizeof(vertices),
vertices, GL_STREAM_DRAW);
@@ -992,10 +992,10 @@ void MobileOpenGL2Graphics::drawRectangle(const Rect &restrict rect) restrict2
const GLfloat y2 = y1 + static_cast<GLfloat>(rect.height);
GLfloat vertices[] =
{
- x1, y1, 0.0f, 0.0f,
- x1, y2, 0.0f, 0.0f,
- x2, y2, 0.0f, 0.0f,
- x2, y1, 0.0f, 0.0f
+ x1, y1, 0.0F, 0.0F,
+ x1, y2, 0.0F, 0.0F,
+ x2, y2, 0.0F, 0.0F,
+ x2, y1, 0.0F, 0.0F
};
mglBufferData(GL_ARRAY_BUFFER, sizeof(vertices),
@@ -1020,10 +1020,10 @@ void MobileOpenGL2Graphics::fillRectangle(const Rect &restrict rect) restrict2
const GLfloat y2 = y1 + static_cast<GLfloat>(rect.height);
GLfloat vertices[] =
{
- x1, y1, 0.0f, 0.0f,
- x2, y1, 0.0f, 0.0f,
- x1, y2, 0.0f, 0.0f,
- x2, y2, 0.0f, 0.0f
+ x1, y1, 0.0F, 0.0F,
+ x2, y1, 0.0F, 0.0F,
+ x1, y2, 0.0F, 0.0F,
+ x2, y2, 0.0F, 0.0F
};
mglBufferData(GL_ARRAY_BUFFER, sizeof(vertices),
@@ -1042,7 +1042,7 @@ void MobileOpenGL2Graphics::enableTexturingAndBlending() restrict2
if (!mTextureDraw)
{
mTextureDraw = true;
- mglUniform1f(mDrawTypeUniform, 1.0f);
+ mglUniform1f(mDrawTypeUniform, 1.0F);
}
if (!mAlpha)
{
@@ -1056,7 +1056,7 @@ void MobileOpenGL2Graphics::disableTexturingAndBlending() restrict2
if (mTextureDraw)
{
mTextureDraw = false;
- mglUniform1f(mDrawTypeUniform, 0.0f);
+ mglUniform1f(mDrawTypeUniform, 0.0F);
}
if (mAlpha && !mColorAlpha)
{
@@ -1100,13 +1100,13 @@ void MobileOpenGL2Graphics::drawNet(const int x1,
{
mFloatArray[vp + 0] = xs1;
mFloatArray[vp + 1] = toGL(y);
- mFloatArray[vp + 2] = 0.0f;
- mFloatArray[vp + 3] = 0.0f;
+ mFloatArray[vp + 2] = 0.0F;
+ mFloatArray[vp + 3] = 0.0F;
mFloatArray[vp + 4] = xs2;
mFloatArray[vp + 5] = toGL(y);
- mFloatArray[vp + 6] = 0.0f;
- mFloatArray[vp + 7] = 0.0f;
+ mFloatArray[vp + 6] = 0.0F;
+ mFloatArray[vp + 7] = 0.0F;
vp += 8;
if (vp >= vLimit)
@@ -1120,13 +1120,13 @@ void MobileOpenGL2Graphics::drawNet(const int x1,
{
mFloatArray[vp + 0] = toGL(x);
mFloatArray[vp + 1] = ys1;
- mFloatArray[vp + 2] = 0.0f;
- mFloatArray[vp + 3] = 0.0f;
+ mFloatArray[vp + 2] = 0.0F;
+ mFloatArray[vp + 3] = 0.0F;
mFloatArray[vp + 4] = toGL(x);
mFloatArray[vp + 5] = ys2;
- mFloatArray[vp + 6] = 0.0f;
- mFloatArray[vp + 7] = 0.0f;
+ mFloatArray[vp + 6] = 0.0F;
+ mFloatArray[vp + 7] = 0.0F;
vp += 8;
if (vp >= vLimit)
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp
index cf5d7b83a..c8cbb7bba 100644
--- a/src/render/mobileopenglgraphics.cpp
+++ b/src/render/mobileopenglgraphics.cpp
@@ -427,7 +427,7 @@ void MobileOpenGLGraphics::drawPatternCached(const Image *restrict const image,
void MobileOpenGLGraphics::completeCache() restrict2
{
- if (mImageCached == 0u)
+ if (mImageCached == 0U)
return;
setColorAlpha(mAlphaCached);
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp
index 473b8d264..e742db33e 100644
--- a/src/render/modernopenglgraphics.cpp
+++ b/src/render/modernopenglgraphics.cpp
@@ -126,17 +126,17 @@ ModernOpenGLGraphics::~ModernOpenGLGraphics()
void ModernOpenGLGraphics::deleteGLObjects() restrict2
{
delete2(mProgram);
- if (mVbo != 0u)
+ if (mVbo != 0U)
{
// logger->log("delete buffer vbo: %u", mVbo);
mglDeleteBuffers(1, &mVbo);
}
- if (mEbo != 0u)
+ if (mEbo != 0U)
{
// logger->log("delete buffer ebo: %u", mEbo);
mglDeleteBuffers(1, &mEbo);
}
- if (mVao != 0u)
+ if (mVao != 0U)
mglDeleteVertexArrays(1, &mVao);
}
@@ -176,7 +176,7 @@ void ModernOpenGLGraphics::postInit() restrict2
logger->safeError("Shader creation error. See manaplus.log.");
}
mProgramId = mProgram->getProgramId();
- if (mProgramId == 0u)
+ if (mProgramId == 0U)
logger->error("Shaders compilation error.");
logger->log("Shaders compilation done.");
@@ -191,7 +191,7 @@ void ModernOpenGLGraphics::postInit() restrict2
mDrawTypeUniform = mglGetUniformLocation(mProgramId, "drawType");
mTextureColorUniform = mglGetUniformLocation(mProgramId, "alpha");
- mglUniform1f(mTextureColorUniform, 1.0f);
+ mglUniform1f(mTextureColorUniform, 1.0F);
mglBindVertexBuffer(0, mVbo, 0, 4 * sizeof(GLint));
mglVertexAttribBinding(mPosAttrib, 0);
@@ -199,8 +199,8 @@ void ModernOpenGLGraphics::postInit() restrict2
mAttributesBinded = mVbo;
mglUniform2f(mScreenUniform,
- static_cast<float>(mWidth) / 2.0f,
- static_cast<float>(mHeight) / 2.0f);
+ static_cast<float>(mWidth) / 2.0F,
+ static_cast<float>(mHeight) / 2.0F);
mglUniform4f(mSimpleColorUniform,
0.0F,
0.0F,
@@ -1032,7 +1032,7 @@ void ModernOpenGLGraphics::enableTexturingAndBlending() restrict2
if (!mTextureDraw)
{
mTextureDraw = true;
- mglUniform1f(mDrawTypeUniform, 1.0f);
+ mglUniform1f(mDrawTypeUniform, 1.0F);
}
if (!mAlpha)
{
@@ -1046,7 +1046,7 @@ void ModernOpenGLGraphics::disableTexturingAndBlending() restrict2
if (mTextureDraw)
{
mTextureDraw = false;
- mglUniform1f(mDrawTypeUniform, 0.0f);
+ mglUniform1f(mDrawTypeUniform, 0.0F);
}
if (mAlpha && !mColorAlpha)
{
@@ -1107,13 +1107,13 @@ void ModernOpenGLGraphics::drawNet(const int x1, const int y1,
{
mIntArray[vp + 0] = x;
mIntArray[vp + 1] = ys1;
- mIntArray[vp + 2] = 0.0f;
- mIntArray[vp + 3] = 0.0f;
+ mIntArray[vp + 2] = 0.0F;
+ mIntArray[vp + 3] = 0.0F;
mIntArray[vp + 4] = x;
mIntArray[vp + 5] = ys2;
- mIntArray[vp + 6] = 0.0f;
- mIntArray[vp + 7] = 0.0f;
+ mIntArray[vp + 6] = 0.0F;
+ mIntArray[vp + 7] = 0.0F;
vp += 8;
if (vp >= vLimit)
diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp
index 20b39cd99..edaeb17cb 100644
--- a/src/render/normalopenglgraphics.cpp
+++ b/src/render/normalopenglgraphics.cpp
@@ -416,10 +416,10 @@ void NormalOpenGLGraphics::testDraw() restrict2
{
GLfloat tex[] =
{
- 0.0f, 0.781250f,
- 0.0f, 0.781250f,
- 0.0f, 0.585938f,
- 0.0f, 0.585938f
+ 0.0F, 0.781250f,
+ 0.0F, 0.781250f,
+ 0.0F, 0.585938f,
+ 0.0F, 0.585938f
};
GLint vert[] =
@@ -631,7 +631,7 @@ void NormalOpenGLGraphics::drawPatternCached(const Image *restrict const image,
void NormalOpenGLGraphics::completeCache() restrict2
{
- if (mImageCached == 0u)
+ if (mImageCached == 0U)
return;
setColorAlpha(mAlphaCached);
diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp
index 53b31f8c4..03ff2cc28 100644
--- a/src/render/safeopenglgraphics.cpp
+++ b/src/render/safeopenglgraphics.cpp
@@ -210,13 +210,13 @@ void SafeOpenGLGraphics::testDraw() restrict2
if (SafeOpenGLImageHelper::mTextureType == GL_TEXTURE_2D)
{
glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.781250f);
+ glTexCoord2f(0.0F, 0.781250f);
glVertex2i(0, 0);
- glTexCoord2f(0.0f, 0.781250f);
+ glTexCoord2f(0.0F, 0.781250f);
glVertex2i(800, 0);
- glTexCoord2f(0.0f, 0.585938f);
+ glTexCoord2f(0.0F, 0.585938f);
glVertex2i(800, 600);
- glTexCoord2f(0.0f, 0.585938f);
+ glTexCoord2f(0.0F, 0.585938f);
glVertex2i(0, 600);
glEnd();
}
diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp
index 8e77cbf1e..ad7ea9fcd 100644
--- a/src/render/sdlgraphics.cpp
+++ b/src/render/sdlgraphics.cpp
@@ -1043,11 +1043,11 @@ void SDLGraphics::fillRectangle(const Rect &restrict rectangle) restrict2
unsigned rShift = rMask / 0xff;
unsigned gShift = gMask / 0xff;
unsigned bShift = bMask / 0xff;
- if (rShift == 0u)
+ if (rShift == 0U)
rShift = 1;
- if (gShift == 0u)
+ if (gShift == 0U)
gShift = 1;
- if (bShift == 0u)
+ if (bShift == 0U)
bShift = 1;
if (pixel != mOldPixel || mColor.a != mOldAlpha)
{
diff --git a/src/render/shaders/shader.cpp b/src/render/shaders/shader.cpp
index 38238a189..8464103d7 100644
--- a/src/render/shaders/shader.cpp
+++ b/src/render/shaders/shader.cpp
@@ -34,7 +34,7 @@ Shader::Shader(const unsigned int id) :
Shader::~Shader()
{
- if (mShaderId != 0u)
+ if (mShaderId != 0U)
mglDeleteShader(mShaderId);
}
diff --git a/src/render/shaders/shaderprogram.cpp b/src/render/shaders/shaderprogram.cpp
index 42f0b725c..5d611de0e 100644
--- a/src/render/shaders/shaderprogram.cpp
+++ b/src/render/shaders/shaderprogram.cpp
@@ -43,7 +43,7 @@ ShaderProgram::ShaderProgram(const unsigned int id,
ShaderProgram::~ShaderProgram()
{
- if (mProgramId != 0u)
+ if (mProgramId != 0U)
mglDeleteProgram(mProgramId);
if (mVertex != nullptr)
mVertex->decRef();
diff --git a/src/render/shaders/shadersmanager.cpp b/src/render/shaders/shadersmanager.cpp
index 86ede490e..5ec7b9680 100644
--- a/src/render/shaders/shadersmanager.cpp
+++ b/src/render/shaders/shadersmanager.cpp
@@ -86,7 +86,7 @@ ShaderProgram *ShadersManager::createProgram(const std::string &vertex,
}
GLuint programId = mglCreateProgram();
- if (programId == 0u)
+ if (programId == 0U)
{
vertexShader->decRef();
fragmentShader->decRef();