source: trunk/src/tileset.h @ 637

Last change on this file since 637 was 637, checked in by sam, 10 years ago

Allow to query for a tileset's size and/or number of tiles.

  • Property svn:keywords set to Id
File size: 1.1 KB
RevLine 
[100]1//
[221]2// Lol Engine
[100]3//
[221]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//
[22]10
[100]11//
12// The TileSet class
13// -----------------
[104]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.
[100]17//
[22]18
[75]19#if !defined __DH_TILESET_H__
20#define __DH_TILESET_H__
[38]21
[79]22#include <stdint.h>
23
[147]24#include "entity.h"
[95]25
[75]26class TileSetData;
[22]27
[147]28class TileSet : public Entity
[22]29{
30public:
[633]31    TileSet(char const *path, int2 size, int2 count, float dilate);
[96]32    virtual ~TileSet();
[22]33
[105]34protected:
[147]35    /* Inherited from Entity */
[153]36    virtual char const *GetName();
[154]37    virtual void TickDraw(float deltams);
[96]38
[105]39public:
[106]40    /* New methods */
[637]41    int2 GetSize() const;
42    int2 GetCount() const;
[138]43    void BlitTile(uint32_t id, int x, int y, int z, int o);
[22]44
45private:
[75]46    TileSetData *data;
[22]47};
48
[75]49#endif // __DH_TILESET_H__
[38]50
Note: See TracBrowser for help on using the repository browser.