1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Proselytize the network. Use IEEE F32 (#8030)

* Proselytize the network. Use IEEE F32
* Remove unused V2F1000 functions
This commit is contained in:
SmallJoker 2019-01-03 17:04:26 +01:00 committed by Loïc Blot
parent ceacff13a6
commit bba4563d89
19 changed files with 237 additions and 262 deletions

View file

@ -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;