diff options
author | Andrey Nazarov <skuller@skuller.net> | 2011-12-20 14:37:44 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2012-04-03 01:25:47 +0400 |
commit | b3e271a53de2610de173f9b2bda5d15dd4d78909 (patch) | |
tree | d567b91dadac42e168bcb13db5fe93ffbc7e1533 /src/q_shared.h | |
parent | ca4a019a74b11aa21fea2a03c6dff3b183463aab (diff) |
Massive coding style change.
Use linux style brackets. Pad operators with spaces. Unpad parenthesis,
except for ‘if’, ‘for’, ‘while’ constructs.
Diffstat (limited to 'src/q_shared.h')
-rw-r--r-- | src/q_shared.h | 349 |
1 files changed, 177 insertions, 172 deletions
diff --git a/src/q_shared.h b/src/q_shared.h index e56cf30..501e9a9 100644 --- a/src/q_shared.h +++ b/src/q_shared.h @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + // q_shared.h -- included first by ALL program modules #include <math.h> @@ -50,7 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef __GNUC__ -#define q_printf( f, a ) __attribute__((format( printf, f, a ))) +#define q_printf(f, a) __attribute__((format(printf, f, a))) #define q_noreturn __attribute__((noreturn)) #define q_malloc __attribute__((malloc)) #if __GNUC__ >= 4 @@ -59,25 +59,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define q_sentinel #endif -#define q_likely( x ) __builtin_expect( !!(x), 1 ) -#define q_unlikely( x ) __builtin_expect( !!(x), 0 ) +#define q_likely(x) __builtin_expect(!!(x), 1) +#define q_unlikely(x) __builtin_expect(!!(x), 0) #if __GNUC__ >= 4 -#define q_offsetof( t, m ) __builtin_offsetof( t, m ) +#define q_offsetof(t, m) __builtin_offsetof(t, m) #else -#define q_offsetof( t, m ) ((size_t)&((t *)0)->m) +#define q_offsetof(t, m) ((size_t)&((t *)0)->m) #endif #else /* __GNUC__ */ -#define q_printf( f, a ) +#define q_printf(f, a) #define q_noreturn #define q_malloc #define q_sentinel #define q_packed -#define q_likely( x ) !!(x) -#define q_unlikely( x ) !!(x) -#define q_offsetof( t, m ) ((size_t)&((t *)0)->m) +#define q_likely(x) !!(x) +#define q_unlikely(x) !!(x) +#define q_offsetof(t, m) ((size_t)&((t *)0)->m) #endif /* !__GNUC__ */ @@ -113,7 +113,7 @@ typedef int qerror_t; #define MAX_SOUNDS 256 // so they cannot be blindly increased #define MAX_IMAGES 256 #define MAX_ITEMS 256 -#define MAX_GENERAL (MAX_CLIENTS*2) // general config strings +#define MAX_GENERAL (MAX_CLIENTS * 2) // general config strings #define MAX_CLIENT_NAME 16 @@ -126,21 +126,21 @@ typedef enum { typedef enum { PRINT_ALL, // general messages - PRINT_TALK, // print in green color + PRINT_TALK, // print in green color PRINT_DEVELOPER, // only print when "developer 1" PRINT_WARNING, // print in yellow color PRINT_ERROR, // print in red color PRINT_NOTICE // print in cyan color } print_type_t; -void Com_LPrintf( print_type_t type, const char *fmt, ... ) - q_printf( 2, 3 ); -void Com_Error( error_type_t code, const char *fmt, ... ) - q_noreturn q_printf( 2, 3 ); +void Com_LPrintf(print_type_t type, const char *fmt, ...) +q_printf(2, 3); +void Com_Error(error_type_t code, const char *fmt, ...) +q_noreturn q_printf(2, 3); -#define Com_Printf(...) Com_LPrintf( PRINT_ALL, __VA_ARGS__ ) -#define Com_WPrintf(...) Com_LPrintf( PRINT_WARNING, __VA_ARGS__ ) -#define Com_EPrintf(...) Com_LPrintf( PRINT_ERROR, __VA_ARGS__ ) +#define Com_Printf(...) Com_LPrintf(PRINT_ALL, __VA_ARGS__) +#define Com_WPrintf(...) Com_LPrintf(PRINT_WARNING, __VA_ARGS__) +#define Com_EPrintf(...) Com_LPrintf(PRINT_ERROR, __VA_ARGS__) // game print flags #define PRINT_LOW 0 // pickup messages @@ -200,7 +200,8 @@ typedef struct vrect_s { #define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) // microsoft's fabs seems to be ungodly slow... -static inline float Q_fabs( float f ) { +static inline float Q_fabs(float f) +{ union { uint32_t l; float f; @@ -211,9 +212,9 @@ static inline float Q_fabs( float f ) { return tmp.f; } -#define Q_ftol( f ) ((long)(f)) +#define Q_ftol(f) ((long)(f)) -#define DEG2RAD( a ) ( a * M_PI ) / 180.0F +#define DEG2RAD(a) (a * M_PI) / 180.0F #define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) #define CrossProduct(v1,v2,cross) \ @@ -287,29 +288,31 @@ static inline float Q_fabs( float f ) { #define Vector4Negate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2],(b)[3]=-(a)[3]) #define Vector4Set(v, a, b, c, d) ((v)[0]=(a),(v)[1]=(b),(v)[2]=(c),(v)[3]=(d)) -void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); -vec_t VectorNormalize (vec3_t v); // returns vector length -vec_t VectorNormalize2 (vec3_t v, vec3_t out); -void ClearBounds (vec3_t mins, vec3_t maxs); -void AddPointToBounds (const vec3_t v, vec3_t mins, vec3_t maxs); -vec_t RadiusFromBounds (const vec3_t mins, const vec3_t maxs); -void UnionBounds( vec3_t a[2], vec3_t b[2], vec3_t c[2] ); +void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); +vec_t VectorNormalize(vec3_t v); // returns vector length +vec_t VectorNormalize2(vec3_t v, vec3_t out); +void ClearBounds(vec3_t mins, vec3_t maxs); +void AddPointToBounds(const vec3_t v, vec3_t mins, vec3_t maxs); +vec_t RadiusFromBounds(const vec3_t mins, const vec3_t maxs); +void UnionBounds(vec3_t a[2], vec3_t b[2], vec3_t c[2]); -static inline unsigned npot32( unsigned k ) { - if( k == 0 ) +static inline unsigned npot32(unsigned k) +{ + if (k == 0) return 1; k--; - k = k | ( k >> 1 ); - k = k | ( k >> 2 ); - k = k | ( k >> 4 ); - k = k | ( k >> 8 ); - k = k | ( k >> 16 ); + k = k | (k >> 1); + k = k | (k >> 2); + k = k | (k >> 4); + k = k | (k >> 8); + k = k | (k >> 16); return k + 1; } -static inline float LerpAngle( float a2, float a1, float frac ) { +static inline float LerpAngle(float a2, float a1, float frac) +{ if (a1 - a2 > 180) a1 -= 360; if (a1 - a2 < -180) @@ -317,29 +320,33 @@ static inline float LerpAngle( float a2, float a1, float frac ) { return a2 + frac * (a1 - a2); } -static inline float anglemod( float a ) { - a = (360.0f/65536) * ((int)(a*(65536/360.0f)) & 65535); +static inline float anglemod(float a) +{ + a = (360.0f / 65536) * ((int)(a * (65536 / 360.0f)) & 65535); return a; } -static inline int rand_byte( void ) { +static inline int rand_byte(void) +{ int r = rand(); - int b1 = ( r >> 24 ) & 255; - int b2 = ( r >> 16 ) & 255; - int b3 = ( r >> 8 ) & 255; - int b4 = ( r ) & 255; + int b1 = (r >> 24) & 255; + int b2 = (r >> 16) & 255; + int b3 = (r >> 8) & 255; + int b4 = (r) & 255; return b1 ^ b2 ^ b3 ^ b4; } -static inline int Q_align( int value, int align ) { +static inline int Q_align(int value, int align) +{ int mod = value % align; return mod ? value + align - mod : value; } -static inline int Q_gcd( int a, int b ) { - while( b != 0 ) { +static inline int Q_gcd(int a, int b) +{ + while (b != 0) { int t = b; b = a % b; a = t; @@ -348,8 +355,8 @@ static inline int Q_gcd( int a, int b ) { } #define clamp(a,b,c) ((a)<(b)?(a)=(b):(a)>(c)?(a)=(c):(a)) -#define cclamp(a,b,c) ((b)>(c)?clamp(a,c,b):clamp(a,b,c)) - +#define cclamp(a,b,c) ((b)>(c)?clamp(a,c,b):clamp(a,b,c)) + #ifndef max #define max(a,b) ((a)>(b)?(a):(b)) #endif @@ -358,94 +365,100 @@ static inline int Q_gcd( int a, int b ) { #define min(a,b) ((a)<(b)?(a):(b)) #endif -#define frand() ( ( rand() & 32767 ) * ( 1.0 / 32767 ) ) -#define crand() ( ( rand() & 32767 ) * ( 2.0 / 32767 ) - 1 ) +#define frand() ((rand() & 32767) * (1.0 / 32767)) +#define crand() ((rand() & 32767) * (2.0 / 32767) - 1) #define Q_rint(x) ((x) < 0 ? ((int)((x) - 0.5f)) : ((int)((x) + 0.5f))) -#define Q_IsBitSet( data, bit ) ( ( (data)[(bit) >> 3] & ( 1 << ( (bit) & 7 ) ) ) != 0 ) -#define Q_SetBit( data, bit ) ( (data)[(bit) >> 3] |= ( 1 << ( (bit) & 7 ) ) ) -#define Q_ClearBit( data, bit ) ( (data)[(bit) >> 3] &= ~( 1 << ( (bit) & 7 ) ) ) +#define Q_IsBitSet(data, bit) (((data)[(bit) >> 3] & (1 << ((bit) & 7))) != 0) +#define Q_SetBit(data, bit) ((data)[(bit) >> 3] |= (1 << ((bit) & 7))) +#define Q_ClearBit(data, bit) ((data)[(bit) >> 3] &= ~(1 << ((bit) & 7))) //============================================= // fast "C" macros -#define Q_isupper( c ) ( (c) >= 'A' && (c) <= 'Z' ) -#define Q_islower( c ) ( (c) >= 'a' && (c) <= 'z' ) -#define Q_isdigit( c ) ( (c) >= '0' && (c) <= '9' ) -#define Q_isalpha( c ) ( Q_isupper( c ) || Q_islower( c ) ) -#define Q_isalnum( c ) ( Q_isalpha( c ) || Q_isdigit( c ) ) -#define Q_isprint( c ) ( (c) >= 32 && (c) < 127 ) -#define Q_isgraph( c ) ( (c) > 32 && (c) < 127 ) -#define Q_isspace( c ) ( c == ' ' || c == '\f' || c == '\n' || \ - c == '\r' || c == '\t' || c == '\v' ) +#define Q_isupper(c) ((c) >= 'A' && (c) <= 'Z') +#define Q_islower(c) ((c) >= 'a' && (c) <= 'z') +#define Q_isdigit(c) ((c) >= '0' && (c) <= '9') +#define Q_isalpha(c) (Q_isupper(c) || Q_islower(c)) +#define Q_isalnum(c) (Q_isalpha(c) || Q_isdigit(c)) +#define Q_isprint(c) ((c) >= 32 && (c) < 127) +#define Q_isgraph(c) ((c) > 32 && (c) < 127) +#define Q_isspace(c) (c == ' ' || c == '\f' || c == '\n' || \ + c == '\r' || c == '\t' || c == '\v') // tests if specified character is valid quake path character -#define Q_ispath( c ) ( Q_isalnum( c ) || (c) == '_' || (c) == '-' ) +#define Q_ispath(c) (Q_isalnum(c) || (c) == '_' || (c) == '-') // tests if specified character has special meaning to quake console -#define Q_isspecial( c ) ( (c) == '\r' || (c) == '\n' || (c) == 127 ) +#define Q_isspecial(c) ((c) == '\r' || (c) == '\n' || (c) == 127) -static inline int Q_tolower( int c ) { - if( Q_isupper( c ) ) { - c += ( 'a' - 'A' ); +static inline int Q_tolower(int c) +{ + if (Q_isupper(c)) { + c += ('a' - 'A'); } return c; } -static inline int Q_toupper( int c ) { - if( Q_islower( c ) ) { - c -= ( 'a' - 'A' ); +static inline int Q_toupper(int c) +{ + if (Q_islower(c)) { + c -= ('a' - 'A'); } return c; } -static inline char *Q_strlwr( char *s ) { +static inline char *Q_strlwr(char *s) +{ char *p = s; - while( *p ) { - *p = Q_tolower( *p ); + while (*p) { + *p = Q_tolower(*p); p++; } return s; } -static inline char *Q_strupr( char *s ) { +static inline char *Q_strupr(char *s) +{ char *p = s; - while( *p ) { - *p = Q_toupper( *p ); + while (*p) { + *p = Q_toupper(*p); p++; } return s; } -static inline int Q_charhex( int c ) { - if( c >= 'A' && c <= 'F' ) { - return 10 + ( c - 'A' ); +static inline int Q_charhex(int c) +{ + if (c >= 'A' && c <= 'F') { + return 10 + (c - 'A'); } - if( c >= 'a' && c <= 'f' ) { - return 10 + ( c - 'a' ); + if (c >= 'a' && c <= 'f') { + return 10 + (c - 'a'); } - if( c >= '0' && c <= '9' ) { + if (c >= '0' && c <= '9') { return c - '0'; } return -1; } // converts quake char to ASCII equivalent -static inline int Q_charascii( int c ) { - if( Q_isspace( c ) ) { +static inline int Q_charascii(int c) +{ + if (Q_isspace(c)) { // white-space chars are output as-is return c; } c &= 127; // strip high bits - if( Q_isprint( c ) ) { + if (Q_isprint(c)) { return c; } - switch( c ) { + switch (c) { // handle bold brackets case 16: return '['; case 17: return ']'; @@ -454,84 +467,87 @@ static inline int Q_charascii( int c ) { } // portable case insensitive compare -int Q_strcasecmp( const char *s1, const char *s2 ); -int Q_strncasecmp( const char *s1, const char *s2, size_t n ); -char *Q_strcasestr( const char *s1, const char *s2 ); +int Q_strcasecmp(const char *s1, const char *s2); +int Q_strncasecmp(const char *s1, const char *s2, size_t n); +char *Q_strcasestr(const char *s1, const char *s2); #define Q_stricmp Q_strcasecmp #define Q_stricmpn Q_strncasecmp #define Q_stristr Q_strcasestr #ifdef _WIN32 -#define Q_mkdir( p ) _mkdir( p ) -#define Q_unlink( p ) _unlink( p ) +#define Q_mkdir(p) _mkdir(p) +#define Q_unlink(p) _unlink(p) #else -#define Q_mkdir( p ) mkdir( p, 0775 ) -#define Q_unlink( p ) unlink( p ) +#define Q_mkdir(p) mkdir(p, 0775) +#define Q_unlink(p) unlink(p) #endif -char *Q_strchrnul( const char *s, int c ); -void *Q_memccpy( void *dst, const void *src, int c, size_t size ); -void Q_setenv( const char *name, const char *value ); +char *Q_strchrnul(const char *s, int c); +void *Q_memccpy(void *dst, const void *src, int c, size_t size); +void Q_setenv(const char *name, const char *value); -char *COM_SkipPath( const char *pathname ); -void COM_StripExtension( const char *in, char *out, size_t size ); -void COM_FileBase (char *in, char *out); -void COM_FilePath( const char *in, char *out, size_t size ); -size_t COM_DefaultExtension( char *path, const char *ext, size_t size ); -char *COM_FileExtension( const char *in ); +char *COM_SkipPath(const char *pathname); +void COM_StripExtension(const char *in, char *out, size_t size); +void COM_FileBase(char *in, char *out); +void COM_FilePath(const char *in, char *out, size_t size); +size_t COM_DefaultExtension(char *path, const char *ext, size_t size); +char *COM_FileExtension(const char *in); -#define COM_CompareExtension( in, ext ) \ - Q_strcasecmp( COM_FileExtension( in ), ext ) +#define COM_CompareExtension(in, ext) \ + Q_strcasecmp(COM_FileExtension(in), ext) -qboolean COM_IsFloat( const char *s ); -qboolean COM_IsUint( const char *s ); -qboolean COM_IsPath( const char *s ); -qboolean COM_IsWhite( const char *s ); +qboolean COM_IsFloat(const char *s); +qboolean COM_IsUint(const char *s); +qboolean COM_IsPath(const char *s); +qboolean COM_IsWhite(const char *s); -char *COM_Parse( const char **data_p ); +char *COM_Parse(const char **data_p); // data is an in/out parm, returns a parsed out token -int COM_Compress( char *data ); +int COM_Compress(char *data); -int QDECL SortStrcmp( const void *p1, const void *p2 ); -int QDECL SortStricmp( const void *p1, const void *p2 ); +int QDECL SortStrcmp(const void *p1, const void *p2); +int QDECL SortStricmp(const void *p1, const void *p2); -size_t COM_strclr( char *s ); +size_t COM_strclr(char *s); // buffer safe operations -size_t Q_strlcpy( char *dst, const char *src, size_t size ); -size_t Q_strlcat( char *dst, const char *src, size_t size ); +size_t Q_strlcpy(char *dst, const char *src, size_t size); +size_t Q_strlcat(char *dst, const char *src, size_t size); -size_t Q_concat( char *dest, size_t size, ... ) q_sentinel; +size_t Q_concat(char *dest, size_t size, ...) q_sentinel; -size_t Q_vsnprintf( char *dest, size_t size, const char *fmt, va_list argptr ); -size_t Q_vscnprintf( char *dest, size_t size, const char *fmt, va_list argptr ); -size_t Q_snprintf( char *dest, size_t size, const char *fmt, ... ) q_printf( 3, 4 ); -size_t Q_scnprintf( char *dest, size_t size, const char *fmt, ... ) q_printf( 3, 4 ); +size_t Q_vsnprintf(char *dest, size_t size, const char *fmt, va_list argptr); +size_t Q_vscnprintf(char *dest, size_t size, const char *fmt, va_list argptr); +size_t Q_snprintf(char *dest, size_t size, const char *fmt, ...) q_printf(3, 4); +size_t Q_scnprintf(char *dest, size_t size, const char *fmt, ...) q_printf(3, 4); -char *va( const char *format, ... ) q_printf( 1, 2 ); +char *va(const char *format, ...) q_printf(1, 2); //============================================= -static inline uint16_t ShortSwap( uint16_t s ) { - s = ( s >> 8 ) | ( s << 8 ); +static inline uint16_t ShortSwap(uint16_t s) +{ + s = (s >> 8) | (s << 8); return s; } -static inline uint32_t LongSwap( uint32_t l ) { - l = ( ( l >> 8 ) & 0x00ff00ff ) | ( ( l << 8 ) & 0xff00ff00 ); - l = ( l >> 16 ) | ( l << 16 ); +static inline uint32_t LongSwap(uint32_t l) +{ + l = ((l >> 8) & 0x00ff00ff) | ((l << 8) & 0xff00ff00); + l = (l >> 16) | (l << 16); return l; } -static inline float FloatSwap( float f ) { +static inline float FloatSwap(float f) +{ union { float f; uint32_t l; } dat1, dat2; - + dat1.f = f; - dat2.l = LongSwap( dat1.l ); + dat2.l = LongSwap(dat1.l); return dat2.f; } @@ -569,9 +585,9 @@ static inline float FloatSwap( float f ) { (b)[2]=LittleFloat((a)[2])) #if USE_BGRA -#define MakeColor( r, g, b, a ) MakeRawLong( b, g, r, a ) +#define MakeColor(r, g, b, a) MakeRawLong(b, g, r, a) #else -#define MakeColor( r, g, b, a ) MakeRawLong( r, g, b, a ) +#define MakeColor(r, g, b, a) MakeRawLong(r, g, b, a) #endif //============================================= @@ -583,13 +599,13 @@ static inline float FloatSwap( float f ) { #define MAX_INFO_VALUE 64 #define MAX_INFO_STRING 512 -char *Info_ValueForKey( const char *s, const char *key ); -void Info_RemoveKey( char *s, const char *key ); -qboolean Info_SetValueForKey( char *s, const char *key, const char *value ); -qboolean Info_Validate( const char *s ); -size_t Info_SubValidate( const char *s ); -void Info_NextPair( const char **string, char *key, char *value ); -void Info_Print( const char *infostring ); +char *Info_ValueForKey(const char *s, const char *key); +void Info_RemoveKey(char *s, const char *key); +qboolean Info_SetValueForKey(char *s, const char *key, const char *value); +qboolean Info_Validate(const char *s); +size_t Info_SubValidate(const char *s); +void Info_NextPair(const char **string, char *key, char *value); +void Info_Print(const char *infostring); /* ========================================================== @@ -606,14 +622,14 @@ CVARS (console variables) #define CVAR_USERINFO 2 // added to userinfo when changed #define CVAR_SERVERINFO 4 // added to serverinfo when changed #define CVAR_NOSET 8 // don't allow change from console at all, - // but can be set from the command line +// but can be set from the command line #define CVAR_LATCH 16 // save changes until server restart struct cvar_s; struct genctx_s; -typedef void (*xchanged_t)( struct cvar_s * ); -typedef void (*xgenerator_t)( struct genctx_s * ); +typedef void (*xchanged_t)(struct cvar_s *); +typedef void (*xgenerator_t)(struct genctx_s *); // nothing outside the cvar.*() functions should modify these fields! typedef struct cvar_s { @@ -711,8 +727,7 @@ COLLISION DETECTION // plane_t structure // !!! if this is changed, it must be changed in asm code too !!! -typedef struct cplane_s -{ +typedef struct cplane_s { vec3_t normal; float dist; byte type; // for fast side tests @@ -744,16 +759,14 @@ typedef struct cplane_s #define CPLANE_PAD0 18 #define CPLANE_PAD1 19 -typedef struct csurface_s -{ +typedef struct csurface_s { char name[16]; int flags; int value; } csurface_t; // a trace is returned when a box is swept through the world -typedef struct -{ +typedef struct { qboolean allsolid; // if qtrue, plane is not valid qboolean startsolid; // if qtrue, the initial point was in a solid area float fraction; // time completed, 1.0 = didn't hit anything @@ -766,8 +779,7 @@ typedef struct // pmove_state_t is the information necessary for client side movement // prediction -typedef enum -{ +typedef enum { // can accelerate and turn PM_NORMAL, PM_SPECTATOR, @@ -792,8 +804,7 @@ typedef enum // prediction stays in sync, so no floats are used. // if any part of the game code modifies this struct, it // will result in a prediction error of some degree. -typedef struct -{ +typedef struct { pmtype_t pm_type; short origin[3]; // 12.3 @@ -802,7 +813,7 @@ typedef struct byte pm_time; // each unit = 8 ms short gravity; short delta_angles[3]; // add to command angles to get view direction - // changed by spawns, rotating objects, and teleporters + // changed by spawns, rotating objects, and teleporters } pmove_state_t; @@ -815,8 +826,7 @@ typedef struct // usercmd_t is sent to the server each client frame -typedef struct usercmd_s -{ +typedef struct usercmd_s { byte msec; byte buttons; short angles[3]; @@ -827,8 +837,7 @@ typedef struct usercmd_s #define MAXTOUCH 32 -typedef struct -{ +typedef struct { // state (in / out) pmove_state_t s; @@ -850,8 +859,8 @@ typedef struct int waterlevel; // callbacks to test the world - trace_t (*trace) (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end); - int (*pointcontents) (vec3_t point); + trace_t (*trace)(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end); + int (*pointcontents)(vec3_t point); } pmove_t; @@ -1207,8 +1216,7 @@ extern const vec3_t monster_flash_offset []; // at a location seperate from any existing entity. // Temporary entity messages are explicitly constructed // and broadcast. -typedef enum -{ +typedef enum { TE_GUNSHOT, TE_BLOOD, TE_BLASTER, @@ -1439,9 +1447,9 @@ ROGUE - VERSIONS #define MAX_CONFIGSTRINGS (CS_GENERAL+MAX_GENERAL) // Some mods actually exploit CS_STATUSBAR to take space up to CS_AIRACCEL -#define CS_SIZE( cs ) \ - ( (cs) >= CS_STATUSBAR && (cs) < CS_AIRACCEL ? \ - MAX_QPATH * ( CS_AIRACCEL - (cs) ) : MAX_QPATH ) +#define CS_SIZE(cs) \ + ((cs) >= CS_STATUSBAR && (cs) < CS_AIRACCEL ? \ + MAX_QPATH * (CS_AIRACCEL - (cs)) : MAX_QPATH) //============================================== @@ -1451,8 +1459,7 @@ ROGUE - VERSIONS // ertity events are for effects that take place reletive // to an existing entities origin. Very network efficient. // All muzzle flashes really should be converted to events... -typedef enum -{ +typedef enum { EV_NONE, EV_ITEM_RESPAWN, EV_FOOTSTEP, @@ -1467,8 +1474,7 @@ typedef enum // entity_state_t is the information conveyed from the server // in an update message about entities that the client will // need to render in some way -typedef struct entity_state_s -{ +typedef struct entity_state_s { int number; // edict index vec3_t origin; @@ -1496,8 +1502,7 @@ typedef struct entity_state_s // to rendered a view. There will only be 10 player_state_t sent each second, // but the number of pmove_state_t changes will be reletive to client // frame rates -typedef struct -{ +typedef struct { pmove_state_t pmove; // for prediction // these fields do not need to be communicated bit-precise @@ -1513,7 +1518,7 @@ typedef struct int gunframe; float blend[4]; // rgba full screen effect - + float fov; // horizontal field of view int rdflags; // refdef flags |