diff --git a/src/client/cl_entities.c b/src/client/cl_entities.c index 1e8d6a85..1c4b36bf 100644 --- a/src/client/cl_entities.c +++ b/src/client/cl_entities.c @@ -61,7 +61,11 @@ CL_AddPacketEntities(frame_t *frame) cent = &cl_entities[s1->number]; effects = s1->effects; +#if _RREXTEND rr_effects = s1->rr_effects; +#else + rr_effects = 0; +#endif renderfx = s1->renderfx; /* set frame */ @@ -208,7 +212,11 @@ CL_AddPacketEntities(frame_t *frame) } /* store scale */ +#if _RREXTEND VectorCopy(s1->scale, ent.scale); +#else + VectorClear(ent.scale); +#endif } /* only used for black hole model right now */ diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index f40cebd8..5c32c193 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -143,6 +143,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) VectorCopy(from->origin, to->old_origin); to->number = number; +#if _RREXTEND if (cls.serverProtocol != PROTOCOL_VERSION) { int i; @@ -153,6 +154,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) to->scale[i] = 1.0f; } } +#endif if (IS_QII97_PROTOCOL(cls.serverProtocol)) { @@ -222,6 +224,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) { to->skinnum = MSG_ReadLong(&net_message); /* Additional scale with skinnum */ +#if _RREXTEND if (cls.serverProtocol == PROTOCOL_VERSION) { int i; @@ -231,6 +234,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) to->scale[i] = MSG_ReadFloat(&net_message); } } +#endif } else if (bits & U_SKIN8) { @@ -255,6 +259,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) } /* ReRelease effects */ +#if _RREXTEND if (cls.serverProtocol != PROTOCOL_VERSION) { to->rr_effects = 0; @@ -274,6 +279,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) to->rr_effects = MSG_ReadShort(&net_message); } } +#endif if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16)) { diff --git a/src/common/header/shared.h b/src/common/header/shared.h index f958ce1f..98aaff03 100644 --- a/src/common/header/shared.h +++ b/src/common/header/shared.h @@ -1228,10 +1228,15 @@ typedef struct entity_state_s int event; /* impulse events -- muzzle flashes, footsteps, etc */ /* events only go out for a single frame, they */ /* are automatically cleared each frame */ +} entity_state_t; + +/* ReRelease states */ +typedef struct entity_rrstate_s +{ /* New protocol fields */ vec3_t scale; /* model scale */ - unsigned int rr_effects; -} entity_state_t; + unsigned int effects; +} entity_rrstate_t; /* ============================================== */ diff --git a/src/common/movemsg.c b/src/common/movemsg.c index cc573575..e59125d4 100644 --- a/src/common/movemsg.c +++ b/src/common/movemsg.c @@ -505,6 +505,7 @@ MSG_WriteDeltaEntity(entity_state_t *from, } } +#if _RREXTEND /* Scale with skins if force or different */ if ((protocol == PROTOCOL_VERSION) && ((to->scale[0] != from->scale[0]) || @@ -513,6 +514,7 @@ MSG_WriteDeltaEntity(entity_state_t *from, { bits |= (U_SKIN8 | U_SKIN16); } +#endif if (to->frame != from->frame) { @@ -527,14 +529,14 @@ MSG_WriteDeltaEntity(entity_state_t *from, } } - if ((to->effects != from->effects) || (to->rr_effects != from->rr_effects)) + if (to->effects != from->effects) { - if ((to->effects < 256) && (to->rr_effects < 256)) + if (to->effects < 256) { bits |= U_EFFECTS8; } - else if ((to->effects < 0x8000) && (to->rr_effects < 0x8000)) + else if (to->effects < 0x8000) { bits |= U_EFFECTS16; } @@ -545,6 +547,13 @@ MSG_WriteDeltaEntity(entity_state_t *from, } } +#if _RREXTEND + if (to->rr_effects != from->rr_effects) + { + bits |= U_EFFECTS8 | U_EFFECTS16; + } +#endif + if (to->renderfx != from->renderfx) { if (to->renderfx < 256) @@ -730,6 +739,7 @@ MSG_WriteDeltaEntity(entity_state_t *from, { MSG_WriteLong(msg, to->skinnum); +#if _RREXTEND /* Send scale */ if (protocol == PROTOCOL_VERSION) { @@ -740,6 +750,7 @@ MSG_WriteDeltaEntity(entity_state_t *from, MSG_WriteFloat(msg, to->scale[i]); } } +#endif } else if (bits & U_SKIN8) @@ -767,6 +778,7 @@ MSG_WriteDeltaEntity(entity_state_t *from, MSG_WriteShort(msg, to->effects); } +#if _RREXTEND /* ReRelease effects */ if (protocol == PROTOCOL_VERSION) { @@ -785,6 +797,7 @@ MSG_WriteDeltaEntity(entity_state_t *from, MSG_WriteShort(msg, to->rr_effects); } } +#endif if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16)) { diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 95abdcdf..0aa002ed 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -3306,7 +3306,7 @@ SP_misc_flare(edict_t* ent) /* Radius saved to scale */ for (i = 0; i < 3; i++) { - ent->s.scale[i] = st.radius; + ent->rrs.scale[i] = st.radius; } if (ent->spawnflags & SPAWNFLAG_FLARE_RED) diff --git a/src/game/g_monster.c b/src/game/g_monster.c index cdf90685..ec60c6f3 100644 --- a/src/game/g_monster.c +++ b/src/game/g_monster.c @@ -1136,13 +1136,13 @@ monster_start(edict_t *self) for (i = 0; i < 3; i++) { - if (!self->s.scale[i]) + if (!self->rrs.scale[i]) { /* fix empty scale */ - self->s.scale[i] = 1.0f; + self->rrs.scale[i] = 1.0f; } - scale += self->s.scale[i]; + scale += self->rrs.scale[i]; } scale /= 3; @@ -1158,8 +1158,8 @@ monster_start(edict_t *self) for (i = 0; i < 3; i++) { - self->mins[i] *= self->s.scale[i]; - self->maxs[i] *= self->s.scale[i]; + self->mins[i] *= self->rrs.scale[i]; + self->maxs[i] *= self->rrs.scale[i]; } } diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index 9aa1de3e..8a1a7899 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -89,7 +89,7 @@ DynamicSpawnSetScale(edict_t *self) } /* Copy to entity scale field */ - VectorCopy(st.scale, self->s.scale); + VectorCopy(st.scale, self->rrs.scale); } static void @@ -142,7 +142,7 @@ DynamicSpawnUpdate(edict_t *self, dynamicentity_t *data) } else { - VectorCopy(data->scale, self->s.scale); + VectorCopy(data->scale, self->rrs.scale); } } @@ -344,7 +344,7 @@ ED_CallSpawn(edict_t *ent) } else { - VectorSet(ent->s.scale, 1.0, 1.0, 1.0); + VectorSet(ent->rrs.scale, 1.0, 1.0, 1.0); } } diff --git a/src/game/header/game.h b/src/game/header/game.h index 7dac50dc..dcfb2395 100644 --- a/src/game/header/game.h +++ b/src/game/header/game.h @@ -101,6 +101,8 @@ struct edict_s int clipmask; edict_t *owner; + /* Additional state from ReRelease */ + entity_rrstate_t rrs; /* the game dll can add anything it wants after this point in the structure */ }; diff --git a/src/game/header/local.h b/src/game/header/local.h index ffc97ce5..1a1b8399 100644 --- a/src/game/header/local.h +++ b/src/game/header/local.h @@ -1351,6 +1351,9 @@ struct edict_s int clipmask; edict_t *owner; + /* Additional state from ReRelease */ + entity_rrstate_t rrs; + /* DO NOT MODIFY ANYTHING ABOVE THIS, THE SERVER */ /* EXPECTS THE FIELDS IN THAT ORDER! */ diff --git a/src/game/player/view.c b/src/game/player/view.c index 05675b7a..a554375a 100644 --- a/src/game/player/view.c +++ b/src/game/player/view.c @@ -1114,7 +1114,7 @@ G_SetClientEffects(edict_t *ent) } ent->s.effects = 0; - ent->s.rr_effects = 0; + ent->rrs.effects = 0; /* player is always ir visible, even dead. */ ent->s.renderfx = RF_IR_VISIBLE; @@ -1126,7 +1126,7 @@ G_SetClientEffects(edict_t *ent) if (ent->flags & FL_FLASHLIGHT) { - ent->s.rr_effects |= EF_FLASHLIGHT; + ent->rrs.effects |= EF_FLASHLIGHT; } if (ent->flags & FL_DISGUISED)