1
0
mirror of https://github.com/luanti-org/luanti.git synced 2026-01-14 13:25:21 +01:00

Move serialisation code out of sound_spec.h

This commit is contained in:
cx384
2025-11-30 15:19:04 +01:00
parent 5a799b9b24
commit d4c3529af7
10 changed files with 34 additions and 22 deletions

23
src/sound_spec.cpp Normal file
View File

@@ -0,0 +1,23 @@
// Luanti
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (C) 2025 Luanti developers
#include "sound_spec.h"
#include "util/serialize.h"
void SoundSpec::serializeSimple(std::ostream &os, u16 protocol_version) const
{
os << serializeString16(name);
writeF32(os, gain);
writeF32(os, pitch);
writeF32(os, fade);
}
void SoundSpec::deSerializeSimple(std::istream &is, u16 protocol_version)
{
name = deSerializeString16(is);
gain = readF32(is);
pitch = readF32(is);
fade = readF32(is);
}