From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Thu, 15 Aug 2002 18:53:25 +0000 (+0000)
Subject: added support for .colormap values >= 1024 in QC to mean direct color specification... 
X-Git-Tag: RELEASE_0_2_0_RC1~342
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=33a2d3a595aece1e948125e3c670022136e7329f;p=xonotic%2Fdarkplaces.git

added support for .colormap values >= 1024 in QC to mean direct color specification (two 0-15 values, just like SV_ChangeTeam and setcolor use)


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2246 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/cl_main.c b/cl_main.c
index aaeb1e5c..21a4df5c 100644
--- a/cl_main.c
+++ b/cl_main.c
@@ -421,7 +421,9 @@ static void CL_RelinkNetworkEntities()
 		VectorCopy (neworg, ent->render.origin);
 		ent->render.flags = ent->state_current.flags;
 		ent->render.effects = effects = ent->state_current.effects;
-		if (cl.scores == NULL || !ent->state_current.colormap)
+		if (ent->state_current.flags & RENDER_COLORMAPPED)
+			ent->render.colormap = ent->state_current.colormap;
+		else if (cl.scores == NULL || !ent->state_current.colormap)
 			ent->render.colormap = -1; // no special coloring
 		else
 			ent->render.colormap = cl.scores[ent->state_current.colormap - 1].colors; // color it
diff --git a/protocol.h b/protocol.h
index c90867b3..da37e379 100644
--- a/protocol.h
+++ b/protocol.h
@@ -293,6 +293,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #define RENDER_VIEWMODEL 4
 #define RENDER_EXTERIORMODEL 8
 #define RENDER_LOWPRECISION 16 // send as low precision coordinates to save bandwidth
+#define RENDER_COLORMAPPED 32
 
 typedef struct
 {
diff --git a/sv_main.c b/sv_main.c
index edb04036..0a5b5bdf 100644
--- a/sv_main.c
+++ b/sv_main.c
@@ -1097,6 +1097,8 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg)
 			break;
 		VectorCopy(origin, s->origin);
 		VectorCopy(angles, s->angles);
+		if (ent->v.colormap >= 1024)
+			flags |= RENDER_COLORMAPPED;
 		s->colormap = ent->v.colormap;
 		s->skin = ent->v.skin;
 		s->frame = ent->v.frame;