mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Proselytize the network. Use IEEE F32 (#8030)
* Proselytize the network. Use IEEE F32 * Remove unused V2F1000 functions
This commit is contained in:
21
src/sound.h
21
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;
|
||||
|
Reference in New Issue
Block a user