From 6ab9ea3cab179b100ded609bc7e34249ae34f2d5 Mon Sep 17 00:00:00 2001 From: Bryce Hutchings Date: Wed, 21 Aug 2002 03:42:36 +0000 Subject: [PATCH] move of some vector functions outside of just game --- reaction/game/g_utils.c | 51 +++------------------------------------ reaction/game/q_shared.c | 52 ++++++++++++++++++++++++++++++++++++++++ reaction/game/q_shared.h | 6 +++++ 3 files changed, 61 insertions(+), 48 deletions(-) diff --git a/reaction/game/g_utils.c b/reaction/game/g_utils.c index 29aacf04..d0295145 100644 --- a/reaction/game/g_utils.c +++ b/reaction/game/g_utils.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.18 2002/08/21 03:42:04 niceass +// move of some vector functions outside of just game +// // Revision 1.17 2002/07/19 04:28:39 niceass // no end line fix // @@ -307,54 +310,6 @@ void G_UseTargets(gentity_t * ent, gentity_t * activator) } } -/* -============= -TempVector - -This is just a convenience function -for making temporary vectors for function calls -============= -*/ -float *tv(float x, float y, float z) -{ - static int index; - static vec3_t vecs[8]; - float *v; - - // use an array so that multiple tempvectors won't collide - // for a while - v = vecs[index]; - index = (index + 1) & 7; - - v[0] = x; - v[1] = y; - v[2] = z; - - return v; -} - -/* -============= -VectorToString - -This is just a convenience function -for printing vectors -============= -*/ -char *vtos(const vec3_t v) -{ - static int index; - static char str[8][32]; - char *s; - - // use an array so that multiple vtos won't collide - s = str[index]; - index = (index + 1) & 7; - - Com_sprintf(s, 32, "(%i %i %i)", (int) v[0], (int) v[1], (int) v[2]); - - return s; -} /* =============== diff --git a/reaction/game/q_shared.c b/reaction/game/q_shared.c index d2c78518..897288b2 100644 --- a/reaction/game/q_shared.c +++ b/reaction/game/q_shared.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.7 2002/08/21 03:42:20 niceass +// move of some vector functions outside of just game +// // Revision 1.6 2002/06/16 20:06:14 jbravo // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // @@ -899,6 +902,55 @@ char *QDECL va(char *format, ...) return buf; } +/* +============= +TempVector + +This is just a convenience function +for making temporary vectors for function calls +============= +*/ +float *tv(float x, float y, float z) +{ + static int index; + static vec3_t vecs[8]; + float *v; + + // use an array so that multiple tempvectors won't collide + // for a while + v = vecs[index]; + index = (index + 1) & 7; + + v[0] = x; + v[1] = y; + v[2] = z; + + return v; +} + +/* +============= +VectorToString + +This is just a convenience function +for printing vectors +============= +*/ +char *vtos(const vec3_t v) +{ + static int index; + static char str[8][32]; + char *s; + + // use an array so that multiple vtos won't collide + s = str[index]; + index = (index + 1) & 7; + + Com_sprintf(s, 32, "(%.3f %.3f %.3f)", v[0], v[1], v[2]); + + return s; +} + /* ===================================================================== diff --git a/reaction/game/q_shared.h b/reaction/game/q_shared.h index 09c68388..4c683f97 100644 --- a/reaction/game/q_shared.h +++ b/reaction/game/q_shared.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.10 2002/08/21 03:42:36 niceass +// move of some vector functions outside of just game +// // Revision 1.9 2002/06/16 20:06:14 jbravo // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // @@ -953,6 +956,9 @@ float LittleFloat (const float *l); void Swap_Init (void); */ char *QDECL va(char *format, ...); +float *tv(float x, float y, float z); +char *vtos(const vec3_t v); + //=============================================