source: trunk/src/sprite.cpp @ 2216

Last change on this file since 2216 was 2216, checked in by touky, 7 years ago

New year copyright update.

File size: 1.0 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#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include "core.h"
16
17namespace lol
18{
19
20/*
21 * Sprite implementation class
22 */
23
24class SpriteData
25{
26    friend class Sprite;
27
28private:
29    TileSet *tileset;
30    int id;
31};
32
33/*
34 * Public Sprite class
35 */
36
37Sprite::Sprite(TileSet *tileset, int id)
38  : data(new SpriteData())
39{
40    data->tileset = tileset;
41    data->id = id;
42}
43
44void Sprite::TickGame(float seconds)
45{
46    Entity::TickGame(seconds);
47}
48
49void Sprite::TickDraw(float seconds)
50{
51    Entity::TickDraw(seconds);
52
53    Scene::GetDefault()->AddTile(data->tileset, data->id, m_position,
54                                 0, vec2(1.0f));
55}
56
57Sprite::~Sprite()
58{
59    delete data;
60}
61
62} /* namespace lol */
63
Note: See TracBrowser for help on using the repository browser.