Last change
on this file since 2291 was
2216,
checked in by touky, 8 years ago
|
New year copyright update.
|
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Line | |
---|
1 | // |
---|
2 | // Lol Engine |
---|
3 | // |
---|
4 | // Copyright: (c) 2010-2013 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://www.wtfpl.net/ 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 | |
---|
26 | namespace lol |
---|
27 | { |
---|
28 | |
---|
29 | class TileSetData; |
---|
30 | |
---|
31 | class TileSet : public Entity |
---|
32 | { |
---|
33 | public: |
---|
34 | TileSet(char const *path, ivec2 size, ivec2 count); |
---|
35 | virtual ~TileSet(); |
---|
36 | |
---|
37 | protected: |
---|
38 | /* Inherited from Entity */ |
---|
39 | virtual char const *GetName(); |
---|
40 | virtual void TickDraw(float seconds); |
---|
41 | |
---|
42 | public: |
---|
43 | /* New methods */ |
---|
44 | ivec2 GetCount() const; |
---|
45 | ivec2 GetSize(int tileid) const; |
---|
46 | void Bind(); |
---|
47 | void Unbind(); |
---|
48 | void BlitTile(uint32_t id, vec3 pos, int o, vec2 scale, |
---|
49 | float *vertex, float *texture); |
---|
50 | |
---|
51 | private: |
---|
52 | TileSetData *data; |
---|
53 | }; |
---|
54 | |
---|
55 | } /* namespace lol */ |
---|
56 | |
---|
57 | #endif // __LOL_TILESET_H__ |
---|
58 | |
---|
Note: See
TracBrowser
for help on using the repository browser.