source: trunk/src/tileset.h @ 792

Last change on this file since 792 was 792, checked in by sam, 9 years ago

tiler: ensure AddTile() and BlitTile() accept vec3i arguments.

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
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//
12// The TileSet class
13// -----------------
14// A TileSet is a collection of tiles stored in a texture. Texture uploading
15// and freeing is done in the render tick method. When the refcount drops to
16// zero, the texture is freed.
17//
18
19#if !defined __LOL_TILESET_H__
20#define __LOL_TILESET_H__
21
22#include <stdint.h>
23
24#include "entity.h"
25
26namespace lol
27{
28
29class TileSetData;
30
31class TileSet : public Entity
32{
33public:
34    TileSet(char const *path, vec2i size, vec2i count, float dilate);
35    virtual ~TileSet();
36
37protected:
38    /* Inherited from Entity */
39    virtual char const *GetName();
40    virtual void TickDraw(float deltams);
41
42public:
43    /* New methods */
44    vec2i GetCount() const;
45    vec2i GetSize(int tileid) const;
46    void Bind();
47    void BlitTile(uint32_t id, vec3i pos, int o,
48                  float *vertex, float *texture);
49
50private:
51    TileSetData *data;
52};
53
54} /* namespace lol */
55
56#endif // __LOL_TILESET_H__
57
Note: See TracBrowser for help on using the repository browser.