summaryrefslogtreecommitdiff
path: root/src/guichan/sdl/sdlimage.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-31 01:27:37 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-31 01:27:37 +0300
commit9d3b975bcb84ad1c61d628de2804751c0d0707dd (patch)
treefe7494b1ecd561a40dc96d088c77d69b6d4ce13e /src/guichan/sdl/sdlimage.cpp
parent1d0044cbc81e547ad688a295288910d58e1a3fb1 (diff)
downloadmv-9d3b975bcb84ad1c61d628de2804751c0d0707dd.tar.gz
mv-9d3b975bcb84ad1c61d628de2804751c0d0707dd.tar.bz2
mv-9d3b975bcb84ad1c61d628de2804751c0d0707dd.tar.xz
mv-9d3b975bcb84ad1c61d628de2804751c0d0707dd.zip
Fix code style and missing members initialisations.
Diffstat (limited to 'src/guichan/sdl/sdlimage.cpp')
-rw-r--r--src/guichan/sdl/sdlimage.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/guichan/sdl/sdlimage.cpp b/src/guichan/sdl/sdlimage.cpp
index cab5effdb..12c5571cf 100644
--- a/src/guichan/sdl/sdlimage.cpp
+++ b/src/guichan/sdl/sdlimage.cpp
@@ -61,9 +61,7 @@ namespace gcn
SDLImage::~SDLImage()
{
if (mAutoFree)
- {
free();
- }
}
SDL_Surface* SDLImage::getSurface() const
@@ -75,7 +73,8 @@ namespace gcn
{
if (mSurface == NULL)
{
- throw GCN_EXCEPTION("Trying to get the width of a non loaded image.");
+ throw GCN_EXCEPTION("Trying to get the width of "
+ "a non loaded image.");
}
return mSurface->w;
@@ -85,7 +84,8 @@ namespace gcn
{
if (mSurface == NULL)
{
- throw GCN_EXCEPTION("Trying to get the height of a non loaded image.");
+ throw GCN_EXCEPTION("Trying to get the height of "
+ "a non loaded image.");
}
return mSurface->h;
@@ -95,7 +95,8 @@ namespace gcn
{
if (mSurface == NULL)
{
- throw GCN_EXCEPTION("Trying to get a pixel from a non loaded image.");
+ throw GCN_EXCEPTION("Trying to get a pixel from a "
+ "non loaded image.");
}
return SDLgetPixel(mSurface, x, y);
@@ -105,7 +106,8 @@ namespace gcn
{
if (mSurface == NULL)
{
- throw GCN_EXCEPTION("Trying to put a pixel in a non loaded image.");
+ throw GCN_EXCEPTION("Trying to put a pixel in a "
+ "non loaded image.");
}
SDLputPixel(mSurface, x, y, color);
@@ -115,7 +117,8 @@ namespace gcn
{
if (mSurface == NULL)
{
- throw GCN_EXCEPTION("Trying to convert a non loaded image to display format.");
+ throw GCN_EXCEPTION("Trying to convert a non loaded image "
+ "to display format.");
}
int i;
@@ -124,7 +127,8 @@ namespace gcn
for (i = 0; i < mSurface->w * mSurface->h; ++i)
{
- if (((unsigned int*)mSurface->pixels)[i] == SDL_MapRGB(mSurface->format,255,0,255))
+ if (((unsigned int*)mSurface->pixels)[i] == SDL_MapRGB(
+ mSurface->format, 255, 0, 255))
{
hasPink = true;
break;
@@ -161,14 +165,12 @@ namespace gcn
}
if (tmp == NULL)
- {
throw GCN_EXCEPTION("Unable to convert image to display format.");
- }
if (hasPink)
{
SDL_SetColorKey(tmp, SDL_SRCCOLORKEY,
- SDL_MapRGB(tmp->format,255,0,255));
+ SDL_MapRGB(tmp->format, 255, 0, 255));
}
if (hasAlpha)
{