Open Source Tomb Raider Engine
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Sprite.h 749B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. class Sprite {
  12. public:
  13. Sprite(uint16_t tile, uint8_t x, uint8_t y, uint16_t width, uint16_t height);
  14. void display();
  15. void display(float x, float y, float w, float h);
  16. private:
  17. float vertex[4][3];
  18. float texel[4][2];
  19. //float pos[3];
  20. //float radius; //!< \fixme yeah, I know (I don't? --xythobuz)
  21. int texture;
  22. };
  23. class SpriteSequence {
  24. public:
  25. SpriteSequence(int32_t objectID);
  26. void add(Sprite s);
  27. unsigned long size();
  28. Sprite& get(unsigned long index);
  29. private:
  30. int32_t id;
  31. std::vector<Sprite> sprites;
  32. };
  33. #endif