summaryrefslogtreecommitdiff
path: root/src/guichan/sdl/sdlimage.cpp
diff options
context:
space:
mode:
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)
{