1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 17:15:21 +02: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
20 changed files with 140 additions and 188 deletions

View File

@@ -28,9 +28,9 @@ int ModApiSound::l_sound_play(lua_State *L)
{
SimpleSoundSpec spec;
read_soundspec(L, 1, spec);
bool looped = readParam<bool>(L, 2);
spec.loop = readParam<bool>(L, 2);
s32 handle = getGuiEngine(L)->playSound(spec, looped);
s32 handle = getGuiEngine(L)->playSound(spec);
lua_pushinteger(L, handle);