source: trunk/src/tileset.h @ 1198

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

core: allow each blitted tile to be stretched differently.

  • Property svn:keywords set to Id
File size: 1.2 KB
RevLine 
[100]1//
[221]2// Lol Engine
[100]3//
[1198]4// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
[221]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
[748]19#if !defined __LOL_TILESET_H__
20#define __LOL_TILESET_H__
[38]21
[79]22#include <stdint.h>
23
[147]24#include "entity.h"
[95]25
[686]26namespace lol
27{
28
[75]29class TileSetData;
[22]30
[147]31class TileSet : public Entity
[22]32{
33public:
[1198]34    TileSet(char const *path, ivec2 size, ivec2 count);
[96]35    virtual ~TileSet();
[22]36
[105]37protected:
[147]38    /* Inherited from Entity */
[153]39    virtual char const *GetName();
[154]40    virtual void TickDraw(float deltams);
[96]41
[105]42public:
[106]43    /* New methods */
[863]44    ivec2 GetCount() const;
45    ivec2 GetSize(int tileid) const;
[645]46    void Bind();
[1198]47    void BlitTile(uint32_t id, vec3 pos, int o, vec2 scale,
[645]48                  float *vertex, float *texture);
[22]49
50private:
[75]51    TileSetData *data;
[22]52};
53
[686]54} /* namespace lol */
55
[748]56#endif // __LOL_TILESET_H__
[38]57
Note: See TracBrowser for help on using the repository browser.