summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-11 02:53:26 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-11 16:22:20 +0300
commitdcba44a20e622ec38d536fb03c0c8404e9399f80 (patch)
treed0271d9a11e1117eb9a3138063710c6db73154cc /src
parent78d804ba1751134120caca22f0cf5abcfd11f29d (diff)
downloadmanaplus-dcba44a20e622ec38d536fb03c0c8404e9399f80.tar.gz
manaplus-dcba44a20e622ec38d536fb03c0c8404e9399f80.tar.bz2
manaplus-dcba44a20e622ec38d536fb03c0c8404e9399f80.tar.xz
manaplus-dcba44a20e622ec38d536fb03c0c8404e9399f80.zip
Fix code style.
Diffstat (limited to 'src')
-rw-r--r--src/net/manaserv/beinghandler.cpp5
-rw-r--r--src/opengl1graphics.cpp1
-rw-r--r--src/openglgraphics.cpp1
-rw-r--r--src/resources/image.cpp2
-rw-r--r--src/resources/imagehelper.h3
-rw-r--r--src/resources/openglimagehelper.cpp2
-rw-r--r--src/resources/sdlimagehelper.cpp2
-rw-r--r--src/utils/paths.cpp2
8 files changed, 10 insertions, 8 deletions
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp
index 9f6c2ba2c..93f9c0835 100644
--- a/src/net/manaserv/beinghandler.cpp
+++ b/src/net/manaserv/beinghandler.cpp
@@ -188,9 +188,10 @@ void BeingHandler::handleBeingEnterMessage(Net::MessageIn &msg)
}
int hs = msg.readInt8(), hc = msg.readInt8();
const ItemInfo &item = ItemDB::get(-hs);
- being->setSprite(SPRITE_HAIR, hs * -1, item.getDyeColorsString(hc));
+ being->setSprite(SPRITE_HAIR, hs * -1,
+ item.getDyeColorsString(hc));
being->setGender(msg.readInt8() == GENDER_MALE ?
- GENDER_MALE : GENDER_FEMALE);
+ GENDER_MALE : GENDER_FEMALE);
handleLooks(being, msg);
} break;
diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp
index be16008dc..1d5273ffe 100644
--- a/src/opengl1graphics.cpp
+++ b/src/opengl1graphics.cpp
@@ -30,7 +30,6 @@
#include "logger.h"
#include "resources/image.h"
-#include "resources/imagehelper.h"
#include "resources/openglimagehelper.h"
#include <SDL.h>
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 6b89f4bca..7d32fd476 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -30,7 +30,6 @@
#include "logger.h"
#include "resources/image.h"
-#include "resources/imagehelper.h"
#include "resources/openglimagehelper.h"
#include "utils/stringutils.h"
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index b060be6f4..3c5a2a97e 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -241,7 +241,7 @@ void Image::setAlpha(float alpha)
mAlpha = alpha;
- if (!hasAlphaChannel())
+ if (!mHasAlphaChannel)
{
// Set the alpha value this image is drawn at
SDL_SetAlpha(mSDLSurface, SDL_SRCALPHA,
diff --git a/src/resources/imagehelper.h b/src/resources/imagehelper.h
index b0cbca7e6..c31feb322 100644
--- a/src/resources/imagehelper.h
+++ b/src/resources/imagehelper.h
@@ -39,6 +39,9 @@ struct Position;
*/
class ImageHelper
{
+ friend class CompoundSprite;
+ friend class Image;
+
public:
virtual ~ImageHelper()
{ }
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 1de5305c4..db75a7b0c 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -69,7 +69,7 @@ Resource *OpenGLImageHelper::load(SDL_RWops *rw, Dye const &dye)
for (Uint32 *p_end = pixels + surf->w * surf->h;
pixels != p_end; ++pixels)
{
- Uint8 *p = (Uint8 *)pixels;
+ Uint8 *p = reinterpret_cast<Uint8 *>(pixels);
const int alpha = *p & 255;
if (!alpha)
continue;
diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp
index 66e1bc823..a416a35d2 100644
--- a/src/resources/sdlimagehelper.cpp
+++ b/src/resources/sdlimagehelper.cpp
@@ -73,7 +73,7 @@ Resource *SDLImageHelper::load(SDL_RWops *rw, Dye const &dye)
for (Uint32 *p_end = pixels + surf->w * surf->h;
pixels != p_end; ++pixels)
{
- Uint8 *p = (Uint8 *)pixels;
+ Uint8 *p = reinterpret_cast<Uint8 *>(pixels);
const int alpha = *p & 255;
if (!alpha)
continue;
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp
index 4abbfef04..7cb600a1a 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -154,7 +154,7 @@ std::string getDesktopDir()
file = std::string(xdg) + "/user-dirs.dirs";
StringVect arr = ResourceManager::loadTextFileLocal(file);
- for(StringVectCIter it = arr.begin(), it_end = arr.end();
+ for (StringVectCIter it = arr.begin(), it_end = arr.end();
it != it_end; ++ it)
{
std::string str = *it;