Initial clone in from local subversion server

This commit is contained in:
2011-05-26 02:24:33 +00:00
commit ccca81e04e
87 changed files with 20290 additions and 0 deletions

34
Animation.h Executable file
View File

@@ -0,0 +1,34 @@
#ifndef __ANIMATION_H__
#define __ANIMATION_H__
#include <SDL.h>
#include "SpriteStrip.h"
#include "Renderable.h"
#include <map>
class Animation
{
private:
unsigned int lastTime;
SpriteStrip *strip;
unsigned int timeStep;
int fps;
int loop;
Vector anchor;
public:
Animation();
virtual ~Animation();
int getLoop() { return this->loop; };
int setStrip(SpriteStrip *strip, int fps, int loop = 0, Vector anchor = (Vector){0,0,0});
SDL_Surface *nextFrame(int curFrame, int lastTime, AnimatedRenderable *actorSource = NULL);
int numFrames();
Vector anchorAt(Vector position);
};
//typedef std::map<std::string, Animation *> AnimationMap;
//typedef std::map<std::string, Animation *>::iterator AnimationMapIterator;
typedef std::map<unsigned int, Animation *> AnimationStateMap;
typedef std::map<unsigned int, Animation *>::iterator AnimationStateMapIterator;
#endif // __ANIMATION_H__