From 5a7115c80ffca9d4757d5d5516af986fc7fb344a Mon Sep 17 00:00:00 2001 From: TimeServ Date: Fri, 9 Jun 2006 00:58:11 +0000 Subject: [PATCH] fix NetQuake/DP* parsing for newer features git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2321 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_ents.c | 58 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_ents.c b/engine/client/cl_ents.c index bf5a55963..8299f2172 100644 --- a/engine/client/cl_ents.c +++ b/engine/client/cl_ents.c @@ -1120,13 +1120,63 @@ void CLNQ_ParseEntity(unsigned int bits) else state->angles[2] = base->angles[2]; -#ifdef PEXT_SCALE - state->scale = 1*16; -#endif + if (bits & DPU_ALPHA) + i = MSG_ReadByte(); + else + i = -1; + #ifdef PEXT_TRANS - state->trans = 255; + if (i == -1) + state->trans = base->trans; + else + state->trans = i; #endif + if (bits & DPU_SCALE) + i = MSG_ReadByte(); + else + i = -1; + +#ifdef PEXT_SCALE + if (i == -1) + state->scale = base->scale; + else + state->scale = i; +#endif + + if (bits & DPU_EFFECTS2) + state->effects |= MSG_ReadByte() << 8; + + if (bits & DPU_GLOWSIZE) + state->glowsize = MSG_ReadByte(); + else + state->glowsize = base->glowsize; + + if (bits & DPU_GLOWCOLOR) + state->glowcolour = MSG_ReadByte(); + else + state->glowcolour = base->glowcolour; + + if (bits & DPU_COLORMOD) + { + i = MSG_ReadByte(); // follows format RRRGGGBB + state->colormod[0] = (qbyte)(((i >> 5) & 7) * (32.0f / 7.0f)); + state->colormod[1] = (qbyte)(((i >> 2) & 7) * (32.0f / 7.0f)); + state->colormod[2] = (qbyte)((i & 3) * (32.0f / 3.0f)); + } + else + { + state->colormod[0] = base->colormod[0]; + state->colormod[1] = base->colormod[1]; + state->colormod[2] = base->colormod[2]; + } + + if (bits & DPU_FRAME2) + state->frame |= MSG_ReadByte() << 8; + + if (bits & DPU_MODEL2) + state->modelindex |= MSG_ReadByte() << 8; + if (cls.demoplayback != DPB_NONE) for (pnum = 0; pnum < cl.splitclients; pnum++) if (num == cl.viewentity[pnum])