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.
 
 
 

58 line
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 __LOL_TILESET_H__
  18. #define __LOL_TILESET_H__
  19. #include <stdint.h>
  20. #include "entity.h"
  21. namespace lol
  22. {
  23. class TileSetData;
  24. class TileSet : public Entity
  25. {
  26. public:
  27. TileSet(char const *path, ivec2 size, ivec2 count, float dilate);
  28. virtual ~TileSet();
  29. protected:
  30. /* Inherited from Entity */
  31. virtual char const *GetName();
  32. virtual void TickDraw(float deltams);
  33. public:
  34. /* New methods */
  35. ivec2 GetCount() const;
  36. ivec2 GetSize(int tileid) const;
  37. void Bind();
  38. void BlitTile(uint32_t id, vec3 pos, int o,
  39. float *vertex, float *texture);
  40. private:
  41. TileSetData *data;
  42. };
  43. } /* namespace lol */
  44. #endif // __LOL_TILESET_H__