]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Registry: net interface
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 9 Dec 2015 00:11:38 +0000 (11:11 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 9 Dec 2015 00:11:38 +0000 (11:11 +1100)
qcsrc/common/animdecide.qh
qcsrc/lib/net.qh

index 0869cb79a1dba754030ae24be50ec7a1d00cd01b..c2076d75f42aa7e7117037bd4e2be5f8cb921721 100644 (file)
@@ -25,6 +25,9 @@ ENDCLASS(Animation)
 
 REGISTRY(Animations, BITS(8))
 REGISTER_REGISTRY(Animations)
+#define Animations_from(id) _Animations_from(id, NULL)
+#define WriteAnimation(to, it) WriteRegistry(Animations, to, it)
+#define ReadAnimation() ReadRegistry(Animations)
 #define REGISTER_ANIMATION(id, framenames) \
        .vector anim_##id; \
        REGISTER(Animations, ANIM_##id, m_id, NEW(Animation)) { \
index eb0366786359d32ddcfdd9ee1a0441f8f13fd227..a246359b48bd24ab2184d0722339e6fdbc39693b 100644 (file)
@@ -162,6 +162,8 @@ STATIC_INIT(RegisterTempEntities_renumber)
        #define APPROXPASTTIME_RANGE (64 * APPROXPASTTIME_ACCURACY_REQUIREMENT)
 
        #ifdef CSQC
+       #define ReadRegistry(r) r##_from(ReadByte())
+
                entity ReadCSQCEntity()
                {
                        int f = ReadShort();
@@ -210,6 +212,8 @@ STATIC_INIT(RegisterTempEntities_renumber)
        #else
                const int MSG_ENTITY = 5;
 
+               #define WriteRegistry(r, to, it) WriteByte(to, it.m_id)
+
                void WriteInt24_t(float dst, float val)
                {
                        float v;