From 048cfc6023c766d784d547b15cee882813ae8e75 Mon Sep 17 00:00:00 2001 From: TimePath Date: Wed, 9 Dec 2015 11:11:38 +1100 Subject: [PATCH] Registry: net interface --- qcsrc/common/animdecide.qh | 3 +++ qcsrc/lib/net.qh | 4 ++++ 2 files changed, 7 insertions(+) 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; -- 2.39.2