00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef IMAGELOADER_H
00023 #define IMAGELOADER_H
00024
00025 #include <guichan/image.hpp>
00026 #include <guichan/imageloader.hpp>
00027
00028 #include <string>
00029
00030 class Image;
00031 struct SDL_Surface;
00032
00033 class ProxyImage : public gcn::Image
00034 {
00035 public:
00036 ProxyImage(SDL_Surface *);
00037 ~ProxyImage();
00038
00039 void free();
00040 int getWidth() const;
00041 int getHeight() const;
00042 gcn::Color getPixel(int x, int y);
00043 void putPixel(int x, int y, gcn::Color const &color);
00044 void convertToDisplayFormat();
00045
00049 ::Image *getImage() const
00050 { return mImage; }
00051
00052 private:
00053 ::Image *mImage;
00059 SDL_Surface *mSDLImage;
00060 };
00061
00062 class ImageLoader : public gcn::ImageLoader
00063 {
00064 public:
00065 gcn::Image *load(const std::string &filename,
00066 bool convertToDisplayFormat);
00067 };
00068
00069 #endif