From 53e14402c5574e30819875866290418ee1f4e150 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sun, 3 Nov 2024 20:16:18 +0100 Subject: [PATCH] EXTENSION: Finish FTE_PEXT_COLOURMOD definitions. Support for colourmod was partially declared in protocol.h, but missing the entity_state_t bytes, as well as a few defines. colourmod[3] is r/g/b with 1/32 precision, thus a value of 32 corresponds to 1.0f, which in effect means no color modification, and the same is true for 0.0f. Values above 1.0f yields overbrights. --- src/protocol.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/protocol.h b/src/protocol.h index 065eea7..273f50f 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -41,6 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # define FTE_PEXT_ENTITYDBL2 0x00004000 // max of 1024 ents instead of 512 # define FTE_PEXT_FLOATCOORDS 0x00008000 // supports floating point origins. # define FTE_PEXT_SPAWNSTATIC2 0x00400000 // Sends an entity delta instead of a baseline. +# define FTE_PEXT_COLOURMOD 0x00080000 // Sends three bytes of color modification for an entity # define FTE_PEXT_256PACKETENTITIES 0x01000000 // Client can recieve 256 packet entities. # define FTE_PEXT_CHUNKEDDOWNLOADS 0x20000000 // alternate file download method. Hopefully it'll give // quadroupled download speed, especially on higher pings. @@ -375,6 +376,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //moves verticies along normals // Useful for vacuum chambers... # endif // FTE_PEXT_FATNESS +# ifdef FTE_PEXT_COLOURMOD +# define PF_COLOURMOD (1<<19) +# endif // FTE_PEXT_COLOURMOD # ifdef FTE_PEXT_MODELDBL # define U_FTE_MODELDBL (1<<3) //extra bit for modelindexes # endif // FTE_PEXT_MODELDBL @@ -388,7 +392,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # define U_FTE_YETMORE (1<<7) //even more extension info stuff. # define U_FTE_DRAWFLAGS (1<<8) //use an extra qbyte for origin parts, cos one of them is off # define U_FTE_ABSLIGHT (1<<9) //Force a lightlevel -# define U_FTE_COLOURMOD (1<<10) //rgb +# ifdef FTE_PEXT_COLOURMOD +# define U_FTE_COLOURMOD (1<<10) //rgb +# endif // FTE_PEXT_COLOURMOD # define U_FTE_DPFLAGS (1<<11) # define U_FTE_TAGINFO (1<<12) # define U_FTE_LIGHT (1<<13) @@ -469,6 +475,9 @@ typedef struct entity_state_s { #ifdef FTE_PEXT_TRANS byte trans; #endif +#ifdef FTE_PEXT_COLOURMOD + byte colourmod[3]; +#endif } entity_state_t; #define MAX_PACKET_ENTITIES 64 // doesn't include nails