diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-24 18:26:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-24 18:26:52 +0300 |
commit | 67ee3168a45ea09a863de5be2e0a94cf1afbe6dc (patch) | |
tree | aa33639f3e70f81444b893bbbb99ab78f6beb2d6 /src | |
parent | a602d5c2460b197866028cfb3d2aa2b7b3aea80c (diff) | |
download | manaplus-67ee3168a45ea09a863de5be2e0a94cf1afbe6dc.tar.gz manaplus-67ee3168a45ea09a863de5be2e0a94cf1afbe6dc.tar.bz2 manaplus-67ee3168a45ea09a863de5be2e0a94cf1afbe6dc.tar.xz manaplus-67ee3168a45ea09a863de5be2e0a94cf1afbe6dc.zip |
Fix compilation with clang.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fonts/font.h | 26 | ||||
-rw-r--r-- | src/gui/fonts/textchunk.cpp | 13 | ||||
-rw-r--r-- | src/gui/fonts/textchunk.h | 6 | ||||
-rw-r--r-- | src/gui/fonts/textchunklist.cpp | 6 | ||||
-rw-r--r-- | src/gui/fonts/textchunklist.h | 12 | ||||
-rw-r--r-- | src/gui/fonts/textchunksmall.h | 4 | ||||
-rw-r--r-- | src/render/graphics.h | 160 | ||||
-rw-r--r-- | src/resources/map/maplayer.cpp | 22 | ||||
-rw-r--r-- | src/resources/map/maplayer.h | 8 | ||||
-rw-r--r-- | src/touchmanager.cpp | 34 | ||||
-rw-r--r-- | src/touchmanager.h | 38 |
11 files changed, 166 insertions, 163 deletions
diff --git a/src/gui/fonts/font.h b/src/gui/fonts/font.h index 6066c491f..9fb64af29 100644 --- a/src/gui/fonts/font.h +++ b/src/gui/fonts/font.h @@ -95,13 +95,13 @@ class Font final void loadFont(std::string filename, const int size, - const int style = 0) restrict; + const int style = 0) restrict2; - int getWidth(const std::string &text) const restrict A_WARN_UNUSED; + int getWidth(const std::string &text) const restrict2 A_WARN_UNUSED; - int getHeight() const restrict A_WARN_UNUSED; + int getHeight() const restrict2 A_WARN_UNUSED; - const TextChunkList *getCache() const restrict A_CONST A_WARN_UNUSED; + const TextChunkList *getCache() const restrict2 A_CONST A_WARN_UNUSED; /** * @see Font::drawString @@ -111,26 +111,26 @@ class Font final const Color &restrict col2, const std::string &restrict text, const int x, - const int y) restrict A_NONNULL(2); + const int y) restrict2 A_NONNULL(2); - void clear() restrict; + void clear() restrict2; - void doClean() restrict; + void doClean() restrict2; - void slowLogic(const int rnd) restrict; + void slowLogic(const int rnd) restrict2; - int getCreateCounter() const restrict A_WARN_UNUSED + int getCreateCounter() const restrict2 A_WARN_UNUSED { return mCreateCounter; } - int getDeleteCounter() const restrict A_WARN_UNUSED + int getDeleteCounter() const restrict2 A_WARN_UNUSED { return mDeleteCounter; } int getStringIndexAt(const std::string &restrict text, - const int x) const restrict A_WARN_UNUSED; + const int x) const restrict2 A_WARN_UNUSED; - void generate(TextChunk &restrict chunk) restrict; + void generate(TextChunk &restrict chunk) restrict2; - void insertChunk(TextChunk *const chunk) restrict; + void insertChunk(TextChunk *const chunk) restrict2; static bool mSoftMode; diff --git a/src/gui/fonts/textchunk.cpp b/src/gui/fonts/textchunk.cpp index b88f4830e..707435ace 100644 --- a/src/gui/fonts/textchunk.cpp +++ b/src/gui/fonts/textchunk.cpp @@ -61,10 +61,10 @@ TextChunk::TextChunk() : #endif } -TextChunk::TextChunk(const std::string &text0, - const Color &color0, - const Color &color1, - Font *const font) : +TextChunk::TextChunk(const std::string &restrict text0, + const Color &restrict color0, + const Color &restrict color1, + Font *restrict const font) : img(nullptr), textFont(font), text(text0), @@ -86,13 +86,14 @@ TextChunk::~TextChunk() #endif } -bool TextChunk::operator==(const TextChunk &chunk) const +bool TextChunk::operator==(const TextChunk &restrict chunk) const { return (chunk.text == text && chunk.color == color && chunk.color2 == color2); } -void TextChunk::generate(TTF_Font *const font, const float alpha) +void TextChunk::generate(TTF_Font *restrict const font, + const float alpha) { BLOCK_START("TextChunk::generate") SDL_Color sdlCol; diff --git a/src/gui/fonts/textchunk.h b/src/gui/fonts/textchunk.h index 5224cd3e7..b06f2f4cd 100644 --- a/src/gui/fonts/textchunk.h +++ b/src/gui/fonts/textchunk.h @@ -49,12 +49,12 @@ class TextChunk final ~TextChunk(); - bool operator==(const TextChunk &restrict chunk) const restrict; + bool operator==(const TextChunk &restrict chunk) const restrict2; void generate(TTF_Font *restrict const font, - const float alpha) restrict; + const float alpha) restrict2; - void deleteImage() restrict; + void deleteImage() restrict2; Image *restrict img; Font *restrict textFont; diff --git a/src/gui/fonts/textchunklist.cpp b/src/gui/fonts/textchunklist.cpp index 9458bf947..2b613b2da 100644 --- a/src/gui/fonts/textchunklist.cpp +++ b/src/gui/fonts/textchunklist.cpp @@ -33,7 +33,7 @@ TextChunkList::TextChunkList() : { } -void TextChunkList::insertFirst(TextChunk *const item) +void TextChunkList::insertFirst(TextChunk *restrict const item) { TextChunk *restrict const oldFirst = start; if (start) @@ -49,7 +49,7 @@ void TextChunkList::insertFirst(TextChunk *const item) searchWidth[item->text] = item; } -void TextChunkList::moveToFirst(TextChunk *const item) +void TextChunkList::moveToFirst(TextChunk *restrict const item) { if (item == start) return; @@ -70,7 +70,7 @@ void TextChunkList::moveToFirst(TextChunk *const item) start = item; } -void TextChunkList::remove(const TextChunk *const item) +void TextChunkList::remove(const TextChunk *restrict const item) { if (!item) return; diff --git a/src/gui/fonts/textchunklist.h b/src/gui/fonts/textchunklist.h index f9cf97b92..ce68d3931 100644 --- a/src/gui/fonts/textchunklist.h +++ b/src/gui/fonts/textchunklist.h @@ -36,17 +36,17 @@ class TextChunkList final A_DELETE_COPY(TextChunkList) - void insertFirst(TextChunk *restrict const item) restrict A_NONNULL(2); + void insertFirst(TextChunk *restrict const item) restrict2 A_NONNULL(2); - void moveToFirst(TextChunk *restrict const item) restrict A_NONNULL(2); + void moveToFirst(TextChunk *restrict const item) restrict2 A_NONNULL(2); - void remove(const TextChunk *restrict const item) restrict; + void remove(const TextChunk *restrict const item) restrict2; - void removeBack() restrict; + void removeBack() restrict2; - void removeBack(int n) restrict; + void removeBack(int n) restrict2; - void clear() restrict; + void clear() restrict2; TextChunk *restrict start; TextChunk *restrict end; diff --git a/src/gui/fonts/textchunksmall.h b/src/gui/fonts/textchunksmall.h index cf0277547..73e4b96d3 100644 --- a/src/gui/fonts/textchunksmall.h +++ b/src/gui/fonts/textchunksmall.h @@ -36,8 +36,8 @@ class TextChunkSmall final TextChunkSmall(const TextChunkSmall &restrict old); - bool operator==(const TextChunkSmall &restrict chunk) const restrict; - bool operator<(const TextChunkSmall &restrict chunk) const restrict; + bool operator==(const TextChunkSmall &restrict chunk) const restrict2; + bool operator<(const TextChunkSmall &restrict chunk) const restrict2; std::string text; Color color; diff --git a/src/render/graphics.h b/src/render/graphics.h index 2265b8aad..4d30f210b 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -128,23 +128,23 @@ class Graphics notfinal }; void setWindow(SDL_Window *restrict const window, - const int width, const int height) restrict + const int width, const int height) restrict2 { mWindow = window; mRect.w = static_cast<RectSize>(width); mRect.h = static_cast<RectSize>(height); } - SDL_Window *getWindow() restrict const + SDL_Window *getWindow() restrict2 const { return mWindow; } /** * Sets whether vertical refresh syncing is enabled. Takes effect after * the next call to setVideoMode(). Only implemented on MacOS for now. */ - void setSync(const bool sync) restrict; + void setSync(const bool sync) restrict2; - bool getSync() const restrict A_WARN_UNUSED + bool getSync() const restrict2 A_WARN_UNUSED { return mSync; } /** @@ -156,19 +156,20 @@ class Graphics notfinal const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) restrict = 0; + const bool noFrame) restrict2 = 0; /** * Set fullscreen mode. */ - bool setFullscreen(const bool fs) restrict; + bool setFullscreen(const bool fs) restrict2; /** * Resize the window to the specified size. */ - virtual bool resizeScreen(const int width, const int height) restrict; + virtual bool resizeScreen(const int width, + const int height) restrict2; - virtual void restoreContext() restrict + virtual void restoreContext() restrict2 { } /** @@ -177,11 +178,11 @@ class Graphics notfinal virtual void drawRescaledImage(const Image *restrict const image, int dstX, int dstY, const int desiredWidth, - const int desiredHeight) restrict = 0; + const int desiredHeight) restrict2 = 0; virtual void drawPattern(const Image *restrict const image, const int x, const int y, - const int w, const int h) restrict = 0; + const int w, const int h) restrict2 = 0; /** * Draw a pattern based on a rescaled version of the given image... @@ -190,138 +191,138 @@ class Graphics notfinal const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight) restrict = 0; + const int scaledHeight) restrict2 = 0; virtual void drawImageRect(const int x, const int y, const int w, const int h, const ImageRect &restrict imgRect) - restrict = 0; + restrict2 = 0; virtual void calcPattern(ImageVertexes *restrict const vert, const Image *restrict const image, const int x, const int y, - const int w, const int h) const restrict = 0; + const int w, const int h) const restrict2 = 0; virtual void calcPattern(ImageCollection *restrict const vert, const Image *restrict const image, const int x, const int y, - const int w, const int h) const restrict = 0; + const int w, const int h) const restrict2 = 0; virtual void calcTileVertexes(ImageVertexes *restrict const vert, const Image *restrict const image, - int x, int y) const restrict = 0; + int x, int y) const restrict2 = 0; virtual void calcTileSDL(ImageVertexes *restrict const vert A_UNUSED, - int x A_UNUSED, int y A_UNUSED) const restrict + int x A_UNUSED, int y A_UNUSED) const restrict2 { } virtual void drawTileVertexes(const ImageVertexes *restrict const vert) - restrict = 0; + restrict2 = 0; virtual void drawTileCollection(const ImageCollection - *restrict const vertCol) restrict = 0; + *restrict const vertCol) restrict2 = 0; virtual void calcTileCollection(ImageCollection *restrict const vertCol, const Image *restrict const image, - int x, int y) restrict = 0; + int x, int y) restrict2 = 0; virtual void calcWindow(ImageCollection *restrict const vertCol, const int x, const int y, const int w, const int h, - const ImageRect &restrict imgRect) restrict = 0; + const ImageRect &restrict imgRect) restrict2 = 0; - virtual void fillRectangle(const Rect &restrict rectangle) restrict = 0; + virtual void fillRectangle(const Rect &restrict rectangle) restrict2 = 0; /** * Updates the screen. This is done by either copying the buffer to the * screen or swapping pages. */ - virtual void updateScreen() restrict = 0; + virtual void updateScreen() restrict2 = 0; #ifdef USE_SDL2 - void setWindowSize(const int width, const int height) restrict; + void setWindowSize(const int width, const int height) restrict2; #else - void setWindowSize(const int width, const int height) restrict A_CONST; + void setWindowSize(const int width, const int height) restrict2 A_CONST; #endif /** * Returns the width of the screen. */ - int getWidth() const restrict A_WARN_UNUSED; + int getWidth() const restrict2 A_WARN_UNUSED; /** * Returns the height of the screen. */ - int getHeight() const restrict A_WARN_UNUSED; + int getHeight() const restrict2 A_WARN_UNUSED; - int getMemoryUsage() const restrict A_WARN_UNUSED; + int getMemoryUsage() const restrict2 A_WARN_UNUSED; virtual void drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height) restrict; + const int width, const int height) restrict2; - ClipRect &getTopClip() restrict A_WARN_UNUSED + ClipRect &getTopClip() restrict2 A_WARN_UNUSED { return mClipStack.top(); } - void setRedraw(const bool n) restrict + void setRedraw(const bool n) restrict2 { mRedraw = n; } - bool getRedraw() const restrict A_WARN_UNUSED + bool getRedraw() const restrict2 A_WARN_UNUSED { return mRedraw; } - void setSecure(const bool n) restrict + void setSecure(const bool n) restrict2 { mSecure = n; } - bool getSecure() const restrict A_WARN_UNUSED + bool getSecure() const restrict2 A_WARN_UNUSED { return mSecure; } - int getBpp() const restrict A_WARN_UNUSED + int getBpp() const restrict2 A_WARN_UNUSED { return mBpp; } - bool getFullScreen() const restrict A_WARN_UNUSED + bool getFullScreen() const restrict2 A_WARN_UNUSED { return mFullscreen; } - bool getHWAccel() const restrict A_WARN_UNUSED + bool getHWAccel() const restrict2 A_WARN_UNUSED { return mHWAccel; } - bool getDoubleBuffer() const restrict A_WARN_UNUSED + bool getDoubleBuffer() const restrict2 A_WARN_UNUSED { return mDoubleBuffer; } - RenderType getOpenGL() const restrict A_WARN_UNUSED + RenderType getOpenGL() const restrict2 A_WARN_UNUSED { return mOpenGL; } - void setNoFrame(const bool n) restrict + void setNoFrame(const bool n) restrict2 { mNoFrame = n; } - const std::string &getName() const restrict A_WARN_UNUSED + const std::string &getName() const restrict2 A_WARN_UNUSED { return mName; } - virtual void initArrays(const int vertCount A_UNUSED) restrict + virtual void initArrays(const int vertCount A_UNUSED) restrict2 { } - virtual void setColor(const Color &restrict color) restrict + virtual void setColor(const Color &restrict color) restrict2 { mColor = color; mAlpha = (color.a != 255); } - const Color &getColor() const restrict + const Color &getColor() const restrict2 { return mColor; } #ifdef DEBUG_DRAW_CALLS - virtual unsigned int getDrawCalls() const restrict + virtual unsigned int getDrawCalls() const restrict2 { return 0; } #endif #ifdef DEBUG_BIND_TEXTURE - virtual unsigned int getBinds() const restrict + virtual unsigned int getBinds() const restrict2 { return 0; } #endif #ifdef USE_SDL2 void dumpRendererInfo(const char *restrict const str, - const SDL_RendererInfo &restrict info) restrict; + const SDL_RendererInfo &restrict info) restrict2; - virtual void setRendererFlags(const uint32_t flags A_UNUSED) restrict + virtual void setRendererFlags(const uint32_t flags A_UNUSED) restrict2 { } #endif @@ -332,27 +333,27 @@ class Graphics notfinal * <code>false</code> otherwise. */ virtual void drawImage(const Image *restrict const image, - int dstX, int dstY) restrict = 0; + int dstX, int dstY) restrict2 = 0; virtual void copyImage(const Image *restrict const image, - int dstX, int dstY) restrict = 0; + int dstX, int dstY) restrict2 = 0; virtual void drawImageCached(const Image *restrict const image, - int srcX, int srcY) restrict = 0; + int srcX, int srcY) restrict2 = 0; virtual void drawPatternCached(const Image *restrict const image, const int x, const int y, - const int w, const int h) restrict = 0; + const int w, const int h) restrict2 = 0; - virtual void completeCache() restrict = 0; + virtual void completeCache() restrict2 = 0; - int getScale() const restrict + int getScale() const restrict2 { return mScale; } - virtual bool isAllowScale() const restrict + virtual bool isAllowScale() const restrict2 { return false; } - void setScale(int scale) restrict; + void setScale(int scale) restrict2; /** * Pushes a clip area onto the stack. The x and y coordinates in the @@ -365,14 +366,14 @@ class Graphics notfinal * * @param area The clip area to be pushed onto the stack. */ - virtual void pushClipArea(const Rect &restrict area) restrict; + virtual void pushClipArea(const Rect &restrict area) restrict2; /** * Removes the top most clip area from the stack. * * @throws Exception if the stack is empty. */ - virtual void popClipArea() restrict; + virtual void popClipArea() restrict2; /** * Ddraws a line. @@ -382,7 +383,8 @@ class Graphics notfinal * @param x2 The second x coordinate. * @param y2 The second y coordinate. */ - virtual void drawLine(int x1, int y1, int x2, int y2) restrict = 0; + virtual void drawLine(int x1, int y1, + int x2, int y2) restrict2 = 0; /** * Draws a simple, non-filled, rectangle with a one pixel width. @@ -390,13 +392,13 @@ class Graphics notfinal * @param rectangle The rectangle to draw. */ virtual void drawRectangle(const Rect &restrict rectangle) - restrict = 0; + restrict2 = 0; #ifdef USE_OPENGL #ifdef USE_SDL2 - virtual void createGLContext() restrict; + virtual void createGLContext() restrict2; #else - virtual void createGLContext() restrict A_CONST; + virtual void createGLContext() restrict2 A_CONST; #endif #endif @@ -406,7 +408,7 @@ class Graphics notfinal * @param x The x coordinate. * @param y The y coordinate. */ - virtual void drawPoint(int x, int y) restrict = 0; + virtual void drawPoint(int x, int y) restrict2 = 0; /** * Initializes drawing. Called by the Gui when Gui::draw() is called. @@ -419,7 +421,7 @@ class Graphics notfinal * * @see endDraw, Gui::draw */ - virtual void beginDraw() restrict + virtual void beginDraw() restrict2 { } /** @@ -431,35 +433,35 @@ class Graphics notfinal * * @see beginDraw, Gui::draw */ - virtual void endDraw() restrict + virtual void endDraw() restrict2 { } - virtual void clearScreen() const restrict + virtual void clearScreen() const restrict2 { } - virtual void deleteArrays() restrict + virtual void deleteArrays() restrict2 { } - virtual void postInit() restrict + virtual void postInit() restrict2 { } virtual void finalize(ImageCollection *restrict const col A_UNUSED) - restrict + restrict2 { } virtual void finalize(ImageVertexes *restrict const vert A_UNUSED) - restrict + restrict2 { } - virtual void testDraw() restrict + virtual void testDraw() restrict2 { } virtual void removeArray(const uint32_t sz A_UNUSED, uint32_t *restrict const arr A_UNUSED) - restrict + restrict2 { } - virtual void screenResized() restrict + virtual void screenResized() restrict2 { } int mWidth; @@ -479,20 +481,20 @@ class Graphics notfinal const bool fs, const bool hwaccel, const bool resize, - const bool noFrame) restrict; + const bool noFrame) restrict2; - int getOpenGLFlags() const restrict A_WARN_UNUSED; + int getOpenGLFlags() const restrict2 A_WARN_UNUSED; - int getSoftwareFlags() const restrict A_WARN_UNUSED; + int getSoftwareFlags() const restrict2 A_WARN_UNUSED; - bool setOpenGLMode() restrict; + bool setOpenGLMode() restrict2; - void updateMemoryInfo() restrict; + void updateMemoryInfo() restrict2; - bool videoInfo() restrict; + bool videoInfo() restrict2; #ifdef USE_OPENGL - void setOpenGLFlags() restrict; + void setOpenGLFlags() restrict2; #endif /** * Holds the clip area stack. diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp index b35960965..6b57837d9 100644 --- a/src/resources/map/maplayer.cpp +++ b/src/resources/map/maplayer.cpp @@ -83,7 +83,7 @@ MapLayer::~MapLayer() mTempRows.clear(); } -void MapLayer::optionChanged(const std::string &value) +void MapLayer::optionChanged(const std::string &value) restrict { if (value == "highlightAttackRange") { @@ -94,7 +94,7 @@ void MapLayer::optionChanged(const std::string &value) void MapLayer::setTile(const int x, const int y, - Image *const img) + Image *const img) restrict { mTiles[x + y * mWidth].image = img; } @@ -105,7 +105,7 @@ void MapLayer::draw(Graphics *const graphics, int endX, int endY, const int scrollX, - const int scrollY) const + const int scrollY) const restrict { if (!localPlayer) return; @@ -175,7 +175,7 @@ void MapLayer::draw(Graphics *const graphics, BLOCK_END("MapLayer::draw") } -void MapLayer::drawSDL(Graphics *const graphics) const +void MapLayer::drawSDL(Graphics *const graphics) const restrict2 { BLOCK_START("MapLayer::drawSDL") MapRows::const_iterator rit = mTempRows.begin(); @@ -202,7 +202,7 @@ void MapLayer::updateSDL(const Graphics *const graphics, int endX, int endY, const int scrollX, - const int scrollY) + const int scrollY) restrict2 { BLOCK_START("MapLayer::updateSDL") delete_all(mTempRows); @@ -270,7 +270,7 @@ void MapLayer::updateOGL(Graphics *const graphics, int endX, int endY, const int scrollX, - const int scrollY) + const int scrollY) restrict2 { BLOCK_START("MapLayer::updateOGL") delete_all(mTempRows); @@ -353,7 +353,7 @@ void MapLayer::updateOGL(Graphics *const graphics, BLOCK_END("MapLayer::updateOGL") } -void MapLayer::drawOGL(Graphics *const graphics) const +void MapLayer::drawOGL(Graphics *const graphics) const restrict2 { BLOCK_START("MapLayer::drawOGL") MapRows::const_iterator rit = mTempRows.begin(); @@ -384,7 +384,7 @@ void MapLayer::drawFringe(Graphics *const graphics, int endY, const int scrollX, const int scrollY, - const Actors &actors) const + const Actors &actors) const restrict { BLOCK_START("MapLayer::drawFringe") if (!localPlayer || @@ -680,7 +680,7 @@ void MapLayer::drawFringe(Graphics *const graphics, BLOCK_END("MapLayer::drawFringe") } -int MapLayer::getTileDrawWidth(const TileInfo *tilePtr, +int MapLayer::getTileDrawWidth(const TileInfo *restrict tilePtr, const int endX, int &width) { @@ -708,7 +708,7 @@ int MapLayer::getTileDrawWidth(const TileInfo *tilePtr, return c; } -void MapLayer::setDrawLayerFlags(const MapTypeT &n) +void MapLayer::setDrawLayerFlags(const MapTypeT &n) restrict { mDrawLayerFlags = n; mSpecialFlag = (mDrawLayerFlags != MapType::SPECIAL && @@ -718,7 +718,7 @@ void MapLayer::setDrawLayerFlags(const MapTypeT &n) void MapLayer::updateConditionTiles(MetaTile *const metaTiles, const int width, - const int height) + const int height) restrict { const int width1 = width < mWidth ? width : mWidth; const int height1 = height < mHeight ? height : mHeight; diff --git a/src/resources/map/maplayer.h b/src/resources/map/maplayer.h index 458f49d00..750db4e4b 100644 --- a/src/resources/map/maplayer.h +++ b/src/resources/map/maplayer.h @@ -105,11 +105,11 @@ class MapLayer final: public ConfigListener const int scrollX, const int scrollY) const restrict A_NONNULL(2); - void drawSDL(Graphics *restrict const graphics) const restrict + void drawSDL(Graphics *restrict const graphics) const restrict2 A_NONNULL(2); #ifdef USE_OPENGL - void drawOGL(Graphics *restrict const graphics) const restrict + void drawOGL(Graphics *restrict const graphics) const restrict2 A_NONNULL(2); void updateOGL(Graphics *restrict const graphics, @@ -118,7 +118,7 @@ class MapLayer final: public ConfigListener int endX, int endY, const int scrollX, - const int scrollY) restrict A_NONNULL(2); + const int scrollY) restrict2 A_NONNULL(2); #endif void updateSDL(const Graphics *restrict const graphics, @@ -127,7 +127,7 @@ class MapLayer final: public ConfigListener int endX, int endY, const int scrollX, - const int scrollY) restrict A_NONNULL(2); + const int scrollY) restrict2 A_NONNULL(2); void drawFringe(Graphics *restrict const graphics, int startX, diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index 6b84fa9b0..1a8d78cf6 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -77,12 +77,12 @@ TouchManager::~TouchManager() CHECKLISTENERS } -void TouchManager::shutdown() restrict +void TouchManager::shutdown() restrict2 { config.removeListeners(this); } -void TouchManager::init() restrict +void TouchManager::init() restrict2 { config.addListener("showScreenJoystick", this); config.addListener("showScreenButtons", this); @@ -122,7 +122,7 @@ void TouchManager::loadTouchItem(TouchItem **restrict item, const TouchFuncPtr fAll, const TouchFuncPtr fPressed, const TouchFuncPtr fReleased, - const TouchFuncPtr fOut) restrict + const TouchFuncPtr fOut) restrict2 { *item = nullptr; if (!theme) @@ -185,7 +185,7 @@ void TouchManager::loadTouchItem(TouchItem **restrict item, mRedraw = true; } -void TouchManager::clear() restrict +void TouchManager::clear() restrict2 { FOR_EACH (TouchItemVectorCIter, it, mObjects) unload(*it); @@ -193,7 +193,7 @@ void TouchManager::clear() restrict mRedraw = true; } -void TouchManager::draw() restrict +void TouchManager::draw() restrict2 { if (mRedraw) { @@ -222,7 +222,7 @@ void TouchManager::draw() restrict drawText(); } -void TouchManager::safeDraw() restrict +void TouchManager::safeDraw() restrict2 { FOR_EACH (TouchItemVectorCIter, it, mObjects) { @@ -244,7 +244,7 @@ void TouchManager::safeDraw() restrict drawText(); } -void TouchManager::drawText() restrict +void TouchManager::drawText() restrict2 { if (!gui) return; @@ -271,7 +271,7 @@ void TouchManager::drawText() restrict } } -bool TouchManager::processEvent(const MouseInput &mouseInput) restrict +bool TouchManager::processEvent(const MouseInput &mouseInput) restrict2 { const int x = mouseInput.getTouchX(); const int y = mouseInput.getTouchY(); @@ -325,7 +325,7 @@ bool TouchManager::processEvent(const MouseInput &mouseInput) restrict return false; } -bool TouchManager::isActionActive(const InputActionT index) restrict const +bool TouchManager::isActionActive(const InputActionT index) restrict2 const { if (static_cast<int>(index) < 0 || static_cast<int>(index) >= actionsSize) @@ -335,7 +335,7 @@ bool TouchManager::isActionActive(const InputActionT index) restrict const return mActions[static_cast<size_t>(index)]; } -void TouchManager::resize(const int width, const int height) restrict +void TouchManager::resize(const int width, const int height) restrict2 { mRedraw = true; const int maxHeight = mHeight; @@ -391,7 +391,7 @@ void TouchManager::unload(TouchItem *restrict const item) } } -void TouchManager::unloadTouchItem(TouchItem *restrict *unloadItem) restrict +void TouchManager::unloadTouchItem(TouchItem *restrict *unloadItem) restrict2 { FOR_EACH (TouchItemVectorIter, it, mObjects) { @@ -405,14 +405,14 @@ void TouchManager::unloadTouchItem(TouchItem *restrict *unloadItem) restrict } } -void TouchManager::loadPad() restrict +void TouchManager::loadPad() restrict2 { const int sz = (mJoystickSize + 2) * 50; loadTouchItem(&mPad, "dpad.xml", "dpad_image.xml", "", -1, -1, sz, sz, LEFT, "", "", &padEvents, &padClick, &padUp, &padOut); } -void TouchManager::loadButtons() restrict +void TouchManager::loadButtons() restrict2 { const int sz = (mButtonsSize + 1) * 50; if (!theme) @@ -570,13 +570,13 @@ void TouchManager::loadButtons() restrict } } -void TouchManager::loadKeyboard() restrict +void TouchManager::loadKeyboard() restrict2 { loadTouchItem(&mKeyboard, "keyboard_icon.xml", "", "", -1, -1, 28, 28, NORMAL, "", "screenActionKeyboard"); } -void TouchManager::optionChanged(const std::string &value) restrict +void TouchManager::optionChanged(const std::string &value) restrict2 { if (value == "showScreenJoystick") { @@ -654,14 +654,14 @@ void TouchManager::optionChanged(const std::string &value) restrict } } -void TouchManager::setInGame(const bool b) restrict +void TouchManager::setInGame(const bool b) restrict2 { mInGame = b; mShow = mInGame && !mTempHideButtons; mRedraw = true; } -void TouchManager::setTempHide(const bool b) restrict +void TouchManager::setTempHide(const bool b) restrict2 { mTempHideButtons = b; mShow = mInGame && !mTempHideButtons; diff --git a/src/touchmanager.h b/src/touchmanager.h index 99d904765..f67a2b72d 100644 --- a/src/touchmanager.h +++ b/src/touchmanager.h @@ -113,7 +113,7 @@ class TouchManager final : public ConfigListener RIGHT = 2 }; - void init() restrict; + void init() restrict2; void loadTouchItem(TouchItem **restrict item, const std::string &restrict name, @@ -128,22 +128,22 @@ class TouchManager final : public ConfigListener const TouchFuncPtr fPressed = nullptr, const TouchFuncPtr fReleased = nullptr, const TouchFuncPtr fOut = nullptr) - restrict A_NONNULL(2); + restrict2 A_NONNULL(2); - void clear() restrict; + void clear() restrict2; - void draw() restrict; + void draw() restrict2; - void safeDraw() restrict; + void safeDraw() restrict2; - void drawText() restrict; + void drawText() restrict2; - bool processEvent(const MouseInput &mouseInput) restrict; + bool processEvent(const MouseInput &mouseInput) restrict2; - bool isActionActive(const InputActionT index) restrict const; + bool isActionActive(const InputActionT index) restrict2 const; void setActionActive(const InputActionT index, - const bool value) restrict + const bool value) restrict2 { if (static_cast<int>(index) >= 0 && static_cast<int>(index) < actionsSize) @@ -152,28 +152,28 @@ class TouchManager final : public ConfigListener } } - void resize(const int width, const int height) restrict; + void resize(const int width, const int height) restrict2; static void unload(TouchItem *restrict const item); - void unloadTouchItem(TouchItem *restrict *unloadItem) restrict; + void unloadTouchItem(TouchItem *restrict *unloadItem) restrict2; - void optionChanged(const std::string &value) restrict override final; + void optionChanged(const std::string &value) restrict2 override final; - void loadPad() restrict; + void loadPad() restrict2; - void loadButtons() restrict; + void loadButtons() restrict2; - void loadKeyboard() restrict; + void loadKeyboard() restrict2; - int getPadSize() restrict const + int getPadSize() restrict2 const { return (mJoystickSize + 2) * 50; } - void setInGame(const bool b) restrict; + void setInGame(const bool b) restrict2; - void setTempHide(const bool b) restrict; + void setTempHide(const bool b) restrict2; - void shutdown() restrict; + void shutdown() restrict2; static void executeAction(const std::string &restrict event); |