mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
(se)SerializeString: Include max length in the name
This commit clarifies the maximal length of the serialized strings. It will avoid accidental use of serializeString() when a larger string can be expected. Removes unused Wide String serialization functions
This commit is contained in:
parent
ca5c2dbefa
commit
947466ab28
23 changed files with 168 additions and 223 deletions
|
@ -39,7 +39,7 @@ struct SimpleSoundSpec
|
|||
// keep in sync with item definitions
|
||||
void serialize(std::ostream &os, u8 cf_version) const
|
||||
{
|
||||
os << serializeString(name);
|
||||
os << serializeString16(name);
|
||||
writeF32(os, gain);
|
||||
writeF32(os, pitch);
|
||||
writeF32(os, fade);
|
||||
|
@ -49,7 +49,7 @@ struct SimpleSoundSpec
|
|||
|
||||
void deSerialize(std::istream &is, u8 cf_version)
|
||||
{
|
||||
name = deSerializeString(is);
|
||||
name = deSerializeString16(is);
|
||||
gain = readF32(is);
|
||||
pitch = readF32(is);
|
||||
fade = readF32(is);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue