From: TimePath Date: Wed, 9 Dec 2015 00:11:38 +0000 (+1100) Subject: Registry: net interface X-Git-Tag: xonotic-v0.8.2~1528 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=048cfc6023c766d784d547b15cee882813ae8e75;p=xonotic%2Fxonotic-data.pk3dir.git Registry: net interface --- diff --git a/qcsrc/common/animdecide.qh b/qcsrc/common/animdecide.qh index 0869cb79a..c2076d75f 100644 --- a/qcsrc/common/animdecide.qh +++ b/qcsrc/common/animdecide.qh @@ -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)) { \ diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index eb0366786..a246359b4 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -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;