mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 10:21:21 +00:00
- convert svc_spawnbaseline and svc_spawnstatic
Only notable ones left now are packetentities and deltapackentities :)
This commit is contained in:
parent
f779a03254
commit
d69c8013aa
3 changed files with 85 additions and 19 deletions
|
@ -69,6 +69,27 @@ typedef struct net_svc_sound_s
|
|||
int entity;
|
||||
} net_svc_sound_t;
|
||||
|
||||
typedef struct net_svc_spawnbaseline_s
|
||||
{
|
||||
short num;
|
||||
byte modelindex;
|
||||
byte frame;
|
||||
byte colormap;
|
||||
byte skinnum;
|
||||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
} net_svc_spawnbaseline_t;
|
||||
|
||||
typedef struct net_svc_spawnstatic_s
|
||||
{
|
||||
byte modelindex;
|
||||
byte frame;
|
||||
byte colormap;
|
||||
byte skinnum;
|
||||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
} net_svc_spawnstatic_t;
|
||||
|
||||
typedef struct net_svc_tempentity_s
|
||||
{
|
||||
byte type;
|
||||
|
@ -158,6 +179,9 @@ qboolean NET_SVC_Print_Parse (net_svc_print_t *block, msg_t *msg);
|
|||
qboolean NET_SVC_Damage_Parse (net_svc_damage_t *block, msg_t *msg);
|
||||
qboolean NET_SVC_ServerData_Parse (net_svc_serverdata_t *block, msg_t *msg);
|
||||
qboolean NET_SVC_Sound_Parse (net_svc_sound_t *block, msg_t *msg);
|
||||
qboolean NET_SVC_SpawnBaseline_Parse (net_svc_spawnbaseline_t *block,
|
||||
msg_t *msg);
|
||||
qboolean NET_SVC_SpawnStatic_Parse (net_svc_spawnstatic_t *block, msg_t *msg);
|
||||
qboolean NET_SVC_TempEntity_Parse (net_svc_tempentity_t *block, msg_t *msg);
|
||||
qboolean NET_SVC_SpawnStaticSound_Parse (net_svc_spawnstaticsound_t *block,
|
||||
msg_t *msg);
|
||||
|
|
|
@ -827,18 +827,22 @@ CL_ParseModellist (void)
|
|||
}
|
||||
|
||||
void
|
||||
CL_ParseBaseline (entity_state_t *es)
|
||||
CL_ParseSpawnBaseline ()
|
||||
{
|
||||
int i;
|
||||
entity_state_t *es;
|
||||
net_svc_spawnbaseline_t block;
|
||||
|
||||
NET_SVC_SpawnBaseline_Parse (&block, net_message);
|
||||
|
||||
es = &cl_baselines[block.num];
|
||||
|
||||
es->modelindex = block.modelindex;
|
||||
es->frame = block.frame;
|
||||
es->colormap = block.colormap;
|
||||
es->skinnum = block.skinnum;
|
||||
VectorCopy (block.origin, es->origin);
|
||||
VectorCopy (block.angles, es->angles);
|
||||
|
||||
es->modelindex = MSG_ReadByte (net_message);
|
||||
es->frame = MSG_ReadByte (net_message);
|
||||
es->colormap = MSG_ReadByte (net_message);
|
||||
es->skinnum = MSG_ReadByte (net_message);
|
||||
for (i = 0; i < 3; i++) {
|
||||
es->origin[i] = MSG_ReadCoord (net_message);
|
||||
es->angles[i] = MSG_ReadAngle (net_message);
|
||||
}
|
||||
// LordHavoc: set up the baseline to account for new effects (alpha,
|
||||
// colormod, etc)
|
||||
es->alpha = 255;
|
||||
|
@ -858,9 +862,9 @@ void
|
|||
CL_ParseStatic (void)
|
||||
{
|
||||
entity_t *ent;
|
||||
entity_state_t es;
|
||||
net_svc_spawnstatic_t block;
|
||||
|
||||
CL_ParseBaseline (&es);
|
||||
NET_SVC_SpawnStatic_Parse (&block, net_message);
|
||||
|
||||
if (cl.num_statics >= MAX_STATIC_ENTITIES)
|
||||
Host_EndGame ("Too many static entities");
|
||||
|
@ -868,12 +872,12 @@ CL_ParseStatic (void)
|
|||
CL_Init_Entity (ent);
|
||||
|
||||
// copy it to the current state
|
||||
ent->model = cl.model_precache[es.modelindex];
|
||||
ent->frame = es.frame;
|
||||
ent->skinnum = es.skinnum;
|
||||
ent->model = cl.model_precache[block.modelindex];
|
||||
ent->frame = block.frame;
|
||||
ent->skinnum = block.skinnum;
|
||||
|
||||
VectorCopy (es.origin, ent->origin);
|
||||
VectorCopy (es.angles, ent->angles);
|
||||
VectorCopy (block.origin, ent->origin);
|
||||
VectorCopy (block.angles, ent->angles);
|
||||
|
||||
R_AddEfrags (ent);
|
||||
}
|
||||
|
@ -1233,8 +1237,7 @@ CL_ParseServerMessage (void)
|
|||
break;
|
||||
|
||||
case svc_spawnbaseline:
|
||||
i = MSG_ReadShort (net_message);
|
||||
CL_ParseBaseline (&cl_baselines[i]);
|
||||
CL_ParseSpawnBaseline ();
|
||||
break;
|
||||
case svc_spawnstatic:
|
||||
CL_ParseStatic ();
|
||||
|
|
|
@ -128,6 +128,45 @@ NET_SVC_Sound_Parse (net_svc_sound_t *block, msg_t *msg)
|
|||
return msg->badread;
|
||||
}
|
||||
|
||||
qboolean
|
||||
NET_SVC_SpawnBaseline_Parse (net_svc_spawnbaseline_t *block, msg_t *msg)
|
||||
{
|
||||
int i;
|
||||
|
||||
block->num = MSG_ReadShort (msg);
|
||||
block->modelindex = MSG_ReadByte (msg);
|
||||
block->frame = MSG_ReadByte (msg);
|
||||
block->colormap = MSG_ReadByte (msg);
|
||||
block->skinnum = MSG_ReadByte (msg);
|
||||
|
||||
// these are interlaced? bad drugs...
|
||||
for (i = 0; i < 3; i ++) {
|
||||
block->origin[i] = MSG_ReadCoord (msg);
|
||||
block->angles[i] = MSG_ReadAngle (msg);
|
||||
}
|
||||
|
||||
return msg->badread;
|
||||
}
|
||||
|
||||
qboolean
|
||||
NET_SVC_SpawnStatic_Parse (net_svc_spawnstatic_t *block, msg_t *msg)
|
||||
{
|
||||
int i;
|
||||
|
||||
block->modelindex = MSG_ReadByte (msg);
|
||||
block->frame = MSG_ReadByte (msg);
|
||||
block->colormap = MSG_ReadByte (msg);
|
||||
block->skinnum = MSG_ReadByte (msg);
|
||||
|
||||
// these are interlaced? bad drugs...
|
||||
for (i = 0; i < 3; i ++) {
|
||||
block->origin[i] = MSG_ReadCoord (msg);
|
||||
block->angles[i] = MSG_ReadAngle (msg);
|
||||
}
|
||||
|
||||
return msg->badread;
|
||||
}
|
||||
|
||||
qboolean
|
||||
NET_SVC_TempEntity_Parse (net_svc_tempentity_t *block, msg_t *msg)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue