source: trunk/src/entity.cpp @ 210

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

Allow for different priorities in game and draw tick levels.

  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1//
2// Deus Hax (working title)
3// Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
4//
5
6#if defined HAVE_CONFIG_H
7#   include "config.h"
8#endif
9
10#include <cstdlib>
11#include <cstdio>
12
13#include "core.h"
14
15/*
16 * Public Entity class
17 */
18
19Entity::Entity() :
20    gamenext(0),
21    drawnext(0),
22    ref(0),
23    destroy(0)
24{
25#if !FINAL_RELEASE
26    state = STATE_IDLE;
27#endif
28    gamegroup = GAMEGROUP_DEFAULT;
29    drawgroup = DRAWGROUP_DEFAULT;
30    Ticker::Register(this);
31}
32
33Entity::~Entity()
34{
35#if !FINAL_RELEASE
36    if (!destroy)
37        fprintf(stderr, "ERROR: entity destructor called directly\n");
38#endif
39}
40
41char const *Entity::GetName()
42{
43    return "<entity>";
44}
45
46void Entity::TickGame(float deltams)
47{
48#if !FINAL_RELEASE
49    if (state != STATE_PRETICK_GAME)
50        fprintf(stderr, "ERROR: invalid entity game tick\n");
51    state = STATE_POSTTICK_GAME;
52#endif
53}
54
55void Entity::TickDraw(float deltams)
56{
57#if !FINAL_RELEASE
58    if (state != STATE_PRETICK_DRAW)
59        fprintf(stderr, "ERROR: invalid entity draw tick\n");
60    state = STATE_POSTTICK_DRAW;
61#endif
62}
63
Note: See TracBrowser for help on using the repository browser.