Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

53 Zeilen
1.2 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. //
  11. // The TileSet class
  12. // -----------------
  13. // A TileSet is a collection of tiles stored in a texture. Texture uploading
  14. // and freeing is done in the render tick method. When the refcount drops to
  15. // zero, the texture is freed.
  16. //
  17. #if !defined __DH_TILESET_H__
  18. #define __DH_TILESET_H__
  19. #include <stdint.h>
  20. #include "entity.h"
  21. class TileSetData;
  22. class TileSet : public Entity
  23. {
  24. public:
  25. TileSet(char const *path, int2 size, int2 count, float dilate);
  26. virtual ~TileSet();
  27. protected:
  28. /* Inherited from Entity */
  29. virtual char const *GetName();
  30. virtual void TickDraw(float deltams);
  31. public:
  32. /* New methods */
  33. int2 GetSize() const;
  34. int2 GetCount() const;
  35. void Bind();
  36. void BlitTile(uint32_t id, int x, int y, int z, int o,
  37. float *vertex, float *texture);
  38. private:
  39. TileSetData *data;
  40. };
  41. #endif // __DH_TILESET_H__