summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/animatedimage.h
blob: ecebf035f22b1e2d2f6d32a9977593ca1c55474e (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/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