From 22e43e0f0d16fc207e3d3b7df013c50e0bfb17d7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 25 Dec 2015 01:48:51 +0300 Subject: Add restrict keyword in openglgraphicsdefadvanced.hpp --- src/render/mobileopengl2graphics.cpp | 13 ++++++++----- src/render/mobileopenglgraphics.cpp | 12 +++++++----- src/render/modernopenglgraphics.cpp | 13 ++++++++----- src/render/normalopenglgraphics.cpp | 12 +++++++----- src/render/nullopenglgraphics.cpp | 10 ++++++---- src/render/openglgraphicsdefadvanced.hpp | 11 ++++++----- 6 files changed, 42 insertions(+), 29 deletions(-) (limited to 'src/render') diff --git a/src/render/mobileopengl2graphics.cpp b/src/render/mobileopengl2graphics.cpp index 5e05540ad..e3e6b960f 100644 --- a/src/render/mobileopengl2graphics.cpp +++ b/src/render/mobileopengl2graphics.cpp @@ -137,7 +137,7 @@ void MobileOpenGL2Graphics::deleteGLObjects() #endif } -void MobileOpenGL2Graphics::initArrays(const int vertCount) +void MobileOpenGL2Graphics::initArrays(const int vertCount) restrict2 { mMaxVertices = vertCount; if (mMaxVertices < 500) @@ -216,7 +216,7 @@ void MobileOpenGL2Graphics::deleteArrays() restrict2 deleteArraysInternal(); } -void MobileOpenGL2Graphics::deleteArraysInternal() +void MobileOpenGL2Graphics::deleteArraysInternal() restrict2 { delete [] mFloatArray; mFloatArray = nullptr; @@ -580,7 +580,8 @@ void MobileOpenGL2Graphics::drawRescaledPattern(const Image * } inline void MobileOpenGL2Graphics::drawVertexes(const - OpenGLGraphicsVertexes &ogl) + OpenGLGraphicsVertexes & + restrict ogl) restrict2 { const std::vector &vp = ogl.mVp; const std::vector &vbos = ogl.mVbo; @@ -1306,7 +1307,8 @@ void MobileOpenGL2Graphics::drawLineArrays(const int size) } #ifdef DEBUG_BIND_TEXTURE -void MobileOpenGL2Graphics::debugBindTexture(const Image *const image) +void MobileOpenGL2Graphics::debugBindTexture(const Image *restrict const image) + restrict2 { const std::string texture = image->getIdPath(); if (mOldTexture != texture) @@ -1322,7 +1324,8 @@ void MobileOpenGL2Graphics::debugBindTexture(const Image *const image) } } #else -void MobileOpenGL2Graphics::debugBindTexture(const Image *const image A_UNUSED) +void MobileOpenGL2Graphics::debugBindTexture(const Image *restrict const + image A_UNUSED) restrict2 { } #endif diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index a875befc9..11227325a 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -106,7 +106,7 @@ void MobileOpenGLGraphics::postInit() // glesTest(); } -void MobileOpenGLGraphics::initArrays(const int vertCount) +void MobileOpenGLGraphics::initArrays(const int vertCount) restrict2 { mMaxVertices = vertCount; if (mMaxVertices < 500) @@ -132,7 +132,7 @@ void MobileOpenGLGraphics::deleteArrays() restrict2 deleteArraysInternal(); } -void MobileOpenGLGraphics::deleteArraysInternal() +void MobileOpenGLGraphics::deleteArraysInternal() restrict2 { delete [] mFloatTexArray; mFloatTexArray = nullptr; @@ -605,7 +605,7 @@ void MobileOpenGLGraphics::drawRescaledPattern(const Image * inline void MobileOpenGLGraphics::drawVertexes(const OpenGLGraphicsVertexes - &ogl) + &restrict ogl) restrict2 { const std::vector &shortVertPool = ogl.mShortVertPool; std::vector::const_iterator iv; @@ -1318,7 +1318,8 @@ void MobileOpenGLGraphics::clearScreen() const restrict2 } #ifdef DEBUG_BIND_TEXTURE -void MobileOpenGLGraphics::debugBindTexture(const Image *const image) +void MobileOpenGLGraphics::debugBindTexture(const Image *restrict const image) + restrict2 { const std::string texture = image->getIdPath(); if (mOldTexture != texture) @@ -1334,7 +1335,8 @@ void MobileOpenGLGraphics::debugBindTexture(const Image *const image) } } #else -void MobileOpenGLGraphics::debugBindTexture(const Image *const image A_UNUSED) +void MobileOpenGLGraphics::debugBindTexture(const Image *restrict const + image A_UNUSED) restrict2 { } #endif diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index e3c80848d..206755dd0 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -139,7 +139,7 @@ void ModernOpenGLGraphics::deleteGLObjects() mglDeleteVertexArrays(1, &mVao); } -void ModernOpenGLGraphics::initArrays(const int vertCount) +void ModernOpenGLGraphics::initArrays(const int vertCount) restrict2 { mMaxVertices = vertCount; if (mMaxVertices < 500) @@ -216,7 +216,7 @@ void ModernOpenGLGraphics::deleteArrays() restrict2 deleteArraysInternal(); } -void ModernOpenGLGraphics::deleteArraysInternal() +void ModernOpenGLGraphics::deleteArraysInternal() restrict2 { delete [] mIntArray; mIntArray = nullptr; @@ -561,7 +561,8 @@ void ModernOpenGLGraphics::drawRescaledPattern(const Image * } inline void ModernOpenGLGraphics::drawVertexes(const - OpenGLGraphicsVertexes &ogl) + OpenGLGraphicsVertexes & + restrict ogl) restrict2 { const std::vector &vp = ogl.mVp; const std::vector &vbos = ogl.mVbo; @@ -1311,7 +1312,8 @@ void ModernOpenGLGraphics::drawLineArrays(const int size) } #ifdef DEBUG_BIND_TEXTURE -void ModernOpenGLGraphics::debugBindTexture(const Image *const image) +void ModernOpenGLGraphics::debugBindTexture(const Image *restrict const image) + restrict2 { const std::string texture = image->getIdPath(); if (mOldTexture != texture) @@ -1327,7 +1329,8 @@ void ModernOpenGLGraphics::debugBindTexture(const Image *const image) } } #else -void ModernOpenGLGraphics::debugBindTexture(const Image *const image A_UNUSED) +void ModernOpenGLGraphics::debugBindTexture(const Image *restrict const + image A_UNUSED) restrict2 { } #endif diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index f4d99fa46..942377a4c 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -120,7 +120,7 @@ NormalOpenGLGraphics::~NormalOpenGLGraphics() deleteArraysInternal(); } -void NormalOpenGLGraphics::initArrays(const int vertCount) +void NormalOpenGLGraphics::initArrays(const int vertCount) restrict2 { mMaxVertices = vertCount; if (mMaxVertices < 500) @@ -150,7 +150,7 @@ void NormalOpenGLGraphics::deleteArrays() restrict2 deleteArraysInternal(); } -void NormalOpenGLGraphics::deleteArraysInternal() +void NormalOpenGLGraphics::deleteArraysInternal() restrict2 { delete [] mFloatTexArray; mFloatTexArray = nullptr; @@ -862,7 +862,7 @@ void NormalOpenGLGraphics::drawRescaledPattern(const Image * inline void NormalOpenGLGraphics::drawVertexes(const OpenGLGraphicsVertexes - &ogl) + &restrict ogl) restrict2 { const std::vector &intVertPool = ogl.mIntVertPool; std::vector::const_iterator iv; @@ -1660,7 +1660,8 @@ void NormalOpenGLGraphics::clearScreen() const restrict2 } #ifdef DEBUG_BIND_TEXTURE -void NormalOpenGLGraphics::debugBindTexture(const Image *const image) +void NormalOpenGLGraphics::debugBindTexture(const Image *restrict const image) + restrict2 { const std::string texture = image->getIdPath(); if (mOldTexture != texture) @@ -1676,7 +1677,8 @@ void NormalOpenGLGraphics::debugBindTexture(const Image *const image) } } #else -void NormalOpenGLGraphics::debugBindTexture(const Image *const image A_UNUSED) +void NormalOpenGLGraphics::debugBindTexture(const Image *restrict const + image A_UNUSED) restrict2 { } #endif diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 5a2c4f0d9..16b1b5523 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -70,7 +70,7 @@ NullOpenGLGraphics::~NullOpenGLGraphics() delete [] mIntVertArray; } -void NullOpenGLGraphics::initArrays(const int vertCount) +void NullOpenGLGraphics::initArrays(const int vertCount) restrict2 { mMaxVertices = vertCount; if (mMaxVertices < 500) @@ -530,7 +530,7 @@ void NullOpenGLGraphics::drawRescaledPattern(const Image *restrict const image, inline void NullOpenGLGraphics::drawVertexes(const OpenGLGraphicsVertexes - &ogl) + &restrict ogl) restrict2 { const std::vector &intVertPool = ogl.mIntVertPool; std::vector::const_iterator iv; @@ -1210,7 +1210,8 @@ void NullOpenGLGraphics::clearScreen() const restrict2 } #ifdef DEBUG_BIND_TEXTURE -void NullOpenGLGraphics::debugBindTexture(const Image *const image) +void NullOpenGLGraphics::debugBindTexture(const Image *restrict const image) + restrict2 { const std::string texture = image->getIdPath(); if (mOldTexture != texture) @@ -1226,7 +1227,8 @@ void NullOpenGLGraphics::debugBindTexture(const Image *const image) } } #else -void NullOpenGLGraphics::debugBindTexture(const Image *const image A_UNUSED) +void NullOpenGLGraphics::debugBindTexture(const Image *restrict const + image A_UNUSED) restrict2 { } #endif diff --git a/src/render/openglgraphicsdefadvanced.hpp b/src/render/openglgraphicsdefadvanced.hpp index 16afb9c81..f9022483f 100644 --- a/src/render/openglgraphicsdefadvanced.hpp +++ b/src/render/openglgraphicsdefadvanced.hpp @@ -21,12 +21,13 @@ */ public: - inline void drawVertexes(const OpenGLGraphicsVertexes &ogl); + inline void drawVertexes(const OpenGLGraphicsVertexes &restrict ogl) + restrict2; - void initArrays(const int vertCount) override final; + void initArrays(const int vertCount) restrict2 override final; #ifdef DEBUG_DRAW_CALLS - unsigned int getDrawCalls() const + unsigned int getDrawCalls() restrict2 const { return mLastDrawCalls; } static unsigned int mDrawCalls; @@ -35,6 +36,6 @@ public: #endif protected: - void debugBindTexture(const Image *const image); + void debugBindTexture(const Image *restrict const image) restrict2; - void deleteArraysInternal(); + void deleteArraysInternal() restrict2; -- cgit v1.2.3-60-g2f50