vrshoot
view src/enemy.cc @ 2:334d17aed7de
visual studio project files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 02 Feb 2014 18:36:38 +0200 |
parents | |
children |
line source
1 #include "enemy.h"
2 #include "object.h"
3 #include "scene.h"
5 Enemy::Enemy()
6 {
7 root = 0;
8 scn = 0;
9 }
11 Enemy::~Enemy()
12 {
13 delete root;
14 delete scn;
15 }
17 bool Enemy::load(const char *fname)
18 {
19 if(!scn->load(fname)) {
20 return false;
21 }
23 // reparent all root objects
24 root = new XFormNode;
25 for(size_t i=0; i<scn->objects.size(); i++) {
26 if(!scn->objects[i]->get_parent()) {
27 root->add_child(scn->objects[i]);
28 }
29 }
30 return true;
31 }
33 void Enemy::update(long tm)
34 {
35 }
37 void Enemy::draw() const
38 {
39 root->draw();
40 }