diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-25 00:31:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-25 00:31:58 +0300 |
commit | f0f4f43d1263f946be23b75de4de28a4731cc93a (patch) | |
tree | a572d7d28c42f727c94a70d3eedb03c2c63248b2 /src/render | |
parent | 1f4cf5720cd6c432c2544d34a804c96b8c7858f0 (diff) | |
download | manaverse-f0f4f43d1263f946be23b75de4de28a4731cc93a.tar.gz manaverse-f0f4f43d1263f946be23b75de4de28a4731cc93a.tar.bz2 manaverse-f0f4f43d1263f946be23b75de4de28a4731cc93a.tar.xz manaverse-f0f4f43d1263f946be23b75de4de28a4731cc93a.zip |
Add restrict keyword into graphicsdef.hpp
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/graphics.cpp | 10 | ||||
-rw-r--r-- | src/render/graphics.h | 2 | ||||
-rw-r--r-- | src/render/graphicsdef.hpp | 110 | ||||
-rw-r--r-- | src/render/imagegraphics.cpp | 14 | ||||
-rw-r--r-- | src/render/imagegraphics.h | 6 | ||||
-rw-r--r-- | src/render/mobileopengl2graphics.cpp | 138 | ||||
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 143 | ||||
-rw-r--r-- | src/render/modernopenglgraphics.cpp | 135 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.cpp | 134 | ||||
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 127 | ||||
-rw-r--r-- | src/render/safeopenglgraphics.cpp | 134 | ||||
-rw-r--r-- | src/render/sdl2graphics.cpp | 110 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.cpp | 137 | ||||
-rw-r--r-- | src/render/sdlgraphics.cpp | 110 | ||||
-rw-r--r-- | src/render/surfacegraphics.cpp | 14 | ||||
-rw-r--r-- | src/render/surfacegraphics.h | 6 |
16 files changed, 732 insertions, 598 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index fc1bb6223..1fa8ebce1 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -169,7 +169,7 @@ void Graphics::setMainFlags(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { logger->log("graphics backend: %s", getName().c_str()); logger->log("Setting video mode %dx%d %s", @@ -185,7 +185,7 @@ void Graphics::setMainFlags(const int w, const int h, setScale(scale); } -void Graphics::setScale(int scale) +void Graphics::setScale(int scale) restrict2 { if (isAllowScale()) { @@ -591,7 +591,7 @@ int Graphics::getHeight() const void Graphics::drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height) + const int width, const int height) restrict2 { for (int y = y1; y < y2; y += height) drawLine(x1, y, x2, y); @@ -608,7 +608,7 @@ void Graphics::setWindowSize(const int width A_UNUSED, #endif } -void Graphics::pushClipArea(const Rect &area) +void Graphics::pushClipArea(const Rect &restrict area) restrict2 { // Ignore area with a negate width or height // by simple pushing an empty clip area @@ -670,7 +670,7 @@ void Graphics::pushClipArea(const Rect &area) } } -void Graphics::popClipArea() +void Graphics::popClipArea() restrict2 { if (mClipStack.empty()) return; diff --git a/src/render/graphics.h b/src/render/graphics.h index 4d30f210b..53877361b 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -135,7 +135,7 @@ class Graphics notfinal mRect.h = static_cast<RectSize>(height); } - SDL_Window *getWindow() restrict2 const + SDL_Window *getWindow() const restrict2 { return mWindow; } /** diff --git a/src/render/graphicsdef.hpp b/src/render/graphicsdef.hpp index 4c77b46d5..3eedd871f 100644 --- a/src/render/graphicsdef.hpp +++ b/src/render/graphicsdef.hpp @@ -27,76 +27,78 @@ public: */ void drawImageRect(int x, int y, int w, int h, - const ImageRect &imgRect) override final; + const ImageRect &restrict imgRect) + restrict2 override final; - void beginDraw() override final; + void beginDraw() restrict2 override final; - void endDraw() override final; + void endDraw() restrict2 override final; - void pushClipArea(const Rect &area) override final; + void pushClipArea(const Rect &restrict area) restrict2 override final; - void popClipArea() override final; + void popClipArea() restrict2 override final; /** * Draws a resclaled version of the image */ - void drawRescaledImage(const Image *const image, + void drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) override final; + const int desiredHeight) restrict2 override final; - void drawPattern(const Image *const image, + void drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) override final; + const int w, const int h) restrict2 override final; - void inline drawPatternInline(const Image *const image, + void inline drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h); + const int w, const int h) restrict2; - void drawRescaledPattern(const Image *const image, + void drawRescaledPattern(const Image *restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) override final; + const int scaledHeight) restrict2 override final; - void calcPattern(ImageVertexes *const vert, - const Image *const image, + void calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const override final; + const int w, const int h) const restrict2 override final; - void calcPattern(ImageCollection *const vert, - const Image *const image, + void calcPattern(ImageCollection *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const override final; + const int w, const int h) const restrict2 override final; - void calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const override final; + void calcTileVertexes(ImageVertexes *restrict const vert, + const Image *restrict const image, + int x, int y) const restrict2 override final; - void calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) override final; + void calcTileCollection(ImageCollection *restrict const vertCol, + const Image *restrict const image, + int x, int y) restrict2 override final; - void drawTileVertexes(const ImageVertexes *const vert) override final; + void drawTileVertexes(const ImageVertexes *restrict const vert) + restrict2 override final; void drawTileCollection(const ImageCollection - *const vertCol) override final; + *restrict const vertCol) restrict2 override final; - void updateScreen() override final; + void updateScreen() restrict2 override final; - void calcWindow(ImageCollection *const vertCol, + void calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) override final; + const ImageRect &restrict imgRect) restrict2 override final; - void drawRectangle(const Rect &rect) override final; + void drawRectangle(const Rect &restrict rect) restrict2 override final; - void fillRectangle(const Rect &rect) override final; + void fillRectangle(const Rect &restrict rect) restrict2 override final; - void drawPoint(int x, int y) override final; + void drawPoint(int x, int y) restrict2 override final; void drawLine(int x1, int y1, - int x2, int y2) override final; + int x2, int y2) restrict2 override final; bool setVideoMode(const int w, const int h, const int scalle, @@ -104,37 +106,37 @@ public: const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) override final; + const bool noFrame) restrict2 override final; - void drawImage(const Image *const image, - int dstX, int dstY) override final; + void drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 override final; - void copyImage(const Image *const image, - int dstX, int dstY) override final; + void copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 override final; - void drawImageCached(const Image *const image, - int x, int y) override final; + void drawImageCached(const Image *restrict const image, + int x, int y) restrict2 override final; - void drawPatternCached(const Image *const image, + void drawPatternCached(const Image *restrict const image, const int x, const int y, - const int w, const int h) override final; + const int w, const int h) restrict2 override final; - void completeCache() override final; + void completeCache() restrict2 override final; private: - void inline calcImageRect(ImageVertexes *const vert, + void inline calcImageRect(ImageVertexes *restrict const vert, int x, int y, int w, int h, - const ImageRect &imgRect); + const ImageRect &restrict imgRect) restrict2; - void inline calcPatternInline(ImageVertexes *const vert, - const Image *const image, + void inline calcPatternInline(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const; + const int w, const int h) const restrict2; - void inline calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int x, int y) const; + void inline calcTileVertexesInline(ImageVertexes *restrict const vert, + const Image *restrict const image, + int x, int y) const restrict2; - void inline drawImageInline(const Image *const image, - int dstX, int dstY); + void inline drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2; diff --git a/src/render/imagegraphics.cpp b/src/render/imagegraphics.cpp index 2ae368d76..7d56f1ffd 100644 --- a/src/render/imagegraphics.cpp +++ b/src/render/imagegraphics.cpp @@ -40,26 +40,26 @@ ImegeGraphics::~ImegeGraphics() { } -void ImegeGraphics::drawImage(const Image *const image A_UNUSED, - int dstX A_UNUSED, int dstY A_UNUSED) +void ImegeGraphics::drawImage(const Image *restrict const image A_UNUSED, + int dstX A_UNUSED, int dstY A_UNUSED) restrict2 { // for now not implimented } -void ImegeGraphics::copyImage(const Image *const image, - int dstX A_UNUSED, int dstY A_UNUSED) +void ImegeGraphics::copyImage(const Image *restrict const image, + int dstX A_UNUSED, int dstY A_UNUSED) restrict2 { if (!mTarget || !image) return; } -void ImegeGraphics::drawImageCached(const Image *const image, - int x, int y) +void ImegeGraphics::drawImageCached(const Image *restrict const image, + int x, int y) restrict2 { drawImage(image, x, y); } -void ImegeGraphics::completeCache() +void ImegeGraphics::completeCache() restrict2 { } diff --git a/src/render/imagegraphics.h b/src/render/imagegraphics.h index f9ace972a..43b3a739e 100644 --- a/src/render/imagegraphics.h +++ b/src/render/imagegraphics.h @@ -60,7 +60,7 @@ class ImegeGraphics final : public Graphics void pushClipArea(const Rect &rect A_UNUSED) override final { } - void popClipArea() override final + void popClipArea() restrict2 override final { } void drawRescaledImage(const Image *const image A_UNUSED, @@ -161,14 +161,14 @@ class ImegeGraphics final : public Graphics const int bpp A_UNUSED, const bool fs A_UNUSED, const bool hwaccel A_UNUSED, const bool resize A_UNUSED, - const bool noFrame A_UNUSED) override final + const bool noFrame A_UNUSED) restrict2 override final { return false; } void drawImage(const Image *const image, int dstX, int dstY) override final; void copyImage(const Image *const image, - int dstX, int dstY) override final; + int dstX, int dstY) restrict2 override final; void drawImageCached(const Image *const image, int x, int y) override final; diff --git a/src/render/mobileopengl2graphics.cpp b/src/render/mobileopengl2graphics.cpp index 208d17236..41e49b497 100644 --- a/src/render/mobileopengl2graphics.cpp +++ b/src/render/mobileopengl2graphics.cpp @@ -230,7 +230,7 @@ bool MobileOpenGL2Graphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -320,14 +320,14 @@ void MobileOpenGL2Graphics::drawRescaledQuad(const int srcX, const int srcY, mglDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } -void MobileOpenGL2Graphics::drawImage(const Image *const image, - int dstX, int dstY) +void MobileOpenGL2Graphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void MobileOpenGL2Graphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void MobileOpenGL2Graphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) if (!image) @@ -351,8 +351,8 @@ void MobileOpenGL2Graphics::drawImageInline(const Image *const image, imageRect.h); } -void MobileOpenGL2Graphics::copyImage(const Image *const image, - int dstX, int dstY) +void MobileOpenGL2Graphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } @@ -378,28 +378,31 @@ void MobileOpenGL2Graphics::testDraw() // glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_INT, 0); } -void MobileOpenGL2Graphics::drawImageCached(const Image *const image A_UNUSED, - int A_UNUSED x, int y A_UNUSED) +void MobileOpenGL2Graphics::drawImageCached(const Image *restrict const image + A_UNUSED, + int A_UNUSED x, + int y A_UNUSED) restrict2 { } -void MobileOpenGL2Graphics::drawPatternCached(const Image *const image +void MobileOpenGL2Graphics::drawPatternCached(const Image *restrict const image A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, - const int h A_UNUSED) + const int h A_UNUSED) restrict2 { } -void MobileOpenGL2Graphics::completeCache() +void MobileOpenGL2Graphics::completeCache() restrict2 { } -void MobileOpenGL2Graphics::drawRescaledImage(const Image *const image, +void MobileOpenGL2Graphics::drawRescaledImage(const Image * + restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { if (!image) return; @@ -433,16 +436,18 @@ void MobileOpenGL2Graphics::drawRescaledImage(const Image *const image, desiredHeight); } -void MobileOpenGL2Graphics::drawPattern(const Image *const image, +void MobileOpenGL2Graphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void MobileOpenGL2Graphics::drawPatternInline(const Image *const image, +void MobileOpenGL2Graphics::drawPatternInline(const Image * + restrict const image, const int x, const int y, const int w, const int h) + restrict2 { if (!image) return; @@ -501,11 +506,13 @@ void MobileOpenGL2Graphics::drawPatternInline(const Image *const image, drawTriangleArray(vp); } -void MobileOpenGL2Graphics::drawRescaledPattern(const Image *const image, +void MobileOpenGL2Graphics::drawRescaledPattern(const Image * + restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, const int scaledHeight) + restrict2 { if (!image) return; @@ -593,18 +600,24 @@ inline void MobileOpenGL2Graphics::drawVertexes(const } } -void MobileOpenGL2Graphics::calcPattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void MobileOpenGL2Graphics::calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { calcPatternInline(vert, image, x, y, w, h); } -void MobileOpenGL2Graphics::calcPatternInline(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void MobileOpenGL2Graphics::calcPatternInline(ImageVertexes * + restrict const vert, + const Image * + restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { if (!image || !vert) return; @@ -659,9 +672,11 @@ void MobileOpenGL2Graphics::calcPatternInline(ImageVertexes *const vert, ogl.switchVp(vp); } -void MobileOpenGL2Graphics::calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) +void MobileOpenGL2Graphics::calcTileCollection(ImageCollection * + restrict const vertCol, + const Image * + restrict const image, + int x, int y) restrict2 { if (!vertCol || !image) return; @@ -681,7 +696,7 @@ void MobileOpenGL2Graphics::calcTileCollection(ImageCollection *const vertCol, } void MobileOpenGL2Graphics::drawTileCollection(const ImageCollection - *const vertCol) + *restrict const vertCol) restrict2 { if (!vertCol) return; @@ -704,8 +719,10 @@ void MobileOpenGL2Graphics::drawTileCollection(const ImageCollection void MobileOpenGL2Graphics::calcPattern(ImageCollection* const vertCol, const Image *const image, - const int x, const int y, - const int w, const int h) const + const int x, + const int y, + const int w, + const int h) const restrict2 { if (!vertCol || !image) return; @@ -726,16 +743,20 @@ void MobileOpenGL2Graphics::calcPattern(ImageCollection* const vertCol, calcPatternInline(vert, image, x, y, w, h); } -void MobileOpenGL2Graphics::calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void MobileOpenGL2Graphics::calcTileVertexes(ImageVertexes * + restrict const vert, + const Image *restrict const image, + int dstX, int dstY) const restrict2 { calcTileVertexesInline(vert, image, dstX, dstY); } -void MobileOpenGL2Graphics::calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void MobileOpenGL2Graphics::calcTileVertexesInline(ImageVertexes * + restrict const vert, + const Image * + restrict const image, + int dstX, + int dstY) const restrict2 { if (!vert || !image) return; @@ -782,7 +803,8 @@ void MobileOpenGL2Graphics::calcTileVertexesInline(ImageVertexes *const vert, ogl.switchVp(vp); } -void MobileOpenGL2Graphics::drawTileVertexes(const ImageVertexes *const vert) +void MobileOpenGL2Graphics::drawTileVertexes(const ImageVertexes * + restrict const vert) restrict2 { if (!vert) return; @@ -799,10 +821,11 @@ void MobileOpenGL2Graphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -void MobileOpenGL2Graphics::calcWindow(ImageCollection *const vertCol, +void MobileOpenGL2Graphics::calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { if (!vertCol) return; @@ -825,7 +848,7 @@ void MobileOpenGL2Graphics::calcWindow(ImageCollection *const vertCol, calcImageRect(vert, x, y, w, h, imgRect); } -void MobileOpenGL2Graphics::updateScreen() +void MobileOpenGL2Graphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") #ifdef DEBUG_DRAW_CALLS @@ -844,7 +867,7 @@ void MobileOpenGL2Graphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -void MobileOpenGL2Graphics::beginDraw() +void MobileOpenGL2Graphics::beginDraw() restrict2 { setOpenGLFlags(); #ifndef __native_client__ @@ -854,12 +877,12 @@ void MobileOpenGL2Graphics::beginDraw() pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } -void MobileOpenGL2Graphics::endDraw() +void MobileOpenGL2Graphics::endDraw() restrict2 { popClipArea(); } -void MobileOpenGL2Graphics::pushClipArea(const Rect &area) +void MobileOpenGL2Graphics::pushClipArea(const Rect &restrict area) restrict2 { Graphics::pushClipArea(area); const ClipRect &clipArea = mClipStack.top(); @@ -870,7 +893,7 @@ void MobileOpenGL2Graphics::pushClipArea(const Rect &area) clipArea.height * mScale); } -void MobileOpenGL2Graphics::popClipArea() +void MobileOpenGL2Graphics::popClipArea() restrict2 { if (mClipStack.empty()) return; @@ -885,7 +908,7 @@ void MobileOpenGL2Graphics::popClipArea() clipArea.height * mScale); } -void MobileOpenGL2Graphics::drawPoint(int x, int y) +void MobileOpenGL2Graphics::drawPoint(int x, int y) restrict2 { setTexturingAndBlending(false); bindArrayBufferAndAttributes(mVbo); @@ -902,7 +925,8 @@ void MobileOpenGL2Graphics::drawPoint(int x, int y) mglDrawArrays(GL_POINTS, 0, 1); } -void MobileOpenGL2Graphics::drawLine(int x1, int y1, int x2, int y2) +void MobileOpenGL2Graphics::drawLine(int x1, int y1, + int x2, int y2) restrict2 { setTexturingAndBlending(false); bindArrayBufferAndAttributes(mVbo); @@ -920,7 +944,7 @@ void MobileOpenGL2Graphics::drawLine(int x1, int y1, int x2, int y2) mglDrawArrays(GL_LINES, 0, 2); } -void MobileOpenGL2Graphics::drawRectangle(const Rect& rect) +void MobileOpenGL2Graphics::drawRectangle(const Rect &restrict rect) restrict2 { setTexturingAndBlending(false); bindArrayBufferAndAttributes(mVbo); @@ -945,7 +969,7 @@ void MobileOpenGL2Graphics::drawRectangle(const Rect& rect) mglDrawArrays(GL_LINE_LOOP, 0, 4); } -void MobileOpenGL2Graphics::fillRectangle(const Rect& rect) +void MobileOpenGL2Graphics::fillRectangle(const Rect &restrict rect) restrict2 { setTexturingAndBlending(false); bindArrayBufferAndAttributes(mVbo); @@ -1005,14 +1029,14 @@ void MobileOpenGL2Graphics::setTexturingAndBlending(const bool enable) } } -void MobileOpenGL2Graphics::drawRectangle(const Rect& rect A_UNUSED, - const bool filled A_UNUSED) +void MobileOpenGL2Graphics::drawRectangle(const Rect &restrict rect A_UNUSED, + const bool filled A_UNUSED) restrict2 { } void MobileOpenGL2Graphics::drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height) + const int width, const int height) restrict2 { unsigned int vp = 0; const unsigned int vLimit = mMaxVertices * 4; @@ -1172,15 +1196,17 @@ void MobileOpenGL2Graphics::dumpSettings() void MobileOpenGL2Graphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_drawImageRect.hpp" } -void MobileOpenGL2Graphics::calcImageRect(ImageVertexes *const vert, +void MobileOpenGL2Graphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 7dfa44f20..8c1c07c0f 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -150,7 +150,7 @@ bool MobileOpenGLGraphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -256,14 +256,14 @@ static inline void drawRescaledQuad(const Image *const image, } } -void MobileOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void MobileOpenGLGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void MobileOpenGLGraphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void MobileOpenGLGraphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) if (!image) @@ -281,14 +281,14 @@ void MobileOpenGLGraphics::drawImageInline(const Image *const image, dstX, dstY, imageRect.w, imageRect.h); } -void MobileOpenGLGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void MobileOpenGLGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void MobileOpenGLGraphics::drawImageCached(const Image *const image, - int x, int y) +void MobileOpenGLGraphics::drawImageCached(const Image *restrict const image, + int x, int y) restrict2 { if (!image) return; @@ -341,9 +341,11 @@ void MobileOpenGLGraphics::drawImageCached(const Image *const image, } } -void MobileOpenGLGraphics::drawPatternCached(const Image *const image, - const int x, const int y, - const int w, const int h) +void MobileOpenGLGraphics::drawPatternCached(const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) restrict2 { if (!image) return; @@ -402,7 +404,7 @@ void MobileOpenGLGraphics::drawPatternCached(const Image *const image, mVpCached = vp; } -void MobileOpenGLGraphics::completeCache() +void MobileOpenGLGraphics::completeCache() restrict2 { if (!mImageCached) return; @@ -419,10 +421,10 @@ void MobileOpenGLGraphics::completeCache() mVpCached = 0; } -void MobileOpenGLGraphics::drawRescaledImage(const Image *const image, +void MobileOpenGLGraphics::drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { FUNC_BLOCK("Graphics::drawRescaledImage", 1) if (!image) @@ -449,16 +451,16 @@ void MobileOpenGLGraphics::drawRescaledImage(const Image *const image, imageRect.w, imageRect.h, desiredWidth, desiredHeight); } -void MobileOpenGLGraphics::drawPattern(const Image *const image, +void MobileOpenGLGraphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void MobileOpenGLGraphics::drawPatternInline(const Image *const image, +void MobileOpenGLGraphics::drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) @@ -522,11 +524,12 @@ void MobileOpenGLGraphics::drawPatternInline(const Image *const image, // } } -void MobileOpenGLGraphics::drawRescaledPattern(const Image *const image, +void MobileOpenGLGraphics::drawRescaledPattern(const Image * + restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) + const int scaledHeight) restrict2 { if (!image) return; @@ -629,18 +632,21 @@ inline void MobileOpenGLGraphics::drawVertexes(const } } -void MobileOpenGLGraphics::calcPattern(ImageVertexes *const vert, - const Image *const image, +void MobileOpenGLGraphics::calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { calcPatternInline(vert, image, x, y, w, h); } -void MobileOpenGLGraphics::calcPatternInline(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void MobileOpenGLGraphics::calcPatternInline(ImageVertexes * + restrict const vert, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { if (!image || !vert) return; @@ -700,9 +706,11 @@ void MobileOpenGLGraphics::calcPatternInline(ImageVertexes *const vert, ogl.switchVp(vp); } -void MobileOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) +void MobileOpenGLGraphics::calcTileCollection(ImageCollection * + restrict const vertCol, + const Image * + restrict const image, + int x, int y) restrict2 { if (!vertCol || !image) return; @@ -721,8 +729,9 @@ void MobileOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, } } -void MobileOpenGLGraphics::drawTileCollection(const ImageCollection - *const vertCol) +void MobileOpenGLGraphics::drawTileCollection(const ImageCollection * + restrict const vertCol) + restrict2 { if (!vertCol) return; @@ -743,10 +752,12 @@ void MobileOpenGLGraphics::drawTileCollection(const ImageCollection } } -void MobileOpenGLGraphics::calcPattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void MobileOpenGLGraphics::calcPattern(ImageCollection *restrict const vertCol, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { if (!vertCol || !image) return; @@ -767,16 +778,19 @@ void MobileOpenGLGraphics::calcPattern(ImageCollection* const vertCol, calcPatternInline(vert, image, x, y, w, h); } -void MobileOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void MobileOpenGLGraphics::calcTileVertexes(ImageVertexes *restrict const vert, + const Image *restrict const image, + int dstX, int dstY) const restrict2 { calcTileVertexesInline(vert, image, dstX, dstY); } -void MobileOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void MobileOpenGLGraphics::calcTileVertexesInline(ImageVertexes * + restrict const vert, + const Image * + restrict const image, + int dstX, + int dstY) const restrict2 { if (!vert || !image) return; @@ -827,7 +841,8 @@ void MobileOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, ogl.switchVp(vp); } -void MobileOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) +void MobileOpenGLGraphics::drawTileVertexes(const ImageVertexes * + restrict const vert) restrict2 { if (!vert) return; @@ -842,10 +857,11 @@ void MobileOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -void MobileOpenGLGraphics::calcWindow(ImageCollection *const vertCol, +void MobileOpenGLGraphics::calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { if (!vertCol) return; @@ -869,7 +885,7 @@ void MobileOpenGLGraphics::calcWindow(ImageCollection *const vertCol, } -void MobileOpenGLGraphics::updateScreen() +void MobileOpenGLGraphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") // glFlush(); @@ -890,7 +906,7 @@ void MobileOpenGLGraphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -void MobileOpenGLGraphics::beginDraw() +void MobileOpenGLGraphics::beginDraw() restrict2 { glMatrixMode(GL_TEXTURE); glLoadIdentity(); @@ -931,12 +947,12 @@ void MobileOpenGLGraphics::beginDraw() pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } -void MobileOpenGLGraphics::endDraw() +void MobileOpenGLGraphics::endDraw() restrict2 { popClipArea(); } -void MobileOpenGLGraphics::pushClipArea(const Rect &area) +void MobileOpenGLGraphics::pushClipArea(const Rect &restrict area) restrict2 { int transX = 0; int transY = 0; @@ -965,7 +981,7 @@ void MobileOpenGLGraphics::pushClipArea(const Rect &area) clipArea.height * mScale); } -void MobileOpenGLGraphics::popClipArea() +void MobileOpenGLGraphics::popClipArea() restrict2 { if (mClipStack.empty()) return; @@ -994,9 +1010,9 @@ void MobileOpenGLGraphics::popClipArea() } #ifdef ANDROID -void MobileOpenGLGraphics::drawPoint(int x A_UNUSED, int y A_UNUSED) +void MobileOpenGLGraphics::drawPoint(int x A_UNUSED, int y A_UNUSED) restrict2 #else -void MobileOpenGLGraphics::drawPoint(int x, int y) +void MobileOpenGLGraphics::drawPoint(int x, int y) restrict2 #endif { setTexturingAndBlending(false); @@ -1011,7 +1027,8 @@ void MobileOpenGLGraphics::drawPoint(int x, int y) #endif } -void MobileOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) +void MobileOpenGLGraphics::drawLine(int x1, int y1, + int x2, int y2) restrict2 { setTexturingAndBlending(false); restoreColor(); @@ -1024,12 +1041,12 @@ void MobileOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) drawLineArrays(4); } -void MobileOpenGLGraphics::drawRectangle(const Rect& rect) +void MobileOpenGLGraphics::drawRectangle(const Rect &restrict rect) restrict2 { drawRectangle(rect, false); } -void MobileOpenGLGraphics::fillRectangle(const Rect& rect) +void MobileOpenGLGraphics::fillRectangle(const Rect &restrict rect) restrict2 { drawRectangle(rect, true); } @@ -1074,8 +1091,8 @@ void MobileOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void MobileOpenGLGraphics::drawRectangle(const Rect& rect, - const bool filled) +void MobileOpenGLGraphics::drawRectangle(const Rect &restrict rect, + const bool filled) restrict2 { BLOCK_START("Graphics::drawRectangle") setTexturingAndBlending(false); @@ -1125,7 +1142,7 @@ void MobileOpenGLGraphics::drawRectangle(const Rect& rect, void MobileOpenGLGraphics::drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height) + const int width, const int height) restrict2 { unsigned int vp = 0; const unsigned int vLimit = mMaxVertices * 4; @@ -1278,15 +1295,17 @@ void MobileOpenGLGraphics::restoreColor() void MobileOpenGLGraphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_drawImageRect.hpp" } -void MobileOpenGLGraphics::calcImageRect(ImageVertexes *const vert, +void MobileOpenGLGraphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index 61dec9b03..cb24eb887 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -230,7 +230,7 @@ bool ModernOpenGLGraphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -314,14 +314,14 @@ void ModernOpenGLGraphics::drawRescaledQuad(const int srcX, const int srcY, mglDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } -void ModernOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void ModernOpenGLGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void ModernOpenGLGraphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void ModernOpenGLGraphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) if (!image) @@ -342,8 +342,8 @@ void ModernOpenGLGraphics::drawImageInline(const Image *const image, imageRect.w, imageRect.h); } -void ModernOpenGLGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void ModernOpenGLGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } @@ -372,27 +372,29 @@ void ModernOpenGLGraphics::testDraw() // glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_INT, 0); } -void ModernOpenGLGraphics::drawImageCached(const Image *const image A_UNUSED, - int A_UNUSED x, int y A_UNUSED) +void ModernOpenGLGraphics::drawImageCached(const Image *restrict const image + A_UNUSED, + int A_UNUSED x, int y A_UNUSED) restrict2 { } -void ModernOpenGLGraphics::drawPatternCached(const Image *const image A_UNUSED, +void ModernOpenGLGraphics::drawPatternCached(const Image *restrict const image + A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, - const int h A_UNUSED) + const int h A_UNUSED) restrict2 { } -void ModernOpenGLGraphics::completeCache() +void ModernOpenGLGraphics::completeCache() restrict2 { } -void ModernOpenGLGraphics::drawRescaledImage(const Image *const image, +void ModernOpenGLGraphics::drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { if (!image) return; @@ -422,16 +424,16 @@ void ModernOpenGLGraphics::drawRescaledImage(const Image *const image, desiredWidth, desiredHeight); } -void ModernOpenGLGraphics::drawPattern(const Image *const image, +void ModernOpenGLGraphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void ModernOpenGLGraphics::drawPatternInline(const Image *const image, +void ModernOpenGLGraphics::drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { if (!image) return; @@ -489,11 +491,12 @@ void ModernOpenGLGraphics::drawPatternInline(const Image *const image, drawTriangleArray(vp); } -void ModernOpenGLGraphics::drawRescaledPattern(const Image *const image, +void ModernOpenGLGraphics::drawRescaledPattern(const Image * + restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) + const int scaledHeight) restrict2 { if (!image) return; @@ -584,18 +587,23 @@ inline void ModernOpenGLGraphics::drawVertexes(const } } -void ModernOpenGLGraphics::calcPattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void ModernOpenGLGraphics::calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { calcPatternInline(vert, image, x, y, w, h); } -void ModernOpenGLGraphics::calcPatternInline(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void ModernOpenGLGraphics::calcPatternInline(ImageVertexes * + restrict const vert, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { if (!image || !vert) return; @@ -647,9 +655,11 @@ void ModernOpenGLGraphics::calcPatternInline(ImageVertexes *const vert, ogl.switchVp(vp); } -void ModernOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) +void ModernOpenGLGraphics::calcTileCollection(ImageCollection * + restrict const vertCol, + const Image * + restrict const image, + int x, int y) restrict2 { if (!vertCol || !image) return; @@ -669,7 +679,7 @@ void ModernOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, } void ModernOpenGLGraphics::drawTileCollection(const ImageCollection - *const vertCol) + *restrict const vertCol) restrict2 { if (!vertCol) return; @@ -697,10 +707,10 @@ void ModernOpenGLGraphics::drawTileCollection(const ImageCollection } } -void ModernOpenGLGraphics::calcPattern(ImageCollection* const vertCol, - const Image *const image, +void ModernOpenGLGraphics::calcPattern(ImageCollection *restrict const vertCol, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { if (!vertCol || !image) return; @@ -721,16 +731,19 @@ void ModernOpenGLGraphics::calcPattern(ImageCollection* const vertCol, calcPatternInline(vert, image, x, y, w, h); } -void ModernOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void ModernOpenGLGraphics::calcTileVertexes(ImageVertexes *restrict const vert, + const Image *restrict const image, + int dstX, int dstY) const restrict2 { calcTileVertexesInline(vert, image, dstX, dstY); } -void ModernOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void ModernOpenGLGraphics::calcTileVertexesInline(ImageVertexes * + restrict const vert, + const Image * + restrict const image, + int dstX, + int dstY) const restrict2 { if (!vert || !image) return; @@ -774,7 +787,8 @@ void ModernOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, ogl.switchVp(vp); } -void ModernOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) +void ModernOpenGLGraphics::drawTileVertexes(const ImageVertexes * + restrict const vert) restrict2 { if (!vert) return; @@ -791,10 +805,11 @@ void ModernOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -void ModernOpenGLGraphics::calcWindow(ImageCollection *const vertCol, +void ModernOpenGLGraphics::calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { if (!vertCol) return; @@ -817,7 +832,7 @@ void ModernOpenGLGraphics::calcWindow(ImageCollection *const vertCol, calcImageRect(vert, x, y, w, h, imgRect); } -void ModernOpenGLGraphics::updateScreen() +void ModernOpenGLGraphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") #ifdef DEBUG_DRAW_CALLS @@ -836,7 +851,7 @@ void ModernOpenGLGraphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -void ModernOpenGLGraphics::beginDraw() +void ModernOpenGLGraphics::beginDraw() restrict2 { setOpenGLFlags(); mglDisable(GL_VERTEX_PROGRAM_POINT_SIZE_ARB); @@ -844,12 +859,12 @@ void ModernOpenGLGraphics::beginDraw() pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } -void ModernOpenGLGraphics::endDraw() +void ModernOpenGLGraphics::endDraw() restrict2 { popClipArea(); } -void ModernOpenGLGraphics::pushClipArea(const Rect &area) +void ModernOpenGLGraphics::pushClipArea(const Rect &restrict area) restrict2 { Graphics::pushClipArea(area); const ClipRect &clipArea = mClipStack.top(); @@ -860,7 +875,7 @@ void ModernOpenGLGraphics::pushClipArea(const Rect &area) clipArea.height * mScale); } -void ModernOpenGLGraphics::popClipArea() +void ModernOpenGLGraphics::popClipArea() restrict2 { if (mClipStack.empty()) return; @@ -875,7 +890,7 @@ void ModernOpenGLGraphics::popClipArea() clipArea.height * mScale); } -void ModernOpenGLGraphics::drawPoint(int x, int y) +void ModernOpenGLGraphics::drawPoint(int x, int y) restrict2 { setTexturingAndBlending(false); bindArrayBufferAndAttributes(mVbo); @@ -893,7 +908,8 @@ void ModernOpenGLGraphics::drawPoint(int x, int y) mglDrawArrays(GL_POINTS, 0, 1); } -void ModernOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) +void ModernOpenGLGraphics::drawLine(int x1, int y1, + int x2, int y2) restrict2 { setTexturingAndBlending(false); bindArrayBufferAndAttributes(mVbo); @@ -912,7 +928,7 @@ void ModernOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) mglDrawArrays(GL_LINES, 0, 2); } -void ModernOpenGLGraphics::drawRectangle(const Rect& rect) +void ModernOpenGLGraphics::drawRectangle(const Rect &restrict rect) restrict2 { setTexturingAndBlending(false); bindArrayBufferAndAttributes(mVbo); @@ -938,7 +954,7 @@ void ModernOpenGLGraphics::drawRectangle(const Rect& rect) mglDrawArrays(GL_LINE_LOOP, 0, 4); } -void ModernOpenGLGraphics::fillRectangle(const Rect& rect) +void ModernOpenGLGraphics::fillRectangle(const Rect &restrict rect) restrict2 { setTexturingAndBlending(false); bindArrayBufferAndAttributes(mVbo); @@ -999,14 +1015,14 @@ void ModernOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void ModernOpenGLGraphics::drawRectangle(const Rect& rect A_UNUSED, - const bool filled A_UNUSED) +void ModernOpenGLGraphics::drawRectangle(const Rect &restrict rect A_UNUSED, + const bool filled A_UNUSED) restrict2 { } void ModernOpenGLGraphics::drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height) + const int width, const int height) restrict2 { unsigned int vp = 0; const unsigned int vLimit = mMaxVertices * 4; @@ -1178,15 +1194,16 @@ void ModernOpenGLGraphics::dumpSettings() void ModernOpenGLGraphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_drawImageRect.hpp" } -void ModernOpenGLGraphics::calcImageRect(ImageVertexes *const vert, +void ModernOpenGLGraphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 358d8b13b..0fb6c9787 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -172,7 +172,7 @@ bool NormalOpenGLGraphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -339,14 +339,14 @@ static inline void drawRescaledQuad(const Image *const image, } } -void NormalOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void NormalOpenGLGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void NormalOpenGLGraphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void NormalOpenGLGraphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) if (!image) @@ -364,8 +364,8 @@ void NormalOpenGLGraphics::drawImageInline(const Image *const image, dstX, dstY, imageRect.w, imageRect.h); } -void NormalOpenGLGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void NormalOpenGLGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } @@ -422,8 +422,8 @@ void NormalOpenGLGraphics::testDraw() } } -void NormalOpenGLGraphics::drawImageCached(const Image *const image, - int x, int y) +void NormalOpenGLGraphics::drawImageCached(const Image *restrict const image, + int x, int y) restrict2 { if (!image) return; @@ -494,9 +494,9 @@ void NormalOpenGLGraphics::drawImageCached(const Image *const image, } } -void NormalOpenGLGraphics::drawPatternCached(const Image *const image, +void NormalOpenGLGraphics::drawPatternCached(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPatternCached", 1) if (!image) @@ -579,7 +579,7 @@ void NormalOpenGLGraphics::drawPatternCached(const Image *const image, mVpCached = vp; } -void NormalOpenGLGraphics::completeCache() +void NormalOpenGLGraphics::completeCache() restrict2 { if (!mImageCached) return; @@ -600,10 +600,10 @@ void NormalOpenGLGraphics::completeCache() mVpCached = 0; } -void NormalOpenGLGraphics::drawRescaledImage(const Image *const image, +void NormalOpenGLGraphics::drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { FUNC_BLOCK("Graphics::drawRescaledImage", 1) if (!image) @@ -630,16 +630,16 @@ void NormalOpenGLGraphics::drawRescaledImage(const Image *const image, imageRect.w, imageRect.h, desiredWidth, desiredHeight); } -void NormalOpenGLGraphics::drawPattern(const Image *const image, +void NormalOpenGLGraphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void NormalOpenGLGraphics::drawPatternInline(const Image *const image, +void NormalOpenGLGraphics::drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) @@ -727,11 +727,12 @@ void NormalOpenGLGraphics::drawPatternInline(const Image *const image, } } -void NormalOpenGLGraphics::drawRescaledPattern(const Image *const image, +void NormalOpenGLGraphics::drawRescaledPattern(const Image * + restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) + const int scaledHeight) restrict2 { if (!image) return; @@ -902,18 +903,21 @@ inline void NormalOpenGLGraphics::drawVertexes(const } } -void NormalOpenGLGraphics::calcPattern(ImageVertexes* const vert, - const Image *const image, +void NormalOpenGLGraphics::calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { calcPatternInline(vert, image, x, y, w, h); } -void NormalOpenGLGraphics::calcPatternInline(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void NormalOpenGLGraphics::calcPatternInline(ImageVertexes * + restrict const vert, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { if (!image || !vert) return; @@ -1001,9 +1005,11 @@ void NormalOpenGLGraphics::calcPatternInline(ImageVertexes* const vert, ogl.switchVp(vp); } -void NormalOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) +void NormalOpenGLGraphics::calcTileCollection(ImageCollection * + restrict const vertCol, + const Image * + restrict const image, + int x, int y) restrict2 { if (!vertCol || !image) return; @@ -1023,7 +1029,7 @@ void NormalOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, } void NormalOpenGLGraphics::drawTileCollection(const ImageCollection - *const vertCol) + *restrict const vertCol) restrict2 { if (!vertCol) return; @@ -1044,10 +1050,12 @@ void NormalOpenGLGraphics::drawTileCollection(const ImageCollection } } -void NormalOpenGLGraphics::calcPattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void NormalOpenGLGraphics::calcPattern(ImageCollection *restrict const vertCol, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { if (!vertCol || !image) return; @@ -1068,16 +1076,19 @@ void NormalOpenGLGraphics::calcPattern(ImageCollection* const vertCol, calcPatternInline(vert, image, x, y, w, h); } -void NormalOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void NormalOpenGLGraphics::calcTileVertexes(ImageVertexes *restrict const vert, + const Image *restrict const image, + int dstX, int dstY) const restrict2 { calcTileVertexesInline(vert, image, dstX, dstY); } -void NormalOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void NormalOpenGLGraphics::calcTileVertexesInline(ImageVertexes * + restrict const vert, + const Image * + restrict const image, + int dstX, + int dstY) const restrict2 { if (!vert || !image) return; @@ -1147,7 +1158,8 @@ void NormalOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, ogl.switchVp(vp); } -void NormalOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) +void NormalOpenGLGraphics::drawTileVertexes(const ImageVertexes * + restrict const vert) restrict2 { if (!vert) return; @@ -1162,10 +1174,11 @@ void NormalOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -void NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, +void NormalOpenGLGraphics::calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { if (!vertCol) return; @@ -1188,7 +1201,7 @@ void NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, calcImageRect(vert, x, y, w, h, imgRect); } -void NormalOpenGLGraphics::updateScreen() +void NormalOpenGLGraphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") // glFlush(); @@ -1215,7 +1228,7 @@ void NormalOpenGLGraphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -void NormalOpenGLGraphics::beginDraw() +void NormalOpenGLGraphics::beginDraw() restrict2 { glMatrixMode(GL_TEXTURE); glLoadIdentity(); @@ -1261,12 +1274,12 @@ void NormalOpenGLGraphics::beginDraw() pushClipArea(Rect(0, 0, w, h)); } -void NormalOpenGLGraphics::endDraw() +void NormalOpenGLGraphics::endDraw() restrict2 { popClipArea(); } -void NormalOpenGLGraphics::pushClipArea(const Rect &area) +void NormalOpenGLGraphics::pushClipArea(const Rect &restrict area) restrict2 { int transX = 0; int transY = 0; @@ -1295,7 +1308,7 @@ void NormalOpenGLGraphics::pushClipArea(const Rect &area) clipArea.height * mScale); } -void NormalOpenGLGraphics::popClipArea() +void NormalOpenGLGraphics::popClipArea() restrict2 { if (mClipStack.empty()) return; @@ -1323,7 +1336,7 @@ void NormalOpenGLGraphics::popClipArea() clipArea.height * mScale); } -void NormalOpenGLGraphics::drawPoint(int x, int y) +void NormalOpenGLGraphics::drawPoint(int x, int y) restrict2 { setTexturingAndBlending(false); restoreColor(); @@ -1337,7 +1350,8 @@ void NormalOpenGLGraphics::drawPoint(int x, int y) #endif } -void NormalOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) +void NormalOpenGLGraphics::drawLine(int x1, int y1, + int x2, int y2) restrict2 { setTexturingAndBlending(false); restoreColor(); @@ -1350,12 +1364,12 @@ void NormalOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) drawLineArrayf(4); } -void NormalOpenGLGraphics::drawRectangle(const Rect& rect) +void NormalOpenGLGraphics::drawRectangle(const Rect &restrict rect) restrict2 { drawRectangle(rect, false); } -void NormalOpenGLGraphics::fillRectangle(const Rect& rect) +void NormalOpenGLGraphics::fillRectangle(const Rect &restrict rect) restrict2 { drawRectangle(rect, true); } @@ -1400,8 +1414,8 @@ void NormalOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void NormalOpenGLGraphics::drawRectangle(const Rect& rect, - const bool filled) +void NormalOpenGLGraphics::drawRectangle(const Rect &restrict rect, + const bool filled) restrict2 { BLOCK_START("Graphics::drawRectangle") const float offset = filled ? 0 : 0.5F; @@ -1432,7 +1446,7 @@ void NormalOpenGLGraphics::drawRectangle(const Rect& rect, void NormalOpenGLGraphics::drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height) + const int width, const int height) restrict2 { unsigned int vp = 0; const unsigned int vLimit = mMaxVertices * 4; @@ -1625,15 +1639,17 @@ void NormalOpenGLGraphics::restoreColor() void NormalOpenGLGraphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_drawImageRect.hpp" } -void NormalOpenGLGraphics::calcImageRect(ImageVertexes *const vert, +void NormalOpenGLGraphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 9be3626a8..c8030e104 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -99,7 +99,7 @@ bool NullOpenGLGraphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -156,20 +156,20 @@ static inline void drawRescaledQuad(const Image *const image A_UNUSED, } } -void NullOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void NullOpenGLGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void NullOpenGLGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void NullOpenGLGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void NullOpenGLGraphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void NullOpenGLGraphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) if (!image) @@ -187,27 +187,30 @@ void NullOpenGLGraphics::drawImageInline(const Image *const image, imageRect.w, imageRect.h); } -void NullOpenGLGraphics::drawImageCached(const Image *const image A_UNUSED, - int x A_UNUSED, int y A_UNUSED) +void NullOpenGLGraphics::drawImageCached(const Image *restrict const image + A_UNUSED, + int x A_UNUSED, + int y A_UNUSED) restrict2 { } -void NullOpenGLGraphics::drawPatternCached(const Image *const image A_UNUSED, +void NullOpenGLGraphics::drawPatternCached(const Image *restrict const image + A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, - const int h A_UNUSED) + const int h A_UNUSED) restrict2 { } -void NullOpenGLGraphics::completeCache() +void NullOpenGLGraphics::completeCache() restrict2 { } -void NullOpenGLGraphics::drawRescaledImage(const Image *const image, +void NullOpenGLGraphics::drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { FUNC_BLOCK("Graphics::drawRescaledImage", 1) if (!image) @@ -234,16 +237,16 @@ void NullOpenGLGraphics::drawRescaledImage(const Image *const image, imageRect.w, imageRect.h, desiredWidth, desiredHeight); } -void NullOpenGLGraphics::drawPattern(const Image *const image, +void NullOpenGLGraphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void NullOpenGLGraphics::drawPatternInline(const Image *const image, +void NullOpenGLGraphics::drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) @@ -373,11 +376,11 @@ void NullOpenGLGraphics::drawPatternInline(const Image *const image, } } -void NullOpenGLGraphics::drawRescaledPattern(const Image *const image, +void NullOpenGLGraphics::drawRescaledPattern(const Image *restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) + const int scaledHeight) restrict2 { if (!image) return; @@ -568,18 +571,20 @@ inline void NullOpenGLGraphics::drawVertexes(const } } -void NullOpenGLGraphics::calcPattern(ImageVertexes* const vert, - const Image *const image, +void NullOpenGLGraphics::calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { calcPatternInline(vert, image, x, y, w, h); } -void NullOpenGLGraphics::calcPatternInline(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void NullOpenGLGraphics::calcPatternInline(ImageVertexes *restrict const vert, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { if (!image || !vert) return; @@ -708,9 +713,10 @@ void NullOpenGLGraphics::calcPatternInline(ImageVertexes* const vert, ogl.switchVp(vp); } -void NullOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) +void NullOpenGLGraphics::calcTileCollection(ImageCollection * + restrict const vertCol, + const Image *restrict const image, + int x, int y) restrict2 { if (!vertCol || !image) return; @@ -730,7 +736,7 @@ void NullOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, } void NullOpenGLGraphics::drawTileCollection(const ImageCollection - *const vertCol) + *restrict const vertCol) restrict2 { if (!vertCol) return; @@ -751,10 +757,10 @@ void NullOpenGLGraphics::drawTileCollection(const ImageCollection } } -void NullOpenGLGraphics::calcPattern(ImageCollection* const vertCol, - const Image *const image, +void NullOpenGLGraphics::calcPattern(ImageCollection *restrict const vertCol, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { if (!vertCol || !image) return; @@ -775,16 +781,19 @@ void NullOpenGLGraphics::calcPattern(ImageCollection* const vertCol, calcPatternInline(vert, image, x, y, w, h); } -void NullOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void NullOpenGLGraphics::calcTileVertexes(ImageVertexes *restrict const vert, + const Image *restrict const image, + int dstX, int dstY) const restrict2 { calcTileVertexesInline(vert, image, dstX, dstY); } -void NullOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int dstX, int dstY) const +void NullOpenGLGraphics::calcTileVertexesInline(ImageVertexes * + restrict const vert, + const Image * + restrict const image, + int dstX, + int dstY) const restrict2 { if (!vert || !image) return; @@ -895,7 +904,8 @@ void NullOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, ogl.switchVp(vp); } -void NullOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) +void NullOpenGLGraphics::drawTileVertexes(const ImageVertexes * + restrict const vert) restrict2 { if (!vert) return; @@ -910,10 +920,10 @@ void NullOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -void NullOpenGLGraphics::calcWindow(ImageCollection *const vertCol, +void NullOpenGLGraphics::calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) restrict2 { if (!vertCol) return; @@ -936,7 +946,7 @@ void NullOpenGLGraphics::calcWindow(ImageCollection *const vertCol, calcImageRect(vert, x, y, w, h, imgRect); } -void NullOpenGLGraphics::updateScreen() +void NullOpenGLGraphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") #ifdef DEBUG_DRAW_CALLS @@ -946,17 +956,17 @@ void NullOpenGLGraphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -void NullOpenGLGraphics::beginDraw() +void NullOpenGLGraphics::beginDraw() restrict2 { pushClipArea(Rect(0, 0, 640, 480)); } -void NullOpenGLGraphics::endDraw() +void NullOpenGLGraphics::endDraw() restrict2 { popClipArea(); } -void NullOpenGLGraphics::pushClipArea(const Rect &area) +void NullOpenGLGraphics::pushClipArea(const Rect &restrict area) restrict2 { int transX = 0; int transY = 0; @@ -975,7 +985,7 @@ void NullOpenGLGraphics::pushClipArea(const Rect &area) transY += clipArea.yOffset; } -void NullOpenGLGraphics::popClipArea() +void NullOpenGLGraphics::popClipArea() restrict2 { Graphics::popClipArea(); @@ -983,14 +993,14 @@ void NullOpenGLGraphics::popClipArea() return; } -void NullOpenGLGraphics::drawPoint(int x A_UNUSED, int y A_UNUSED) +void NullOpenGLGraphics::drawPoint(int x A_UNUSED, int y A_UNUSED) restrict2 { setTexturingAndBlending(false); restoreColor(); } void NullOpenGLGraphics::drawLine(int x1, int y1, - int x2, int y2) + int x2, int y2) restrict2 { setTexturingAndBlending(false); restoreColor(); @@ -1003,12 +1013,12 @@ void NullOpenGLGraphics::drawLine(int x1, int y1, drawLineArrayf(4); } -void NullOpenGLGraphics::drawRectangle(const Rect& rect) +void NullOpenGLGraphics::drawRectangle(const Rect &restrict rect) restrict2 { drawRectangle(rect, false); } -void NullOpenGLGraphics::fillRectangle(const Rect& rect) +void NullOpenGLGraphics::fillRectangle(const Rect &restrict rect) restrict2 { drawRectangle(rect, true); } @@ -1036,8 +1046,8 @@ void NullOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void NullOpenGLGraphics::drawRectangle(const Rect& rect A_UNUSED, - const bool filled A_UNUSED) +void NullOpenGLGraphics::drawRectangle(const Rect &restrict rect A_UNUSED, + const bool filled A_UNUSED) restrict2 { BLOCK_START("Graphics::drawRectangle") setTexturingAndBlending(false); @@ -1051,7 +1061,7 @@ void NullOpenGLGraphics::drawRectangle(const Rect& rect A_UNUSED, void NullOpenGLGraphics::drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height) + const int width, const int height) restrict2 { unsigned int vp = 0; const unsigned int vLimit = mMaxVertices * 4; @@ -1181,15 +1191,16 @@ void NullOpenGLGraphics::restoreColor() void NullOpenGLGraphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_drawImageRect.hpp" } -void NullOpenGLGraphics::calcImageRect(ImageVertexes *const vert, +void NullOpenGLGraphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index 71edb954d..3ab6351df 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -61,7 +61,7 @@ bool SafeOpenGLGraphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -156,14 +156,14 @@ static inline void drawRescaledQuad(const Image *const image, } } -void SafeOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void SafeOpenGLGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void SafeOpenGLGraphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void SafeOpenGLGraphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) if (!image) @@ -181,8 +181,8 @@ void SafeOpenGLGraphics::drawImageInline(const Image *const image, glEnd(); } -void SafeOpenGLGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void SafeOpenGLGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } @@ -217,8 +217,8 @@ void SafeOpenGLGraphics::testDraw() } } -void SafeOpenGLGraphics::drawImageCached(const Image *const image, - int x, int y) +void SafeOpenGLGraphics::drawImageCached(const Image *restrict const image, + int x, int y) restrict2 { FUNC_BLOCK("Graphics::drawImageCached", 1) if (!image) @@ -235,9 +235,9 @@ void SafeOpenGLGraphics::drawImageCached(const Image *const image, glEnd(); } -void SafeOpenGLGraphics::drawPatternCached(const Image *const image, +void SafeOpenGLGraphics::drawPatternCached(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPatternCached", 1) if (!image) @@ -274,14 +274,14 @@ void SafeOpenGLGraphics::drawPatternCached(const Image *const image, glEnd(); } -void SafeOpenGLGraphics::completeCache() +void SafeOpenGLGraphics::completeCache() restrict2 { } -void SafeOpenGLGraphics::drawRescaledImage(const Image *const image, +void SafeOpenGLGraphics::drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { FUNC_BLOCK("Graphics::drawRescaledImage", 1) if (!image) @@ -307,16 +307,16 @@ void SafeOpenGLGraphics::drawRescaledImage(const Image *const image, glEnd(); } -void SafeOpenGLGraphics::drawPattern(const Image *const image, +void SafeOpenGLGraphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void SafeOpenGLGraphics::drawPatternInline(const Image *const image, +void SafeOpenGLGraphics::drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) @@ -353,11 +353,11 @@ void SafeOpenGLGraphics::drawPatternInline(const Image *const image, glEnd(); } -void SafeOpenGLGraphics::drawRescaledPattern(const Image *const image, +void SafeOpenGLGraphics::drawRescaledPattern(const Image *restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) + const int scaledHeight) restrict2 { if (!image) return; @@ -401,66 +401,79 @@ void SafeOpenGLGraphics::drawRescaledPattern(const Image *const image, glEnd(); } -void SafeOpenGLGraphics::calcTileCollection(ImageCollection *const +void SafeOpenGLGraphics::calcTileCollection(ImageCollection *restrict const vertCol A_UNUSED, - const Image *const image A_UNUSED, - int x A_UNUSED, int y A_UNUSED) + const Image *restrict const image + A_UNUSED, + int x A_UNUSED, + int y A_UNUSED) restrict2 { } -void SafeOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert A_UNUSED, - const Image *const image A_UNUSED, - int x A_UNUSED, int y A_UNUSED) const +void SafeOpenGLGraphics::calcTileVertexes(ImageVertexes *restrict const vert + A_UNUSED, + const Image *restrict const image + A_UNUSED, + int x A_UNUSED, + int y A_UNUSED) const restrict2 { } -void SafeOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const +void SafeOpenGLGraphics::calcTileVertexesInline(ImageVertexes *restrict const vert A_UNUSED, - const Image *const + const Image *restrict const image A_UNUSED, int x A_UNUSED, - int y A_UNUSED) const + int y A_UNUSED) const restrict2 { } -void SafeOpenGLGraphics::calcPattern(ImageVertexes *const vert A_UNUSED, - const Image *const image A_UNUSED, +void SafeOpenGLGraphics::calcPattern(ImageVertexes *restrict const vert + A_UNUSED, + const Image *restrict const image + A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, - const int h A_UNUSED) const + const int h A_UNUSED) const restrict2 { } -void SafeOpenGLGraphics::calcPatternInline(ImageVertexes *const vert A_UNUSED, - const Image *const image A_UNUSED, +void SafeOpenGLGraphics::calcPatternInline(ImageVertexes *restrict const vert + A_UNUSED, + const Image *restrict const image + A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, - const int h A_UNUSED) const + const int h A_UNUSED) const restrict2 { } -void SafeOpenGLGraphics::calcPattern(ImageCollection *const vert A_UNUSED, - const Image *const image A_UNUSED, +void SafeOpenGLGraphics::calcPattern(ImageCollection *restrict const vert + A_UNUSED, + const Image *restrict const image + A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, - const int h A_UNUSED) const + const int h A_UNUSED) const restrict2 { } void SafeOpenGLGraphics::drawTileVertexes(const ImageVertexes - *const vert A_UNUSED) + *restrict const vert A_UNUSED) + restrict2 { } -void SafeOpenGLGraphics::drawTileCollection(const ImageCollection *const - vertCol A_UNUSED) +void SafeOpenGLGraphics::drawTileCollection(const ImageCollection * + restrict const vertCol A_UNUSED) + restrict2 { } -void SafeOpenGLGraphics::updateScreen() +void SafeOpenGLGraphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") glFlush(); @@ -477,14 +490,16 @@ void SafeOpenGLGraphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -void SafeOpenGLGraphics::calcWindow(ImageCollection *const vertCol A_UNUSED, +void SafeOpenGLGraphics::calcWindow(ImageCollection *restrict const vertCol + A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, const int h A_UNUSED, - const ImageRect &imgRect A_UNUSED) + const ImageRect &restrict imgRect A_UNUSED) + restrict2 { } -void SafeOpenGLGraphics::beginDraw() +void SafeOpenGLGraphics::beginDraw() restrict2 { glMatrixMode(GL_TEXTURE); glLoadIdentity(); @@ -509,12 +524,12 @@ void SafeOpenGLGraphics::beginDraw() pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } -void SafeOpenGLGraphics::endDraw() +void SafeOpenGLGraphics::endDraw() restrict2 { popClipArea(); } -void SafeOpenGLGraphics::pushClipArea(const Rect &area) +void SafeOpenGLGraphics::pushClipArea(const Rect &restrict area) restrict2 { int transX = 0; int transY = 0; @@ -539,7 +554,7 @@ void SafeOpenGLGraphics::pushClipArea(const Rect &area) clipArea.height * mScale); } -void SafeOpenGLGraphics::popClipArea() +void SafeOpenGLGraphics::popClipArea() restrict2 { Graphics::popClipArea(); @@ -554,7 +569,7 @@ void SafeOpenGLGraphics::popClipArea() clipArea.height * mScale); } -void SafeOpenGLGraphics::drawPoint(int x, int y) +void SafeOpenGLGraphics::drawPoint(int x, int y) restrict2 { setTexturingAndBlending(false); restoreColor(); @@ -566,7 +581,7 @@ void SafeOpenGLGraphics::drawPoint(int x, int y) void SafeOpenGLGraphics::drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height) + const int width, const int height) restrict2 { setTexturingAndBlending(false); restoreColor(); @@ -590,7 +605,8 @@ void SafeOpenGLGraphics::drawNet(const int x1, const int y1, glEnd(); } -void SafeOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) +void SafeOpenGLGraphics::drawLine(int x1, int y1, + int x2, int y2) restrict2 { setTexturingAndBlending(false); restoreColor(); @@ -601,12 +617,12 @@ void SafeOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) glEnd(); } -void SafeOpenGLGraphics::drawRectangle(const Rect& rect) +void SafeOpenGLGraphics::drawRectangle(const Rect &restrict rect) restrict2 { drawRectangle(rect, false); } -void SafeOpenGLGraphics::fillRectangle(const Rect& rect) +void SafeOpenGLGraphics::fillRectangle(const Rect &restrict rect) restrict2 { drawRectangle(rect, true); } @@ -649,8 +665,8 @@ void SafeOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void SafeOpenGLGraphics::drawRectangle(const Rect& rect, - const bool filled) +void SafeOpenGLGraphics::drawRectangle(const Rect &restrict rect, + const bool filled) restrict2 { BLOCK_START("Graphics::drawRectangle") const float offset = filled ? 0 : 0.5F; @@ -710,15 +726,17 @@ void SafeOpenGLGraphics::clearScreen() const void SafeOpenGLGraphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_drawImageRect.hpp" } -void SafeOpenGLGraphics::calcImageRect(ImageVertexes *const vert, +void SafeOpenGLGraphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index fa0c4a0d1..4910e15aa 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -141,10 +141,10 @@ SDLGraphics::~SDLGraphics() { } -void SDLGraphics::drawRescaledImage(const Image *const image, +void SDLGraphics::drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { FUNC_BLOCK("Graphics::drawRescaledImage", 1) // Check that preconditions for blitting are met. @@ -171,14 +171,14 @@ void SDLGraphics::drawRescaledImage(const Image *const image, MSDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect); } -void SDLGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void SDLGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void SDLGraphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void SDLGraphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. @@ -209,14 +209,14 @@ void SDLGraphics::drawImageInline(const Image *const image, MSDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect); } -void SDLGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void SDLGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void SDLGraphics::drawImageCached(const Image *const image, - int x, int y) +void SDLGraphics::drawImageCached(const Image *restrict const image, + int x, int y) restrict2 { FUNC_BLOCK("Graphics::drawImageCached", 1) // Check that preconditions for blitting are met. @@ -247,9 +247,9 @@ void SDLGraphics::drawImageCached(const Image *const image, MSDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect); } -void SDLGraphics::drawPatternCached(const Image *const image, +void SDLGraphics::drawPatternCached(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPatternCached", 1) // Check that preconditions for blitting are met. @@ -294,20 +294,20 @@ void SDLGraphics::drawPatternCached(const Image *const image, } } -void SDLGraphics::completeCache() +void SDLGraphics::completeCache() restrict2 { } -void SDLGraphics::drawPattern(const Image *const image, +void SDLGraphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void SDLGraphics::drawPatternInline(const Image *const image, +void SDLGraphics::drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPattern", 1) // Check that preconditions for blitting are met. @@ -352,11 +352,11 @@ void SDLGraphics::drawPatternInline(const Image *const image, } } -void SDLGraphics::drawRescaledPattern(const Image *const image, +void SDLGraphics::drawRescaledPattern(const Image *restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) + const int scaledHeight) restrict2 { // Check that preconditions for blitting are met. if (!mWindow || !image) @@ -410,18 +410,18 @@ void SDLGraphics::drawRescaledPattern(const Image *const image, delete tmpImage; } -void SDLGraphics::calcPattern(ImageVertexes* const vert, - const Image *const image, +void SDLGraphics::calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { calcPatternInline(vert, image, x, y, w, h); } -void SDLGraphics::calcPatternInline(ImageVertexes* const vert, - const Image *const image, +void SDLGraphics::calcPatternInline(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { // Check that preconditions for blitting are met. if (!vert || !mWindow || !image || !image->mTexture) @@ -468,10 +468,10 @@ void SDLGraphics::calcPatternInline(ImageVertexes* const vert, } } -void SDLGraphics::calcPattern(ImageCollection* const vertCol, - const Image *const image, +void SDLGraphics::calcPattern(ImageCollection *restrict const vertCol, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { ImageVertexes *vert = nullptr; if (vertCol->currentImage != image) @@ -490,17 +490,17 @@ void SDLGraphics::calcPattern(ImageCollection* const vertCol, calcPatternInline(vert, image, x, y, w, h); } -void SDLGraphics::calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const +void SDLGraphics::calcTileVertexes(ImageVertexes *restrict const vert, + const Image *restrict const image, + int x, int y) const restrict2 { vert->image = image; calcTileSDL(vert, x, y); } -void SDLGraphics::calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int x, int y) const +void SDLGraphics::calcTileVertexesInline(ImageVertexes *restrict const vert, + const Image *restrict const image, + int x, int y) const restrict2 { vert->image = image; calcTileSDL(vert, x, y); @@ -538,9 +538,9 @@ void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const vert->sdl.push_back(rect); } -void SDLGraphics::calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) +void SDLGraphics::calcTileCollection(ImageCollection *restrict const vertCol, + const Image *restrict const image, + int x, int y) restrict2 { if (!vertCol) return; @@ -560,7 +560,7 @@ void SDLGraphics::calcTileCollection(ImageCollection *const vertCol, } void SDLGraphics::drawTileCollection(const ImageCollection - *const vertCol) + *restrict const vertCol) restrict2 { if (!vertCol) return; @@ -582,7 +582,8 @@ void SDLGraphics::drawTileCollection(const ImageCollection } } -void SDLGraphics::drawTileVertexes(const ImageVertexes *const vert) +void SDLGraphics::drawTileVertexes(const ImageVertexes *restrict const vert) + restrict2 { if (!vert) return; @@ -598,7 +599,7 @@ void SDLGraphics::drawTileVertexes(const ImageVertexes *const vert) } } -void SDLGraphics::updateScreen() +void SDLGraphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") SDL_RenderPresent(mRenderer); @@ -606,10 +607,10 @@ void SDLGraphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -void SDLGraphics::calcWindow(ImageCollection *const vertCol, +void SDLGraphics::calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) restrict2 { ImageVertexes *vert = nullptr; Image *const image = imgRect.grid[4]; @@ -630,7 +631,7 @@ void SDLGraphics::calcWindow(ImageCollection *const vertCol, calcImageRect(vert, x, y, w, h, imgRect); } -void SDLGraphics::fillRectangle(const Rect &rectangle) +void SDLGraphics::fillRectangle(const Rect &restrict rectangle) restrict2 { const ClipRect &top = mClipStack.top(); const SDL_Rect rect = @@ -645,17 +646,17 @@ void SDLGraphics::fillRectangle(const Rect &rectangle) SDL_RenderFillRects(mRenderer, &rect, 1); } -void SDLGraphics::beginDraw() +void SDLGraphics::beginDraw() restrict2 { pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } -void SDLGraphics::endDraw() +void SDLGraphics::endDraw() restrict2 { popClipArea(); } -void SDLGraphics::pushClipArea(const Rect &area) +void SDLGraphics::pushClipArea(const Rect &restrict area) restrict2 { Graphics::pushClipArea(area); @@ -664,7 +665,7 @@ void SDLGraphics::pushClipArea(const Rect &area) SDL_RenderSetClipRect(mRenderer, &rect); } -void SDLGraphics::popClipArea() +void SDLGraphics::popClipArea() restrict2 { Graphics::popClipArea(); @@ -676,7 +677,7 @@ void SDLGraphics::popClipArea() SDL_RenderSetClipRect(mRenderer, &rect); } -void SDLGraphics::drawPoint(int x, int y) +void SDLGraphics::drawPoint(int x, int y) restrict2 { if (mClipStack.empty()) return; @@ -700,7 +701,7 @@ void SDLGraphics::drawPoint(int x, int y) } -void SDLGraphics::drawRectangle(const Rect &rectangle) +void SDLGraphics::drawRectangle(const Rect &restrict rectangle) restrict2 { const ClipRect &top = mClipStack.top(); setRenderDrawColor(mColor); @@ -721,7 +722,8 @@ void SDLGraphics::drawRectangle(const Rect &rectangle) SDL_RenderDrawLines(mRenderer, points, 5); } -void SDLGraphics::drawLine(int x1, int y1, int x2, int y2) +void SDLGraphics::drawLine(int x1, int y1, + int x2, int y2) restrict2 { const ClipRect &top = mClipStack.top(); setRenderDrawColor(mColor); @@ -744,7 +746,7 @@ bool SDLGraphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -769,15 +771,15 @@ bool SDLGraphics::setVideoMode(const int w, const int h, void SDLGraphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) restrict2 { #include "render/graphics_drawImageRect.hpp" } -void SDLGraphics::calcImageRect(ImageVertexes *const vert, +void SDLGraphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 653fd5a68..841cd18bb 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -72,10 +72,10 @@ SDL2SoftwareGraphics::~SDL2SoftwareGraphics() { } -void SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, +void SDL2SoftwareGraphics::drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { FUNC_BLOCK("Graphics::drawRescaledImage", 1) // Check that preconditions for blitting are met. @@ -111,14 +111,14 @@ void SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, delete tmpImage; } -void SDL2SoftwareGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void SDL2SoftwareGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void SDL2SoftwareGraphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void SDL2SoftwareGraphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. @@ -204,14 +204,14 @@ void SDL2SoftwareGraphics::drawImageInline(const Image *const image, } } -void SDL2SoftwareGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void SDL2SoftwareGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void SDL2SoftwareGraphics::drawImageCached(const Image *const image, - int x, int y) +void SDL2SoftwareGraphics::drawImageCached(const Image *restrict const image, + int x, int y) restrict2 { FUNC_BLOCK("Graphics::drawImageCached", 1) // Check that preconditions for blitting are met. @@ -297,9 +297,9 @@ void SDL2SoftwareGraphics::drawImageCached(const Image *const image, } } -void SDL2SoftwareGraphics::drawPatternCached(const Image *const image, +void SDL2SoftwareGraphics::drawPatternCached(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPatternCached", 1) // Check that preconditions for blitting are met. @@ -407,20 +407,20 @@ void SDL2SoftwareGraphics::drawPatternCached(const Image *const image, } } -void SDL2SoftwareGraphics::completeCache() +void SDL2SoftwareGraphics::completeCache() restrict2 { } -void SDL2SoftwareGraphics::drawPattern(const Image *const image, +void SDL2SoftwareGraphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void SDL2SoftwareGraphics::drawPatternInline(const Image *const image, +void SDL2SoftwareGraphics::drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPattern", 1) // Check that preconditions for blitting are met. @@ -528,11 +528,13 @@ void SDL2SoftwareGraphics::drawPatternInline(const Image *const image, } } -void SDL2SoftwareGraphics::drawRescaledPattern(const Image *const image, +void SDL2SoftwareGraphics::drawRescaledPattern(const Image * + restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, const int scaledHeight) + restrict2 { // Check that preconditions for blitting are met. if (!mSurface || !image) @@ -594,18 +596,23 @@ void SDL2SoftwareGraphics::drawRescaledPattern(const Image *const image, delete tmpImage; } -void SDL2SoftwareGraphics::calcPattern(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDL2SoftwareGraphics::calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { calcPatternInline(vert, image, x, y, w, h); } -void SDL2SoftwareGraphics::calcPatternInline(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDL2SoftwareGraphics::calcPatternInline(ImageVertexes * + restrict const vert, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { // Check that preconditions for blitting are met. if (!vert || !mSurface || !image || !image->mSDLSurface) @@ -656,10 +663,12 @@ void SDL2SoftwareGraphics::calcPatternInline(ImageVertexes* const vert, } } -void SDL2SoftwareGraphics::calcPattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDL2SoftwareGraphics::calcPattern(ImageCollection *restrict const vertCol, + const Image *restrict const image, + const int x, + const int y, + const int w, + const int h) const restrict2 { ImageVertexes *vert = nullptr; if (vertCol->currentImage != image) @@ -678,24 +687,26 @@ void SDL2SoftwareGraphics::calcPattern(ImageCollection* const vertCol, calcPatternInline(vert, image, x, y, w, h); } -void SDL2SoftwareGraphics::calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const +void SDL2SoftwareGraphics::calcTileVertexes(ImageVertexes *restrict const vert, + const Image *restrict const image, + int x, int y) const restrict2 { vert->image = image; calcTileSDL(vert, x, y); } -void SDL2SoftwareGraphics::calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int x, int y) const +void SDL2SoftwareGraphics::calcTileVertexesInline(ImageVertexes * + restrict const vert, + const Image * + restrict const image, + int x, int y) const restrict2 { vert->image = image; calcTileSDL(vert, x, y); } void SDL2SoftwareGraphics::calcTileSDL(ImageVertexes *const vert, - int x, int y) const + int x, int y) const restrict2 { // Check that preconditions for blitting are met. if (!vert || !vert->image || !vert->image->mSDLSurface) @@ -723,9 +734,11 @@ void SDL2SoftwareGraphics::calcTileSDL(ImageVertexes *const vert, } } -void SDL2SoftwareGraphics::calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) +void SDL2SoftwareGraphics::calcTileCollection(ImageCollection * + restrict const vertCol, + const Image * + restrict const image, + int x, int y) restrict2 { if (!vertCol) return; @@ -745,7 +758,8 @@ void SDL2SoftwareGraphics::calcTileCollection(ImageCollection *const vertCol, } void SDL2SoftwareGraphics::drawTileCollection(const ImageCollection - *const vertCol) + *restrict const vertCol) + restrict2 { if (!vertCol) return; @@ -767,7 +781,8 @@ void SDL2SoftwareGraphics::drawTileCollection(const ImageCollection } } -void SDL2SoftwareGraphics::drawTileVertexes(const ImageVertexes *const vert) +void SDL2SoftwareGraphics::drawTileVertexes(const ImageVertexes * + restrict const vert) restrict2 { if (!vert) return; @@ -783,17 +798,18 @@ void SDL2SoftwareGraphics::drawTileVertexes(const ImageVertexes *const vert) } } -void SDL2SoftwareGraphics::updateScreen() +void SDL2SoftwareGraphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") SDL_UpdateWindowSurfaceRects(mWindow, &mRect, 1); BLOCK_END("Graphics::updateScreen") } -void SDL2SoftwareGraphics::calcWindow(ImageCollection *const vertCol, +void SDL2SoftwareGraphics::calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { ImageVertexes *vert = nullptr; Image *const image = imgRect.grid[4]; @@ -896,7 +912,8 @@ int SDL2SoftwareGraphics::SDL_FakeUpperBlit(const SDL_Surface *const src, return 0; } -void SDL2SoftwareGraphics::fillRectangle(const Rect &rectangle) +void SDL2SoftwareGraphics::fillRectangle(const Rect &restrict rectangle) + restrict2 { FUNC_BLOCK("Graphics::fillRectangle", 1) if (mClipStack.empty()) @@ -1087,17 +1104,17 @@ void SDL2SoftwareGraphics::fillRectangle(const Rect &rectangle) } } -void SDL2SoftwareGraphics::beginDraw() +void SDL2SoftwareGraphics::beginDraw() restrict2 { pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } -void SDL2SoftwareGraphics::endDraw() +void SDL2SoftwareGraphics::endDraw() restrict2 { popClipArea(); } -void SDL2SoftwareGraphics::pushClipArea(const Rect &area) +void SDL2SoftwareGraphics::pushClipArea(const Rect &restrict area) restrict2 { Graphics::pushClipArea(area); @@ -1106,7 +1123,7 @@ void SDL2SoftwareGraphics::pushClipArea(const Rect &area) SDL_SetClipRect(mSurface, &rect); } -void SDL2SoftwareGraphics::popClipArea() +void SDL2SoftwareGraphics::popClipArea() restrict2 { Graphics::popClipArea(); @@ -1118,7 +1135,7 @@ void SDL2SoftwareGraphics::popClipArea() SDL_SetClipRect(mSurface, &rect); } -void SDL2SoftwareGraphics::drawPoint(int x, int y) +void SDL2SoftwareGraphics::drawPoint(int x, int y) restrict2 { if (mClipStack.empty()) return; @@ -1264,7 +1281,7 @@ void SDL2SoftwareGraphics::drawHLine(int x1, int y, int x2) SDL_UnlockSurface(mSurface); } -void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) +void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) restrict2 { if (mClipStack.empty()) return; @@ -1399,7 +1416,8 @@ void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) SDL_UnlockSurface(mSurface); } -void SDL2SoftwareGraphics::drawRectangle(const Rect &rectangle) +void SDL2SoftwareGraphics::drawRectangle(const Rect &restrict rectangle) + restrict2 { const int x1 = rectangle.x; const int x2 = x1 + rectangle.width - 1; @@ -1413,7 +1431,8 @@ void SDL2SoftwareGraphics::drawRectangle(const Rect &rectangle) drawVLine(x2, y1, y2); } -void SDL2SoftwareGraphics::drawLine(int x1, int y1, int x2, int y2) +void SDL2SoftwareGraphics::drawLine(int x1, int y1, + int x2, int y2) restrict2 { if (x1 == x2) { @@ -1433,7 +1452,7 @@ bool SDL2SoftwareGraphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -1471,15 +1490,17 @@ bool SDL2SoftwareGraphics::resizeScreen(const int width, const int height) void SDL2SoftwareGraphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_drawImageRect.hpp" } -void SDL2SoftwareGraphics::calcImageRect(ImageVertexes *const vert, +void SDL2SoftwareGraphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) + restrict2 { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 66a954927..a31ae0ca3 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -57,10 +57,10 @@ SDLGraphics::~SDLGraphics() { } -void SDLGraphics::drawRescaledImage(const Image *const image, +void SDLGraphics::drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) + const int desiredHeight) restrict2 { FUNC_BLOCK("Graphics::drawRescaledImage", 1) // Check that preconditions for blitting are met. @@ -96,14 +96,14 @@ void SDLGraphics::drawRescaledImage(const Image *const image, delete tmpImage; } -void SDLGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void SDLGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void SDLGraphics::drawImageInline(const Image *const image, - int dstX, int dstY) +void SDLGraphics::drawImageInline(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. @@ -189,14 +189,14 @@ void SDLGraphics::drawImageInline(const Image *const image, } } -void SDLGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void SDLGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { drawImageInline(image, dstX, dstY); } -void SDLGraphics::drawImageCached(const Image *const image, - int x, int y) +void SDLGraphics::drawImageCached(const Image *restrict const image, + int x, int y) restrict2 { FUNC_BLOCK("Graphics::drawImageCached", 1) // Check that preconditions for blitting are met. @@ -282,9 +282,9 @@ void SDLGraphics::drawImageCached(const Image *const image, } } -void SDLGraphics::drawPatternCached(const Image *const image, +void SDLGraphics::drawPatternCached(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPatternCached", 1) // Check that preconditions for blitting are met. @@ -392,20 +392,20 @@ void SDLGraphics::drawPatternCached(const Image *const image, } } -void SDLGraphics::completeCache() +void SDLGraphics::completeCache() restrict2 { } -void SDLGraphics::drawPattern(const Image *const image, +void SDLGraphics::drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { drawPatternInline(image, x, y, w, h); } -void SDLGraphics::drawPatternInline(const Image *const image, +void SDLGraphics::drawPatternInline(const Image *restrict const image, const int x, const int y, - const int w, const int h) + const int w, const int h) restrict2 { FUNC_BLOCK("Graphics::drawPattern", 1) // Check that preconditions for blitting are met. @@ -513,11 +513,11 @@ void SDLGraphics::drawPatternInline(const Image *const image, } } -void SDLGraphics::drawRescaledPattern(const Image *const image, +void SDLGraphics::drawRescaledPattern(const Image *restrict const image, const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) + const int scaledHeight) restrict2 { // Check that preconditions for blitting are met. if (!mWindow || !image) @@ -579,18 +579,18 @@ void SDLGraphics::drawRescaledPattern(const Image *const image, delete tmpImage; } -void SDLGraphics::calcPattern(ImageVertexes* const vert, - const Image *const image, +void SDLGraphics::calcPattern(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { calcPatternInline(vert, image, x, y, w, h); } -void SDLGraphics::calcPatternInline(ImageVertexes* const vert, - const Image *const image, +void SDLGraphics::calcPatternInline(ImageVertexes *restrict const vert, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { // Check that preconditions for blitting are met. if (!vert || !mWindow || !image || !image->mSDLSurface) @@ -641,10 +641,10 @@ void SDLGraphics::calcPatternInline(ImageVertexes* const vert, } } -void SDLGraphics::calcPattern(ImageCollection* const vertCol, - const Image *const image, +void SDLGraphics::calcPattern(ImageCollection *restrict const vertCol, + const Image *restrict const image, const int x, const int y, - const int w, const int h) const + const int w, const int h) const restrict2 { if (!vertCol || !image) return; @@ -666,9 +666,9 @@ void SDLGraphics::calcPattern(ImageCollection* const vertCol, calcPatternInline(vert, image, x, y, w, h); } -void SDLGraphics::calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const +void SDLGraphics::calcTileVertexes(ImageVertexes *restrict const vert, + const Image *restrict const image, + int x, int y) const restrict2 { if (!vert || !image) return; @@ -676,9 +676,9 @@ void SDLGraphics::calcTileVertexes(ImageVertexes *const vert, calcTileSDL(vert, x, y); } -void SDLGraphics::calcTileVertexesInline(ImageVertexes *const vert, - const Image *const image, - int x, int y) const +void SDLGraphics::calcTileVertexesInline(ImageVertexes *restrict const vert, + const Image *restrict const image, + int x, int y) const restrict2 { if (!vert || !image) return; @@ -714,9 +714,9 @@ void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const } } -void SDLGraphics::calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) +void SDLGraphics::calcTileCollection(ImageCollection *restrict const vertCol, + const Image *restrict const image, + int x, int y) restrict2 { if (!vertCol) return; @@ -736,7 +736,7 @@ void SDLGraphics::calcTileCollection(ImageCollection *const vertCol, } void SDLGraphics::drawTileCollection(const ImageCollection - *const vertCol) + *restrict const vertCol) restrict2 { if (!vertCol) return; @@ -758,7 +758,8 @@ void SDLGraphics::drawTileCollection(const ImageCollection } } -void SDLGraphics::drawTileVertexes(const ImageVertexes *const vert) +void SDLGraphics::drawTileVertexes(const ImageVertexes * + restrict const vert) restrict2 { if (!vert) return; @@ -774,7 +775,7 @@ void SDLGraphics::drawTileVertexes(const ImageVertexes *const vert) } } -void SDLGraphics::updateScreen() +void SDLGraphics::updateScreen() restrict2 { BLOCK_START("Graphics::updateScreen") if (mDoubleBuffer) @@ -789,10 +790,10 @@ void SDLGraphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -void SDLGraphics::calcWindow(ImageCollection *const vertCol, +void SDLGraphics::calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) restrict2 { if (!vertCol) return; @@ -895,7 +896,7 @@ int SDLGraphics::SDL_FakeUpperBlit(const SDL_Surface *const src, return 0; } -void SDLGraphics::fillRectangle(const Rect& rectangle) +void SDLGraphics::fillRectangle(const Rect &restrict rectangle) restrict2 { FUNC_BLOCK("Graphics::fillRectangle", 1) if (mClipStack.empty()) @@ -1095,17 +1096,17 @@ void SDLGraphics::fillRectangle(const Rect& rectangle) } } -void SDLGraphics::beginDraw() +void SDLGraphics::beginDraw() restrict2 { pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } -void SDLGraphics::endDraw() +void SDLGraphics::endDraw() restrict2 { popClipArea(); } -void SDLGraphics::pushClipArea(const Rect &area) +void SDLGraphics::pushClipArea(const Rect &restrict area) restrict2 { Graphics::pushClipArea(area); const ClipRect &carea = mClipStack.top(); @@ -1119,7 +1120,7 @@ void SDLGraphics::pushClipArea(const Rect &area) SDL_SetClipRect(mWindow, &rect); } -void SDLGraphics::popClipArea() +void SDLGraphics::popClipArea() restrict2 { Graphics::popClipArea(); @@ -1138,7 +1139,7 @@ void SDLGraphics::popClipArea() SDL_SetClipRect(mWindow, &rect); } -void SDLGraphics::drawPoint(int x, int y) +void SDLGraphics::drawPoint(int x, int y) restrict2 { if (mClipStack.empty()) return; @@ -1419,7 +1420,7 @@ void SDLGraphics::drawVLine(int x, int y1, int y2) SDL_UnlockSurface(mWindow); } -void SDLGraphics::drawRectangle(const Rect &rectangle) +void SDLGraphics::drawRectangle(const Rect &restrict rectangle) restrict2 { const int x1 = rectangle.x; const int x2 = x1 + rectangle.width - 1; @@ -1433,7 +1434,8 @@ void SDLGraphics::drawRectangle(const Rect &rectangle) drawVLine(x2, y1, y2); } -void SDLGraphics::drawLine(int x1, int y1, int x2, int y2) +void SDLGraphics::drawLine(int x1, int y1, + int x2, int y2) restrict2 { if (x1 == x2) { @@ -1455,7 +1457,7 @@ bool SDLGraphics::setVideoMode(const int w, const int h, const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) + const bool noFrame) restrict2 { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame); @@ -1475,15 +1477,15 @@ bool SDLGraphics::setVideoMode(const int w, const int h, void SDLGraphics::drawImageRect(const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) restrict2 { #include "render/graphics_drawImageRect.hpp" } -void SDLGraphics::calcImageRect(ImageVertexes *const vert, +void SDLGraphics::calcImageRect(ImageVertexes *restrict const vert, const int x, const int y, const int w, const int h, - const ImageRect &imgRect) + const ImageRect &restrict imgRect) restrict2 { #include "render/graphics_calcImageRect.hpp" } diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp index e94aba5a5..b5d710ec4 100644 --- a/src/render/surfacegraphics.cpp +++ b/src/render/surfacegraphics.cpp @@ -40,8 +40,8 @@ SurfaceGraphics::~SurfaceGraphics() { } -void SurfaceGraphics::drawImage(const Image *const image, - int dstX, int dstY) +void SurfaceGraphics::drawImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. @@ -73,8 +73,8 @@ void SurfaceGraphics::drawImage(const Image *const image, #endif } -void SurfaceGraphics::copyImage(const Image *const image, - int dstX, int dstY) +void SurfaceGraphics::copyImage(const Image *restrict const image, + int dstX, int dstY) restrict2 { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. @@ -99,8 +99,8 @@ void SurfaceGraphics::copyImage(const Image *const image, #endif } -void SurfaceGraphics::drawImageCached(const Image *const image, - int x, int y) +void SurfaceGraphics::drawImageCached(const Image *restrict const image, + int x, int y) restrict2 { FUNC_BLOCK("Graphics::drawImageCached", 1) // Check that preconditions for blitting are met. @@ -133,6 +133,6 @@ void SurfaceGraphics::drawImageCached(const Image *const image, #endif } -void SurfaceGraphics::completeCache() +void SurfaceGraphics::completeCache() restrict2 { } diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index 1de7cbc71..6c821ebfd 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -62,7 +62,7 @@ class SurfaceGraphics final : public Graphics void pushClipArea(const Rect &rect A_UNUSED) override final { } - void popClipArea() override final + void popClipArea() restrict2 override final { } void drawRescaledImage(const Image *const image A_UNUSED, @@ -169,14 +169,14 @@ class SurfaceGraphics final : public Graphics const int bpp A_UNUSED, const bool fs A_UNUSED, const bool hwaccel A_UNUSED, const bool resize A_UNUSED, - const bool noFrame A_UNUSED) override final + const bool noFrame A_UNUSED) restrict2 override final { return false; } void drawImage(const Image *const image, int dstX, int dstY) override final; void copyImage(const Image *const image, - int dstX, int dstY) override final; + int dstX, int dstY) restrict2 override final; void drawImageCached(const Image *const image, int x, int y) override final; |