diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/openglgraphics.cpp | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2 mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz mana-5afe88df2538274859a162ffd63ed52118e80c19.zip |
Apply C++11 fixits
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r-- | src/openglgraphics.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index d831d9ff..008f1daa 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -379,8 +379,8 @@ void OpenGLGraphics::drawImagePattern(Image *image, int x, int y, int w, int h) if (iw == 0 || ih == 0) return; - const float tw = static_cast<float>(image->getTextureWidth()); - const float th = static_cast<float>(image->getTextureHeight()); + const auto tw = static_cast<float>(image->getTextureWidth()); + const auto th = static_cast<float>(image->getTextureHeight()); glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha); @@ -528,8 +528,8 @@ void OpenGLGraphics::drawRescaledImagePattern(Image *image, // Draw a set of textured rectangles if (image->getTextureType() == GL_TEXTURE_2D) { - const float tw = static_cast<float>(image->getTextureWidth()); - const float th = static_cast<float>(image->getTextureHeight()); + const auto tw = static_cast<float>(image->getTextureWidth()); + const auto th = static_cast<float>(image->getTextureHeight()); const float texX1 = static_cast<float>(srcX) / tw; const float texY1 = static_cast<float>(srcY) / th; @@ -706,7 +706,7 @@ SDL_Surface* OpenGLGraphics::getScreenshot() // Flip the screenshot, as OpenGL has 0,0 in bottom left unsigned int lineSize = 3 * w; - GLubyte* buf = (GLubyte*)malloc(lineSize); + auto* buf = (GLubyte*)malloc(lineSize); for (int i = 0; i < (h / 2); i++) { |