With this patch, entities can serve as a sound source whose position
updates relative to the listener. This implements the last missing
feature of my previous positional audio patch, which is moving sound sources.
Previously, all sounds were relative to the listener with the listener
centered at (0, 0, 0), and once a sound started playing, the position could
not be changed. Volume was set as an estimation of the distance to the listener.
These restrictions are now gone; OpenAL will handle the volume & panning
based on the distance.
The remaining problem is that stereo sounds are not attenuated, at all.
Lua additions:
- playSfx() takes an additional parameter now.
- entity_setStopSoundsOnDeath()
Apparently this was half implemented but not fully finished.
Mono samples work fine, for stereo, L/R panning does not work (due to OpenAL's limitation)
Also fixed: entity sounds should not play if a cutscene is currently skipped.