aboutsummaryrefslogtreecommitdiff
path: root/src/nodedef.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2022-06-20 21:56:12 +0200
committerGitHub <noreply@github.com>2022-06-20 21:56:12 +0200
commita463620edbe57071a7101297d33226507567ca73 (patch)
tree342d433ca55f4e3d1826508c303f2e6229d503f1 /src/nodedef.h
parent0b41533763bc9f104a2da2e4191f4654b8d8dab4 (diff)
downloadminetest-a463620edbe57071a7101297d33226507567ca73.tar.gz
minetest-a463620edbe57071a7101297d33226507567ca73.tar.bz2
minetest-a463620edbe57071a7101297d33226507567ca73.zip
Re-order sound-related code (#12382)
Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated 'fade' and 'pitch' values on server-side where only one was used anyway. SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included. Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the future. Per-type version numbers are kept for now as a safety rope in a special case.
Diffstat (limited to 'src/nodedef.h')
-rw-r--r--src/nodedef.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nodedef.h b/src/nodedef.h
index edd8d00a7..f4367cba9 100644
--- a/src/nodedef.h
+++ b/src/nodedef.h
@@ -36,9 +36,6 @@ class Client;
#include "texture_override.h" // TextureOverride
#include "tileanimation.h"
-// PROTOCOL_VERSION >= 37
-static const u8 CONTENTFEATURES_VERSION = 13;
-
class IItemDefManager;
class ITextureSource;
class IShaderSource;
@@ -286,8 +283,7 @@ struct TileDef
}
void serialize(std::ostream &os, u16 protocol_version) const;
- void deSerialize(std::istream &is, u8 contentfeatures_version,
- NodeDrawType drawtype);
+ void deSerialize(std::istream &is, NodeDrawType drawtype, u16 protocol_version);
};
// Defines the number of special tiles per nodedef
@@ -299,6 +295,10 @@ struct TileDef
struct ContentFeatures
{
+ // PROTOCOL_VERSION >= 37. This is legacy and should not be increased anymore,
+ // write checks that depend directly on the protocol version instead.
+ static const u8 CONTENTFEATURES_VERSION = 13;
+
/*
Cached stuff
*/
@@ -447,7 +447,7 @@ struct ContentFeatures
~ContentFeatures();
void reset();
void serialize(std::ostream &os, u16 protocol_version) const;
- void deSerialize(std::istream &is);
+ void deSerialize(std::istream &is, u16 protocol_version);
/*
Some handy methods
@@ -690,7 +690,7 @@ public:
/*!
* Writes the content of this manager to the given output stream.
- * @param protocol_version serialization version of ContentFeatures
+ * @param protocol_version Active network protocol version
*/
void serialize(std::ostream &os, u16 protocol_version) const;
@@ -698,8 +698,9 @@ public:
* Restores the manager from a serialized stream.
* This clears the previous state.
* @param is input stream containing a serialized NodeDefManager
+ * @param protocol_version Active network protocol version
*/
- void deSerialize(std::istream &is);
+ void deSerialize(std::istream &is, u16 protocol_version);
/*!
* Used to indicate that node registration has finished.