Source/ThunderBeast/QuakeToonProto1/client/cl_ents.c
void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int number, int bits)
{
	// set everything to the state we are delta'ing from
	*to = *from;

	VectorCopy (from->origin, to->old_origin);
	to->number = number;

	if (bits & U_MODEL)
		to->modelindex = MSG_ReadByte (&net_message);
	if (bits & U_MODEL2)
		to->modelindex2 = MSG_ReadByte (&net_message);
	if (bits & U_MODEL3)
		to->modelindex3 = MSG_ReadByte (&net_message);
	if (bits & U_MODEL4)
		to->modelindex4 = MSG_ReadByte (&net_message);
		
	if (bits & U_FRAME8)
		to->frame = MSG_ReadByte (&net_message);
	if (bits & U_FRAME16)
		to->frame = MSG_ReadShort (&net_message);

	if ((bits & U_SKIN8) && (bits & U_SKIN16))		//used for laser colors
		to->skinnum = MSG_ReadLong(&net_message);
	else if (bits & U_SKIN8)
		to->skinnum = MSG_ReadByte(&net_message);
	else if (bits & U_SKIN16)
		to->skinnum = MSG_ReadShort(&net_message);

	if ( (bits & (U_EFFECTS8|U_EFFECTS16)) == (U_EFFECTS8|U_EFFECTS16) )
		to->effects = MSG_ReadLong(&net_message);
	else if (bits & U_EFFECTS8)
		to->effects = MSG_ReadByte(&net_message);
	else if (bits & U_EFFECTS16)
		to->effects = MSG_ReadShort(&net_message);

	if ( (bits & (U_RENDERFX8|U_RENDERFX16)) == (U_RENDERFX8|U_RENDERFX16) )
		to->renderfx = MSG_ReadLong(&net_message);
	else if (bits & U_RENDERFX8)
		to->renderfx = MSG_ReadByte(&net_message);
	else if (bits & U_RENDERFX16)
		to->renderfx = MSG_ReadShort(&net_message);

	if (bits & U_ORIGIN1)
		to->origin[0] = MSG_ReadCoord (&net_message);
	if (bits & U_ORIGIN2)
		to->origin[1] = MSG_ReadCoord (&net_message);
	if (bits & U_ORIGIN3)
		to->origin[2] = MSG_ReadCoord (&net_message);
		
	if (bits & U_ANGLE1)
		to->angles[0] = MSG_ReadAngle(&net_message);
	if (bits & U_ANGLE2)
		to->angles[1] = MSG_ReadAngle(&net_message);
	if (bits & U_ANGLE3)
		to->angles[2] = MSG_ReadAngle(&net_message);

	if (bits & U_OLDORIGIN)
		MSG_ReadPos (&net_message, to->old_origin);

	if (bits & U_SOUND)
		to->sound = MSG_ReadByte (&net_message);

	if (bits & U_EVENT)
		to->event = MSG_ReadByte (&net_message);
	else
		to->event = 0;

	if (bits & U_SOLID)
		to->solid = MSG_ReadShort (&net_message);
}
/*
==================
CL_ParseDelta

Can go from either a baseline or a previous packet_entity
==================
*/
CL_ParseDelta
Can go from either a baseline or a previous packet_entity
CL_ParseDelta Can go from either a baseline or a previous packet_entity
void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int number, int bits)
{
	*to = *from;
	VectorCopy (from->origin, to->old_origin);
	to->number = number;
	if (bits & U_MODEL)
		to->modelindex = MSG_ReadByte (&net_message);
	if (bits & U_MODEL2)
		to->modelindex2 = MSG_ReadByte (&net_message);
	if (bits & U_MODEL3)
		to->modelindex3 = MSG_ReadByte (&net_message);
	if (bits & U_MODEL4)
		to->modelindex4 = MSG_ReadByte (&net_message);
	if (bits & U_FRAME8)
		to->frame = MSG_ReadByte (&net_message);
	if (bits & U_FRAME16)
		to->frame = MSG_ReadShort (&net_message);
	if ((bits & U_SKIN8) && (bits & U_SKIN16))		
		to->skinnum = MSG_ReadLong(&net_message);
	else if (bits & U_SKIN8)
		to->skinnum = MSG_ReadByte(&net_message);
	else if (bits & U_SKIN16)
		to->skinnum = MSG_ReadShort(&net_message);
	if ( (bits & (U_EFFECTS8|U_EFFECTS16)) == (U_EFFECTS8|U_EFFECTS16) )
		to->effects = MSG_ReadLong(&net_message);
	else if (bits & U_EFFECTS8)
		to->effects = MSG_ReadByte(&net_message);
	else if (bits & U_EFFECTS16)
		to->effects = MSG_ReadShort(&net_message);
	if ( (bits & (U_RENDERFX8|U_RENDERFX16)) == (U_RENDERFX8|U_RENDERFX16) )
		to->renderfx = MSG_ReadLong(&net_message);
	else if (bits & U_RENDERFX8)
		to->renderfx = MSG_ReadByte(&net_message);
	else if (bits & U_RENDERFX16)
		to->renderfx = MSG_ReadShort(&net_message);
	if (bits & U_ORIGIN1)
		to->origin[0] = MSG_ReadCoord (&net_message);
	if (bits & U_ORIGIN2)
		to->origin[1] = MSG_ReadCoord (&net_message);
	if (bits & U_ORIGIN3)
		to->origin[2] = MSG_ReadCoord (&net_message);
	if (bits & U_ANGLE1)
		to->angles[0] = MSG_ReadAngle(&net_message);
	if (bits & U_ANGLE2)
		to->angles[1] = MSG_ReadAngle(&net_message);
	if (bits & U_ANGLE3)
		to->angles[2] = MSG_ReadAngle(&net_message);
	if (bits & U_OLDORIGIN)
		MSG_ReadPos (&net_message, to->old_origin);
	if (bits & U_SOUND)
		to->sound = MSG_ReadByte (&net_message);
	if (bits & U_EVENT)
		to->event = MSG_ReadByte (&net_message);
	else
		to->event = 0;
	if (bits & U_SOLID)
		to->solid = MSG_ReadShort (&net_message);
}
void CL_ParseDelta ( entity_state_t * from , entity_state_t * to , int number , int bits ) { * to = * from ; VectorCopy ( from -> origin , to -> old_origin ) ; to -> number = number ; if ( bits & U_MODEL ) to -> modelindex = MSG_ReadByte ( & net_message ) ; if ( bits & U_MODEL2 ) to -> modelindex2 = MSG_ReadByte ( & net_message ) ; if ( bits & U_MODEL3 ) to -> modelindex3 = MSG_ReadByte ( & net_message ) ; if ( bits & U_MODEL4 ) to -> modelindex4 = MSG_ReadByte ( & net_message ) ; if ( bits & U_FRAME8 ) to -> frame = MSG_ReadByte ( & net_message ) ; if ( bits & U_FRAME16 ) to -> frame = MSG_ReadShort ( & net_message ) ; if ( ( bits & U_SKIN8 ) && ( bits & U_SKIN16 ) ) to -> skinnum = MSG_ReadLong ( & net_message ) ; else if ( bits & U_SKIN8 ) to -> skinnum = MSG_ReadByte ( & net_message ) ; else if ( bits & U_SKIN16 ) to -> skinnum = MSG_ReadShort ( & net_message ) ; if ( ( bits & ( U_EFFECTS8 | U_EFFECTS16 ) ) == ( U_EFFECTS8 | U_EFFECTS16 ) ) to -> effects = MSG_ReadLong ( & net_message ) ; else if ( bits & U_EFFECTS8 ) to -> effects = MSG_ReadByte ( & net_message ) ; else if ( bits & U_EFFECTS16 ) to -> effects = MSG_ReadShort ( & net_message ) ; if ( ( bits & ( U_RENDERFX8 | U_RENDERFX16 ) ) == ( U_RENDERFX8 | U_RENDERFX16 ) ) to -> renderfx = MSG_ReadLong ( & net_message ) ; else if ( bits & U_RENDERFX8 ) to -> renderfx = MSG_ReadByte ( & net_message ) ; else if ( bits & U_RENDERFX16 ) to -> renderfx = MSG_ReadShort ( & net_message ) ; if ( bits & U_ORIGIN1 ) to -> origin [ 0 ] = MSG_ReadCoord ( & net_message ) ; if ( bits & U_ORIGIN2 ) to -> origin [ 1 ] = MSG_ReadCoord ( & net_message ) ; if ( bits & U_ORIGIN3 ) to -> origin [ 2 ] = MSG_ReadCoord ( & net_message ) ; if ( bits & U_ANGLE1 ) to -> angles [ 0 ] = MSG_ReadAngle ( & net_message ) ; if ( bits & U_ANGLE2 ) to -> angles [ 1 ] = MSG_ReadAngle ( & net_message ) ; if ( bits & U_ANGLE3 ) to -> angles [ 2 ] = MSG_ReadAngle ( & net_message ) ; if ( bits & U_OLDORIGIN ) MSG_ReadPos ( & net_message , to -> old_origin ) ; if ( bits & U_SOUND ) to -> sound = MSG_ReadByte ( & net_message ) ; if ( bits & U_EVENT ) to -> event = MSG_ReadByte ( & net_message ) ; else to -> event = 0 ; if ( bits & U_SOLID ) to -> solid = MSG_ReadShort ( & net_message ) ; }
CL_ParseDelta
Can go from either a baseline or a previous packet_entity
CL_ParseDelta Can go from either a baseline or a previous packet_entity
// set everything to the state we are delta'ing from //used for laser colors