Last change
on this file since 1310 was
1310,
checked in by sam, 8 years ago
|
core: tick methods now use seconds, like any sane system.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[862] | 1 | // |
---|
| 2 | // Lol Engine |
---|
| 3 | // |
---|
[1198] | 4 | // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net> |
---|
[862] | 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 | #if defined HAVE_CONFIG_H |
---|
| 12 | # include "config.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include "core.h" |
---|
| 16 | |
---|
| 17 | namespace lol |
---|
| 18 | { |
---|
| 19 | |
---|
| 20 | /* |
---|
| 21 | * Sprite implementation class |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | class SpriteData |
---|
| 25 | { |
---|
| 26 | friend class Sprite; |
---|
| 27 | |
---|
| 28 | private: |
---|
| 29 | TileSet *tileset; |
---|
| 30 | int id; |
---|
| 31 | }; |
---|
| 32 | |
---|
| 33 | /* |
---|
| 34 | * Public Sprite class |
---|
| 35 | */ |
---|
| 36 | |
---|
| 37 | Sprite::Sprite(TileSet *tileset, int id) |
---|
| 38 | : data(new SpriteData()) |
---|
| 39 | { |
---|
| 40 | data->tileset = tileset; |
---|
| 41 | data->id = id; |
---|
| 42 | } |
---|
| 43 | |
---|
[1310] | 44 | void Sprite::TickGame(float seconds) |
---|
[862] | 45 | { |
---|
[1310] | 46 | Entity::TickGame(seconds); |
---|
[862] | 47 | } |
---|
| 48 | |
---|
[1310] | 49 | void Sprite::TickDraw(float seconds) |
---|
[862] | 50 | { |
---|
[1310] | 51 | Entity::TickDraw(seconds); |
---|
[862] | 52 | |
---|
[1300] | 53 | Scene::GetDefault()->AddTile(data->tileset, data->id, m_position, |
---|
[1198] | 54 | 0, vec2(1.0f)); |
---|
[862] | 55 | } |
---|
| 56 | |
---|
| 57 | Sprite::~Sprite() |
---|
| 58 | { |
---|
| 59 | Tiler::Deregister(data->tileset); |
---|
| 60 | delete data; |
---|
| 61 | } |
---|
| 62 | |
---|
| 63 | } /* namespace lol */ |
---|
| 64 | |
---|
Note: See
TracBrowser
for help on using the repository browser.