blob: 3c03f5203d57d405e72f0e037918c8c7c040f775 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifndef __ANIMATED_IMAGE_H
#define __ANIMATED_IMAGE_H
#include "SDL.h"
class AnimatedImage
{
public:
AnimatedImage( string file, int nFrames );
~AnimatedImage();
bool nextFrame();
void draw( SDL_Surface *screen, int x, int y );
bool AtEnd();
void reset() { currentFrame = 0; }
private:
SDL_Surface *image;
int nrFrames;
int currentFrame;
int frameWidth;
int frameHeight;
};
#endif
|