dungeon_crawler

diff prototype/src/tile.cc @ 38:862461b686f4

start work on particle systems
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 29 Aug 2012 03:22:36 +0300
parents 84a56fb24850
children acfe0c0110fc
line diff
     1.1 --- a/prototype/src/tile.cc	Wed Aug 29 01:04:01 2012 +0300
     1.2 +++ b/prototype/src/tile.cc	Wed Aug 29 03:22:36 2012 +0300
     1.3 @@ -20,6 +20,20 @@
     1.4  	tset = tileset;
     1.5  }
     1.6  
     1.7 +Tile::~Tile()
     1.8 +{
     1.9 +	for(auto m : meshes) {
    1.10 +		delete m;
    1.11 +	}
    1.12 +	for(auto lt : lights) {
    1.13 +		delete lt;
    1.14 +	}
    1.15 +	for(auto ps : psattr) {
    1.16 +		psys_destroy_attr(ps);
    1.17 +		delete ps;
    1.18 +	}
    1.19 +}
    1.20 +
    1.21  bool Tile::load(const char *fname)
    1.22  {
    1.23  	if(!fname) {
    1.24 @@ -54,9 +68,16 @@
    1.25  	load_meshes(scn, nodemap);
    1.26  
    1.27  	printf("loaded tile %s: %d meshes, %d lights\n", saved_fname, (int)meshes.size(), (int)lights.size());
    1.28 +
    1.29 +	aiReleaseImport(scn);
    1.30  	return true;
    1.31  }
    1.32  
    1.33 +void Tile::update(unsigned long msec, float dt)
    1.34 +{
    1.35 +	// TODO particle system update
    1.36 +}
    1.37 +
    1.38  void Tile::draw(unsigned int draw_mask) const
    1.39  {
    1.40  	for(size_t i=0; i<meshes.size(); i++) {