You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
2.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __SDL_ANIMATED_SPRITE_HEADER__
  2. #define __SDL_ANIMATED_SPRITE_HEADER__
  3. #include "../core/coreSprite.h"
  4. class animatedSprite : public sdlSprite {
  5. private:
  6. unsigned __int64 m_nNextTS;
  7. unsigned __int64 m_nIncrementTS;
  8. SDL_Rect m_sTexCut;
  9. int m_nFPS;
  10. int m_nFramesTotal;
  11. int m_nTexCols;
  12. int m_nTexRows;
  13. bool m_bInterateRows;
  14. protected:
  15. virtual void draw(SDL_Renderer* tPtr);
  16. virtual bool create(void);
  17. public:
  18. explicit animatedSprite(char* textureFile, int x, int y, int width, int height, int count=-1);
  19. explicit animatedSprite(char* textureFile, int x, int y, int width, int height, int count, int fps, bool byRow);
  20. explicit animatedSprite(char* textureFile, int x, int y, int width, int height, int cutx, int cuty, int cutw, int cuth, int count=-1);
  21. explicit animatedSprite(char* textureFile, int x, int y, int width, int height, int cutx, int cuty, int cutw, int cuth, int count, int fps, bool byRow);
  22. explicit animatedSprite(char* textureFile, int x, int y, int width, int height, int cutx, int cuty, int cutw, int cuth, int cols, int rows, int count, int fps, bool byRow);
  23. explicit animatedSprite(char* textureFile, SDL_Rect &geom, int count=-1);
  24. explicit animatedSprite(char* textureFile, SDL_Rect &geom, int count, int fps, bool byRow);
  25. explicit animatedSprite(char* textureFile, SDL_Rect &geom, int cols, int rows, int count, int fps, bool byRow);
  26. explicit animatedSprite(char* textureFile, SDL_Rect &geom, SDL_Rect &cut, int count=-1);
  27. explicit animatedSprite(char* textureFile, SDL_Rect &geom, SDL_Rect &cut, int count, int fps, bool byRow);
  28. explicit animatedSprite(char* textureFile, SDL_Rect &geom, SDL_Rect &cut, int cols, int rows, int count, int fps, bool byRow);
  29. explicit animatedSprite(char* textureFile, SDL_Rect *geom, int count=-1);
  30. explicit animatedSprite(char* textureFile, SDL_Rect *geom, int count, int fps, bool byRow);
  31. explicit animatedSprite(char* textureFile, SDL_Rect *geom, int cols, int rows, int count, int fps, bool byRow);
  32. explicit animatedSprite(char* textureFile, SDL_Rect *geom, SDL_Rect *cut, int count=-1);
  33. explicit animatedSprite(char* textureFile, SDL_Rect *geom, SDL_Rect *cut, int count, int fps, bool byRow);
  34. explicit animatedSprite(char* textureFile, SDL_Rect *geom, SDL_Rect *cut, int cols, int rows, int count, int fps, bool byRow);
  35. virtual ~animatedSprite();
  36. };
  37. #endif