00001 #ifndef _SPRITE_H_ 00002 #define _SPRITE_H_ 00003 00004 #include "Visualisation.h" 00005 #include "Colour.h" 00006 struct SDL_Surface; 00007 00008 class Sprite 00009 { 00010 public: 00011 Sprite(const SpriteID &id); 00012 ~Sprite(); 00013 00014 void InitFromFile(char* filename); 00015 void Draw(const unsigned int &x, const unsigned int &y, unsigned int frame = 0); 00016 void Shutdown(); 00017 00018 SpriteID GetID() { return m_ID; } 00019 00020 unsigned int GetNumFrames() { return m_numFrames; } 00021 unsigned int GetWidth() { return m_width; } 00022 unsigned int GetHeight() { return m_height; } 00023 ColourRGB GetColour() { return m_colour; } 00024 00025 protected: 00026 void WritePixel(SDL_Surface *surface, int x, int y, const ColourRGB &colour); 00027 00028 unsigned int m_numFrames, m_width, m_height; 00029 SDL_Surface* m_pFrames; 00030 ColourRGB m_colour; 00031 SpriteID m_ID; 00032 }; 00033 00034 #endif
1.5.9