Textur2D.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include "Array.h"
  3. namespace Framework
  4. {
  5. class Bild;
  6. class Animation2DData;
  7. class Textur2D
  8. {
  9. private:
  10. struct Animation
  11. {
  12. Animation2DData *data;
  13. int jetzt;
  14. double ausgleich;
  15. };
  16. bool circularAnimation;
  17. int animationIndex;
  18. Bild *txt;
  19. Array< Animation* > *animData;
  20. int ref;
  21. public:
  22. //! Konstructor
  23. __declspec( dllexport ) Textur2D();
  24. //! Destructor
  25. __declspec( dllexport ) ~Textur2D();
  26. //! Legt fest, ob die animation sich automatisch wiederhohlen soll
  27. //! \param ca 1, falls sich die animation automatisch wiederhohlen soll
  28. __declspec( dllexport ) void setCircularAnimation( bool ca );
  29. //! setzt einen Zeiger auf die Textur (fals nicht animiert)
  30. //! \param textur Der Zeiger auf das Bild
  31. __declspec( dllexport ) void setTexturZ( Bild *textur );
  32. //! fügt eine Animation hinzu
  33. //! \param textur Der Zeiger auf die Animationsdaten
  34. __declspec( dllexport ) void addAnimationZ( Animation2DData *textur );
  35. //! setzt die aktuelle Annimation
  36. //! \param index Der Index der Animation
  37. __declspec( dllexport ) void setAnimation( int index );
  38. //! aktiviert die nachfolgende animation
  39. __declspec( dllexport ) void nextAnimation();
  40. //! setzt die vergangene Zeit seit dem letzten Aufruf
  41. //! \param t die vergangene Zeit in sekunden
  42. __declspec( dllexport ) bool tick( double t );
  43. //! gibt die aktuelle Textur zurück
  44. __declspec( dllexport ) Bild *zTextur() const;
  45. //! erhöht den Reference Counter um 1 und gibt this zurück
  46. __declspec( dllexport ) Textur2D *getThis();
  47. //! verringert den reference counter um 1 und löscht sich selbst, falls er 0 erreicht
  48. //! gibt 0 zurück
  49. __declspec( dllexport ) Textur2D *release();
  50. };
  51. }