Last change
on this file since 221 was
221,
checked in by sam, 12 years ago
|
Complete Lol Engine / Deus Hax / Monsterz split.
|
-
Property svn:keywords set to
Id
|
File size:
1.3 KB
|
Line | |
---|
1 | // |
---|
2 | // Lol Engine |
---|
3 | // |
---|
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 | // |
---|
10 | |
---|
11 | #if defined HAVE_CONFIG_H |
---|
12 | # include "config.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | #include <cstdlib> |
---|
16 | #include <cstdio> |
---|
17 | |
---|
18 | #include "core.h" |
---|
19 | |
---|
20 | /* |
---|
21 | * Public Entity class |
---|
22 | */ |
---|
23 | |
---|
24 | Entity::Entity() : |
---|
25 | gamenext(0), |
---|
26 | drawnext(0), |
---|
27 | ref(0), |
---|
28 | destroy(0) |
---|
29 | { |
---|
30 | #if !FINAL_RELEASE |
---|
31 | state = STATE_IDLE; |
---|
32 | #endif |
---|
33 | gamegroup = GAMEGROUP_DEFAULT; |
---|
34 | drawgroup = DRAWGROUP_DEFAULT; |
---|
35 | Ticker::Register(this); |
---|
36 | } |
---|
37 | |
---|
38 | Entity::~Entity() |
---|
39 | { |
---|
40 | #if !FINAL_RELEASE |
---|
41 | if (!destroy) |
---|
42 | fprintf(stderr, "ERROR: entity destructor called directly\n"); |
---|
43 | #endif |
---|
44 | } |
---|
45 | |
---|
46 | char const *Entity::GetName() |
---|
47 | { |
---|
48 | return "<entity>"; |
---|
49 | } |
---|
50 | |
---|
51 | void Entity::TickGame(float deltams) |
---|
52 | { |
---|
53 | #if !FINAL_RELEASE |
---|
54 | if (state != STATE_PRETICK_GAME) |
---|
55 | fprintf(stderr, "ERROR: invalid entity game tick\n"); |
---|
56 | state = STATE_POSTTICK_GAME; |
---|
57 | #endif |
---|
58 | } |
---|
59 | |
---|
60 | void Entity::TickDraw(float deltams) |
---|
61 | { |
---|
62 | #if !FINAL_RELEASE |
---|
63 | if (state != STATE_PRETICK_DRAW) |
---|
64 | fprintf(stderr, "ERROR: invalid entity draw tick\n"); |
---|
65 | state = STATE_POSTTICK_DRAW; |
---|
66 | #endif |
---|
67 | } |
---|
68 | |
---|
Note: See
TracBrowser
for help on using the repository browser.