Open Source Tomb Raider Engine
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Sprite.h 878B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*!
  2. * \file include/Sprite.h
  3. * \brief World Sprite
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _SPRITE_H_
  8. #define _SPRITE_H_
  9. #include <cstdint>
  10. #include "loader/Loader.h"
  11. #include "TombRaider.h"
  12. class Sprite {
  13. public:
  14. Sprite(struct vertex_t vert, uint16_t tex);
  15. // Old API
  16. Sprite(TombRaider& tr, unsigned int room, unsigned int index);
  17. Sprite(TombRaider& tr, unsigned int item, unsigned int sequence, unsigned int index);
  18. void display();
  19. private:
  20. float vertex[4][3];
  21. float texel[4][2];
  22. float pos[3];
  23. float radius; //!< \fixme yeah, I know (I don't? --xythobuz)
  24. int texture;
  25. };
  26. class SpriteSequence {
  27. public:
  28. SpriteSequence(TombRaider& tr, unsigned int item, unsigned int sequence);
  29. ~SpriteSequence();
  30. unsigned long size();
  31. Sprite& get(unsigned long index);
  32. private:
  33. std::vector<Sprite*> sprites;
  34. };
  35. #endif