00001 #ifndef __ANIMATED_IMAGE_H 00002 #define __ANIMATED_IMAGE_H 00003 00004 #include <SDL/SDL.h> 00005 00006 class AnimatedImage 00007 { 00008 public: 00009 AnimatedImage( string file, int nFrames ); 00010 ~AnimatedImage(); 00011 00012 bool nextFrame(); 00013 void draw( SDL_Surface *screen, int x, int y ); 00014 bool AtEnd(); 00015 void reset() { currentFrame = 0; } 00016 private: 00017 00018 SDL_Surface *image; 00019 int nrFrames; 00020 int currentFrame; 00021 00022 int frameWidth; 00023 int frameHeight; 00024 }; 00025 #endif
1.4.2