Skip to content

Commit

Permalink
protocol: restore ReRelease scale
Browse files Browse the repository at this point in the history
  • Loading branch information
0lvin committed Dec 8, 2024
1 parent 032b66b commit baa4d81
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 23 deletions.
8 changes: 0 additions & 8 deletions src/client/cl_entities.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ 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 */
Expand Down Expand Up @@ -212,11 +208,7 @@ 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 */
Expand Down
7 changes: 1 addition & 6 deletions src/client/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ CL_ParseDelta(const entity_xstate_t *from, entity_xstate_t *to, int number, int
VectorCopy(from->origin, to->old_origin);
to->number = number;

#if _RREXTEND
if (cls.serverProtocol != PROTOCOL_VERSION)
{
int i;
Expand All @@ -154,7 +153,6 @@ CL_ParseDelta(const entity_xstate_t *from, entity_xstate_t *to, int number, int
to->scale[i] = 1.0f;
}
}
#endif

if (IS_QII97_PROTOCOL(cls.serverProtocol))
{
Expand Down Expand Up @@ -223,8 +221,8 @@ CL_ParseDelta(const entity_xstate_t *from, entity_xstate_t *to, int number, int
if ((bits & U_SKIN8) && (bits & U_SKIN16))
{
to->skinnum = MSG_ReadLong(&net_message);

/* Additional scale with skinnum */
#if _RREXTEND
if (cls.serverProtocol == PROTOCOL_VERSION)
{
int i;
Expand All @@ -234,7 +232,6 @@ CL_ParseDelta(const entity_xstate_t *from, entity_xstate_t *to, int number, int
to->scale[i] = MSG_ReadFloat(&net_message);
}
}
#endif
}
else if (bits & U_SKIN8)
{
Expand All @@ -259,7 +256,6 @@ CL_ParseDelta(const entity_xstate_t *from, entity_xstate_t *to, int number, int
}

/* ReRelease effects */
#if _RREXTEND
if (cls.serverProtocol != PROTOCOL_VERSION)
{
to->rr_effects = 0;
Expand All @@ -279,7 +275,6 @@ CL_ParseDelta(const entity_xstate_t *from, entity_xstate_t *to, int number, int
to->rr_effects = MSG_ReadShort(&net_message);
}
}
#endif

if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16))
{
Expand Down
2 changes: 1 addition & 1 deletion src/common/header/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ typedef struct entity_xstate_s

/* New protocol fields, sync with entity_rrstate_t */
vec3_t scale; /* model scale */
unsigned int rreffects;
unsigned int rr_effects;
} entity_xstate_t;

/* ============================================== */
Expand Down
8 changes: 0 additions & 8 deletions src/common/movemsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from,
}
}

#if _RREXTEND
/* Scale with skins if force or different */
if ((protocol == PROTOCOL_VERSION) &&
((to->scale[0] != from->scale[0]) ||
Expand All @@ -514,7 +513,6 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from,
{
bits |= (U_SKIN8 | U_SKIN16);
}
#endif

if (to->frame != from->frame)
{
Expand Down Expand Up @@ -547,12 +545,10 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from,
}
}

#if _RREXTEND
if (to->rr_effects != from->rr_effects)
{
bits |= U_EFFECTS8 | U_EFFECTS16;
}
#endif

if (to->renderfx != from->renderfx)
{
Expand Down Expand Up @@ -739,7 +735,6 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from,
{
MSG_WriteLong(msg, to->skinnum);

#if _RREXTEND
/* Send scale */
if (protocol == PROTOCOL_VERSION)
{
Expand All @@ -750,7 +745,6 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from,
MSG_WriteFloat(msg, to->scale[i]);
}
}
#endif
}

else if (bits & U_SKIN8)
Expand Down Expand Up @@ -778,7 +772,6 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from,
MSG_WriteShort(msg, to->effects);
}

#if _RREXTEND
/* ReRelease effects */
if (protocol == PROTOCOL_VERSION)
{
Expand All @@ -797,7 +790,6 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from,
MSG_WriteShort(msg, to->rr_effects);
}
}
#endif

if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16))
{
Expand Down

0 comments on commit baa4d81

Please sign in to comment.