dungeon_crawler

diff prototype/src/audio/auman.cc @ 51:d57df51f6b50

- fixed audio panning (listener direction) - particles had no fog - sound sources were not destroyed properly
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 18 Sep 2012 09:40:56 +0300
parents aa9e28670ae2
children
line diff
     1.1 --- a/prototype/src/audio/auman.cc	Tue Sep 18 04:45:46 2012 +0300
     1.2 +++ b/prototype/src/audio/auman.cc	Tue Sep 18 09:40:56 2012 +0300
     1.3 @@ -8,6 +8,7 @@
     1.4  		fprintf(stderr, "failed to create kd tree\n");
     1.5  		throw std::bad_alloc();
     1.6  	}
     1.7 +	kd_data_destructor(sources, [](void *s) { delete (AudioSource*)s; });
     1.8  }
     1.9  
    1.10  AudioManager::~AudioManager()
    1.11 @@ -17,12 +18,12 @@
    1.12  
    1.13  void AudioManager::clear()
    1.14  {
    1.15 -	kd_clear(sources);
    1.16 -
    1.17  	for(auto s : active_set) {
    1.18  		s->stop();
    1.19  	}
    1.20  	active_set.clear();
    1.21 +
    1.22 +	kd_clear(sources);
    1.23  }
    1.24  
    1.25  void AudioManager::add_source(AudioSource *s)