summaryrefslogtreecommitdiff
path: root/src/render/sdlgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-25 00:31:58 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-25 00:31:58 +0300
commitf0f4f43d1263f946be23b75de4de28a4731cc93a (patch)
treea572d7d28c42f727c94a70d3eedb03c2c63248b2 /src/render/sdlgraphics.cpp
parent1f4cf5720cd6c432c2544d34a804c96b8c7858f0 (diff)
downloadmanaplus-f0f4f43d1263f946be23b75de4de28a4731cc93a.tar.gz
manaplus-f0f4f43d1263f946be23b75de4de28a4731cc93a.tar.bz2
manaplus-f0f4f43d1263f946be23b75de4de28a4731cc93a.tar.xz
manaplus-f0f4f43d1263f946be23b75de4de28a4731cc93a.zip
Add restrict keyword into graphicsdef.hpp
Diffstat (limited to 'src/render/sdlgraphics.cpp')
-rw-r--r--src/render/sdlgraphics.cpp110
1 files changed, 56 insertions, 54 deletions
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"
}