From a5ac2e9a9d6834ee4a971034fc9c4e891383863f Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 9 Apr 2013 01:04:43 +0000 Subject: [PATCH] did I forget to commit this? did I need to? oops. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4309 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/csaddon/src/csfixups.qc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 quakec/csaddon/src/csfixups.qc diff --git a/quakec/csaddon/src/csfixups.qc b/quakec/csaddon/src/csfixups.qc new file mode 100644 index 000000000..d12b5b3b6 --- /dev/null +++ b/quakec/csaddon/src/csfixups.qc @@ -0,0 +1,20 @@ +//with addons, the engine only tracks one set of globals for most things. +//thus we use pointers in the addon to refer to that set of globals. +//this avoids having to make things shared, and having to pay for every transition. + +vector *ptr_trace_endpos; +#define trace_endpos (*ptr_trace_endpos) + +vector *ptr_trace_plane_normal; +#define trace_plane_normal (*ptr_trace_plane_normal) + +entity *ptr_self; +#define self (*ptr_self) + +void() csfixups = +{ + ptr_trace_endpos = (vector*)externvalue(0, "&trace_endpos"); + ptr_trace_plane_normal = (vector*)externvalue(0, "&trace_plane_normal"); + ptr_self = (entity*)externvalue(0, "&self"); +}; +