summaryrefslogtreecommitdiffhomepage
path: root/src/engineapi.h
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-05-02 19:16:22 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-05-04 23:49:27 +0100
commit5194eeb0e7bb5d2a2086c96ed04c2a47f9594d87 (patch)
treea32ab5c832ae312cb8ddd9fb45dc3f894ac39820 /src/engineapi.h
parentbb5ce99e6cac43414a4bc61a636888e9f1f69b8c (diff)
Refactor the RGBA colour struct into engineapi.h
In both the engine and SST it's used in more places than just console printing, so it makes more sense to give it a more appropriate nanme and location.
Diffstat (limited to 'src/engineapi.h')
-rw-r--r--src/engineapi.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/engineapi.h b/src/engineapi.h
index 05f47ea..d740c8c 100644
--- a/src/engineapi.h
+++ b/src/engineapi.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2022 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -70,6 +70,16 @@ struct edict {
};
struct vec3f { float x, y, z; };
+
+/* an RGBA colour, used for colour console messages as well as VGUI/HUD stuff */
+struct rgba {
+ union {
+ struct { u8 r, g, b, a; };
+ u32 val;
+ uchar bytes[4];
+ };
+};
+
struct CMoveData {
bool firstrun : 1, gamecodemoved : 1;
ulong playerhandle;