summaryrefslogtreecommitdiff
path: root/src/sound.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-01-03 17:04:26 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2019-01-03 17:04:26 +0100
commitbba4563d89b6708d75a4053c69873dff0d747538 (patch)
tree8ae0c939a8b5c194f300be79e1369ad8ef4675b7 /src/sound.h
parentceacff13a666779d75ac48f2cc5c11bc2ce5c6e1 (diff)
downloadminetest-bba4563d89b6708d75a4053c69873dff0d747538.tar.gz
minetest-bba4563d89b6708d75a4053c69873dff0d747538.tar.bz2
minetest-bba4563d89b6708d75a4053c69873dff0d747538.zip
Proselytize the network. Use IEEE F32 (#8030)
* Proselytize the network. Use IEEE F32 * Remove unused V2F1000 functions
Diffstat (limited to 'src/sound.h')
-rw-r--r--src/sound.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sound.h b/src/sound.h
index 81d918c81..6cbd55e8f 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <set>
#include <string>
+#include "util/serialize.h"
#include "irrlichttypes_bloated.h"
struct SimpleSoundSpec
@@ -34,6 +35,26 @@ struct SimpleSoundSpec
bool exists() const { return !name.empty(); }
+ // Take cf_version from ContentFeatures::serialize to
+ // keep in sync with item definitions
+ void serialize(std::ostream &os, u8 cf_version) const
+ {
+ os << serializeString(name);
+ writeF32(os, gain);
+ writeF32(os, pitch);
+ writeF32(os, fade);
+ // if (cf_version < ?)
+ // return;
+ }
+
+ void deSerialize(std::istream &is, u8 cf_version)
+ {
+ name = deSerializeString(is);
+ gain = readF32(is);
+ pitch = readF32(is);
+ fade = readF32(is);
+ }
+
std::string name;
float gain = 1.0f;
float fade = 0.0f;