diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-27 00:13:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-27 00:13:42 +0300 |
commit | f09ab3acb547b786289cd78b51577df6ef669fc6 (patch) | |
tree | e610bd6251e6105f117db9ed80481ce223e050ce /src | |
parent | 75a80fdfdce4be53ce7d7b1d02400d3f79a144c0 (diff) | |
download | manaverse-f09ab3acb547b786289cd78b51577df6ef669fc6.tar.gz manaverse-f09ab3acb547b786289cd78b51577df6ef669fc6.tar.bz2 manaverse-f09ab3acb547b786289cd78b51577df6ef669fc6.tar.xz manaverse-f09ab3acb547b786289cd78b51577df6ef669fc6.zip |
Fix code style.
Diffstat (limited to 'src')
-rw-r--r-- | src/client.cpp | 4 | ||||
-rw-r--r-- | src/flooritem.h | 2 | ||||
-rw-r--r-- | src/graphicsmanager.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 4 | ||||
-rw-r--r-- | src/guichan/widgets/textfield.cpp | 2 | ||||
-rw-r--r-- | src/mobileopenglgraphics.cpp | 57 | ||||
-rw-r--r-- | src/resources/beinginfo.h | 2 |
7 files changed, 36 insertions, 37 deletions
diff --git a/src/client.cpp b/src/client.cpp index 5dd417670..3d433dc04 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -356,9 +356,9 @@ void Client::gameInit() #endif if (config.getBoolValue("allowscreensaver")) - putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1"); + putenv(const_cast<char*>("SDL_VIDEO_ALLOW_SCREENSAVER=1")); else - putenv("SDL_VIDEO_ALLOW_SCREENSAVER=0"); + putenv(const_cast<char*>("SDL_VIDEO_ALLOW_SCREENSAVER=0")); chatLogger = new ChatLogger; if (mOptions.chatLogDir == "") diff --git a/src/flooritem.h b/src/flooritem.h index 0542d2f11..e497d0bc6 100644 --- a/src/flooritem.h +++ b/src/flooritem.h @@ -97,7 +97,7 @@ class FloorItem final : public ActorSprite void disableHightlight() { mHighlight = false; } - Cursor::Cursor getHoverCursor() + Cursor::Cursor getHoverCursor() const { return mCursor; } private: diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 4ffe48042..67bfa8847 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -798,7 +798,7 @@ void GraphicsManager::detectVideoSettings() static CALLBACK void debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, - const GLchar *text, GLvoid *userParam) + const GLchar *text, GLvoid *userParam A_UNUSED) { std::string message("OPENGL:"); switch (source) diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 39dfade9a..0321e5044 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -365,7 +365,7 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED) gcn::Widget *const w = getCurrentWidget(); if (w) { - ScrollArea* scr = dynamic_cast<ScrollArea*>(w); + ScrollArea *const scr = dynamic_cast<ScrollArea *const>(w); if (scr) { if (mFollowDownScroll && height != 0) @@ -378,7 +378,7 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED) && scr->getVerticalScrollAmount() <= scr->getVerticalMaxScroll() + 2) { - int newScroll = scr->getVerticalScrollAmount() + const int newScroll = scr->getVerticalScrollAmount() + rect.height - height; w->setSize(mWidgetContainer->getWidth() - frameSize, mWidgetContainer->getHeight() - frameSize); diff --git a/src/guichan/widgets/textfield.cpp b/src/guichan/widgets/textfield.cpp index c0575eace..7decc5c6b 100644 --- a/src/guichan/widgets/textfield.cpp +++ b/src/guichan/widgets/textfield.cpp @@ -125,7 +125,7 @@ namespace gcn { } - void TextField::setCaretPosition(unsigned int position) + void TextField::setCaretPosition(unsigned int position A_UNUSED) { } diff --git a/src/mobileopenglgraphics.cpp b/src/mobileopenglgraphics.cpp index 1cc1fae8a..564f9be82 100644 --- a/src/mobileopenglgraphics.cpp +++ b/src/mobileopenglgraphics.cpp @@ -312,7 +312,7 @@ void MobileOpenGLGraphics::drawImagePattern(const Image *const image, const unsigned int vLimit = mMaxVertices * 4; // Draw a set of textured rectangles // if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) - { +// { float texX1 = static_cast<float>(srcX) / tw; float texY1 = static_cast<float>(srcY) / th; @@ -346,23 +346,23 @@ void MobileOpenGLGraphics::drawImagePattern(const Image *const image, mFloatTexArray[vp + 10] = texX2; //3 mFloatTexArray[vp + 11] = texY2; - mShortVertArray[vp + 0] = dstX; - mShortVertArray[vp + 1] = dstY; + mShortVertArray[vp + 0] = static_cast<GLshort>(dstX); + mShortVertArray[vp + 1] = static_cast<GLshort>(dstY); - mShortVertArray[vp + 2] = dstX + width; - mShortVertArray[vp + 3] = dstY; + mShortVertArray[vp + 2] = static_cast<GLshort>(dstX + width); + mShortVertArray[vp + 3] = static_cast<GLshort>(dstY); - mShortVertArray[vp + 4] = dstX + width; - mShortVertArray[vp + 5] = dstY + height; + mShortVertArray[vp + 4] = static_cast<GLshort>(dstX + width); + mShortVertArray[vp + 5] = static_cast<GLshort>(dstY + height); - mShortVertArray[vp + 6] = dstX; - mShortVertArray[vp + 7] = dstY; + mShortVertArray[vp + 6] = static_cast<GLshort>(dstX); + mShortVertArray[vp + 7] = static_cast<GLshort>(dstY); - mShortVertArray[vp + 8] = dstX; - mShortVertArray[vp + 9] = dstY + height; + mShortVertArray[vp + 8] = static_cast<GLshort>(dstX); + mShortVertArray[vp + 9] = static_cast<GLshort>(dstY + height); - mShortVertArray[vp + 10] = dstX + width; - mShortVertArray[vp + 11] = dstY + height; + mShortVertArray[vp + 10] = static_cast<GLshort>(dstX + width); + mShortVertArray[vp + 11] = static_cast<GLshort>(dstY + height); vp += 12; if (vp >= vLimit) @@ -374,7 +374,7 @@ void MobileOpenGLGraphics::drawImagePattern(const Image *const image, } if (vp > 0) drawTriangleArrayfs(vp); - } +// } } void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, @@ -411,7 +411,7 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, // Draw a set of textured rectangles // if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) - { +// { const float tw = static_cast<float>(image->mTexWidth); const float th = static_cast<float>(image->mTexHeight); @@ -456,24 +456,23 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, mFloatTexArray[vp + 10] = texX2; mFloatTexArray[vp + 11] = texY2; + mShortVertArray[vp + 0] = static_cast<GLshort>(dstX); + mShortVertArray[vp + 1] = static_cast<GLshort>(dstY); - mShortVertArray[vp + 0] = dstX; - mShortVertArray[vp + 1] = dstY; + mShortVertArray[vp + 2] = static_cast<GLshort>(dstX + width); + mShortVertArray[vp + 3] = static_cast<GLshort>(dstY); - mShortVertArray[vp + 2] = dstX + width; - mShortVertArray[vp + 3] = dstY; + mShortVertArray[vp + 4] = static_cast<GLshort>(dstX + width); + mShortVertArray[vp + 5] = static_cast<GLshort>(dstY + height); - mShortVertArray[vp + 4] = dstX + width; - mShortVertArray[vp + 5] = dstY + height; + mShortVertArray[vp + 6] = static_cast<GLshort>(dstX); + mShortVertArray[vp + 7] = static_cast<GLshort>(dstY); - mShortVertArray[vp + 6] = dstX; - mShortVertArray[vp + 7] = dstY; + mShortVertArray[vp + 8] = static_cast<GLshort>(dstX); + mShortVertArray[vp + 9] = static_cast<GLshort>(dstY + height); - mShortVertArray[vp + 8] = dstX; - mShortVertArray[vp + 9] = dstY + height; - - mShortVertArray[vp + 10] = dstX + width; - mShortVertArray[vp + 11] = dstY + height; + mShortVertArray[vp + 10] = static_cast<GLshort>(dstX + width); + mShortVertArray[vp + 11] = static_cast<GLshort>(dstY + height); vp += 12; if (vp >= vLimit) @@ -485,7 +484,7 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, } if (vp > 0) drawTriangleArrayfs(vp); - } +// } } void MobileOpenGLGraphics::drawImagePattern2(GraphicsVertexes *const vert, diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h index ed73f576a..e3cfc6581 100644 --- a/src/resources/beinginfo.h +++ b/src/resources/beinginfo.h @@ -112,7 +112,7 @@ class BeingInfo final void setHoverCursor(const Cursor::Cursor &cursor) { mHoverCursor = cursor; } - Cursor::Cursor getHoverCursor() + Cursor::Cursor getHoverCursor() const { return mHoverCursor; } ActorSprite::TargetCursorSize getTargetCursorSize() const |