priority & distance based sound scheduler

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1787 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-04-12 20:06:28 +00:00
parent f2f0ec4994
commit f67e6493c8
8 changed files with 180 additions and 102 deletions
+2 -2
View File
@@ -612,7 +612,7 @@ bool addbullethole(vec &from, vec &to, float radius, bool noisy)
o.add(ray.mul(dist));
o.add(vec(surface).mul(0.005f));
newparticle(o, surface, bulletholettl, 7);
if(noisy && bulletbouncesoundrad && o.dist(camera1->o) <= bulletbouncesoundrad) playsound(S_BULLETHIT, NULL, NULL, &o);
if(noisy && bulletbouncesoundrad && o.dist(camera1->o) <= bulletbouncesoundrad) playsound(S_BULLETHIT, &o, SP_LOW);
return true;
}
@@ -660,6 +660,6 @@ void addshotline(dynent *pl, vec &from, vec &to)
soundpos.mul(fd/(fd+td)*dist);
soundpos.add(from);
if(soundpos.dist(camera1->o) > bulletairsoundrad) return; // outside player radius
playsound(S_BULLETAIR1 + rnd(2), NULL, NULL, &soundpos);
playsound(S_BULLETAIR1 + rnd(2), &soundpos, SP_LOW);
}