summaryrefslogtreecommitdiff
path: root/src/q_shared.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/q_shared.h')
-rw-r--r--src/q_shared.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/q_shared.h b/src/q_shared.h
index 9817c23..0c3d19b 100644
--- a/src/q_shared.h
+++ b/src/q_shared.h
@@ -174,7 +174,10 @@ typedef vec_t vec5_t[5];
typedef float mat4_t[16];
-typedef unsigned char color_t[4];
+typedef union {
+ uint32_t u32;
+ uint8_t u8[4];
+} color_t;
typedef int fixed4_t;
typedef int fixed8_t;
@@ -284,8 +287,6 @@ 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))
-#define FastColorCopy(a,b) memcpy(b,a,4)
-
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);
@@ -552,6 +553,12 @@ static inline float FloatSwap( float f ) {
(b)[1]=LittleFloat((a)[1]),\
(b)[2]=LittleFloat((a)[2]))
+#if USE_BGRA
+#define MakeColor( r, g, b, a ) MakeRawLong( b, g, r, a )
+#else
+#define MakeColor( r, g, b, a ) MakeRawLong( r, g, b, a )
+#endif
+
//=============================================
//