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:
parent
ceacff13a6
commit
bba4563d89
19 changed files with 237 additions and 262 deletions
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue