1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-16 18:01:40 +00:00

Re-order sound-related code (#12382)

Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated
'fade' and 'pitch' values on server-side where only one was used anyway.
SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included.

Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the
future. Per-type version numbers are kept for now as a safety rope in a special case.
This commit is contained in:
SmallJoker 2022-06-20 21:56:12 +02:00 committed by GitHub
parent 0b41533763
commit a463620edb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 140 additions and 188 deletions

View file

@ -63,13 +63,13 @@ public:
virtual void step(float dtime) = 0;
virtual void fadeSound(int sound, float step, float gain) = 0;
int playSound(const SimpleSoundSpec &spec, bool loop)
int playSound(const SimpleSoundSpec &spec)
{
return playSound(spec.name, loop, spec.gain, spec.fade, spec.pitch);
return playSound(spec.name, spec.loop, spec.gain, spec.fade, spec.pitch);
}
int playSoundAt(const SimpleSoundSpec &spec, bool loop, const v3f &pos)
int playSoundAt(const SimpleSoundSpec &spec, const v3f &pos)
{
return playSoundAt(spec.name, loop, spec.gain, pos, spec.pitch);
return playSoundAt(spec.name, spec.loop, spec.gain, pos, spec.pitch);
}
};