diff options
Diffstat (limited to 'src/resources/image.h')
-rw-r--r-- | src/resources/image.h | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/src/resources/image.h b/src/resources/image.h index 3677696f..3160add8 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -1,30 +1,31 @@ /* * The Mana World - * Copyright 2004 The Mana World Development Team + * Copyright (C) 2004 The Mana World Development Team * * This file is part of The Mana World. * - * The Mana World is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _TMW_IMAGE_H -#define _TMW_IMAGE_H +#ifndef IMAGE_H +#define IMAGE_H + +#include <SDL.h> #include "../main.h" -#include <SDL.h> #ifdef USE_OPENGL /* The definition of OpenGL extensions by SDL is giving problems with recent @@ -54,8 +55,7 @@ class Image : public Resource /** * Destructor. */ - virtual - ~Image(); + virtual ~Image(); /** * Loads an image from a buffer in memory. @@ -78,7 +78,8 @@ class Image : public Resource * @return <code>NULL</code> if an error occurred, a valid pointer * otherwise. */ - static Resource *load(void *buffer, unsigned bufferSize, Dye const &dye); + static Resource *load(void *buffer, unsigned bufferSize, + Dye const &dye); /** * Loads an image from an SDL surface. @@ -88,21 +89,19 @@ class Image : public Resource /** * Frees the resources created by SDL. */ - virtual void - unload(); + virtual void unload(); /** * Returns the width of the image. */ - virtual int - getWidth() const { return mBounds.w; } - + virtual int getWidth() const + { return mBounds.w; } /** * Returns the height of the image. */ - virtual int - getHeight() const { return mBounds.h; } + virtual int getHeight() const + { return mBounds.h; } /** * Creates a new image with the desired clipping rectangle. @@ -110,20 +109,17 @@ class Image : public Resource * @return <code>NULL</code> if creation failed and a valid * object otherwise. */ - virtual Image* - getSubImage(int x, int y, int width, int height); + virtual Image *getSubImage(int x, int y, int width, int height); /** * Sets the alpha value of this image. */ - void - setAlpha(float alpha); + virtual void setAlpha(float alpha); /** * Returns the alpha value of this image. */ - float - getAlpha(); + float getAlpha(); #ifdef USE_OPENGL /** @@ -133,7 +129,6 @@ class Image : public Resource static void setLoadAsOpenGL(bool useOpenGL); #endif - protected: /** * Constructor. @@ -145,8 +140,7 @@ class Image : public Resource /** * Returns the first power of two equal or bigger than the input. */ - static int - powerOfTwo(int input); + static int powerOfTwo(int input); #endif Image(SDL_Surface *image); @@ -192,8 +186,7 @@ class SubImage : public Image * @return <code>NULL</code> if creation failed and a valid * image otherwise. */ - Image* - getSubImage(int x, int y, int width, int height); + Image *getSubImage(int x, int y, int width, int height); private: Image *mParent; |