Track areas properly, so we don't bug out when a client has multiple cameras in different areas.
Fix up r_ignoreentpvs 0 to check areas properly. checkpvs builtin can no longer mess up area checks elsewhere. Write out foo.db files for release builds, in the hopes of at least getting function names from release-build crashes. Implement _skyroom worldspawn field, still needs a few tweaks though. Try to fix android surface-related crashes, AGAIN. Separate parsing of connect requests, in preparation for formal logins (and removal of the old ranking code). A few tweaks to try to improve compatibility with q3 mods. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5484 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6c7220324e
commit
8197e0875f
64 changed files with 1336 additions and 959 deletions
|
@ -33,6 +33,7 @@ typedef struct
|
|||
int numents;
|
||||
edict_t *ent[SV_PVS_CAMERAS]; //ents in this list are always sent, even if the server thinks that they are invisible.
|
||||
vec3_t org[SV_PVS_CAMERAS];
|
||||
int area[1+SV_PVS_CAMERAS];
|
||||
|
||||
pvsbuffer_t pvs;
|
||||
} pvscamera_t;
|
||||
|
@ -2695,7 +2696,7 @@ void SV_WritePlayersToClient (client_t *client, client_frame_t *frame, edict_t *
|
|||
continue;
|
||||
|
||||
// ignore if not touching a PV leaf
|
||||
if (cameras && !sv.world.worldmodel->funcs.EdictInFatPVS(sv.world.worldmodel, &ent->pvsinfo, cameras->pvs.buffer))
|
||||
if (cameras && !sv.world.worldmodel->funcs.EdictInFatPVS(sv.world.worldmodel, &ent->pvsinfo, cameras->pvs.buffer, &cameras->numents))
|
||||
continue;
|
||||
|
||||
if (!((int)clent->xv->dimension_see & ((int)ent->xv->dimension_seen | (int)ent->xv->dimension_ghost)))
|
||||
|
@ -3690,13 +3691,13 @@ void SV_Snapshot_BuildQ1(client_t *client, packet_entities_t *pack, pvscamera_t
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!sv.world.worldmodel->funcs.EdictInFatPVS(sv.world.worldmodel, &((wedict_t*)tracecullent)->pvsinfo, cameras->pvs.buffer))
|
||||
if (!sv.world.worldmodel->funcs.EdictInFatPVS(sv.world.worldmodel, &((wedict_t*)tracecullent)->pvsinfo, cameras->pvs.buffer, cameras->area))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sv.world.worldmodel->funcs.EdictInFatPVS(sv.world.worldmodel, &((wedict_t*)ent)->pvsinfo, cameras->pvs.buffer))
|
||||
if (!sv.world.worldmodel->funcs.EdictInFatPVS(sv.world.worldmodel, &((wedict_t*)ent)->pvsinfo, cameras->pvs.buffer, cameras->area))
|
||||
continue;
|
||||
tracecullent = ent;
|
||||
}
|
||||
|
@ -3710,14 +3711,14 @@ void SV_Snapshot_BuildQ1(client_t *client, packet_entities_t *pack, pvscamera_t
|
|||
{
|
||||
//FIXME: this lookup should be cachable or something.
|
||||
if (client->edict)
|
||||
cluster = sv.world.worldmodel->funcs.ClusterForPoint(sv.world.worldmodel, client->edict->v->origin);
|
||||
cluster = sv.world.worldmodel->funcs.ClusterForPoint(sv.world.worldmodel, client->edict->v->origin, NULL); //ignore areas, can hear through doors.
|
||||
else
|
||||
cluster = -1; //mvd
|
||||
if (cluster >= 0)
|
||||
{
|
||||
mask = phs + cluster * 4*((sv.world.worldmodel->numclusters+31)>>5);
|
||||
|
||||
cluster = sv.world.worldmodel->funcs.ClusterForPoint (sv.world.worldmodel, ent->v->origin);
|
||||
cluster = sv.world.worldmodel->funcs.ClusterForPoint (sv.world.worldmodel, ent->v->origin, NULL);
|
||||
if (cluster >= 0 && !(mask[cluster>>3] & (1<<(cluster&7)) ) )
|
||||
{
|
||||
continue;
|
||||
|
@ -3859,6 +3860,7 @@ void SV_AddCameraEntity(pvscamera_t *cameras, edict_t *ent, vec3_t viewofs)
|
|||
{
|
||||
int i;
|
||||
vec3_t org;
|
||||
int area;
|
||||
|
||||
for (i = 0; i < cameras->numents; i++)
|
||||
{
|
||||
|
@ -3871,6 +3873,17 @@ void SV_AddCameraEntity(pvscamera_t *cameras, edict_t *ent, vec3_t viewofs)
|
|||
else
|
||||
VectorCopy (ent->v->origin, org);
|
||||
|
||||
sv.world.worldmodel->funcs.ClusterForPoint(sv.world.worldmodel, org, &area);
|
||||
for (i = 1; ; i++)
|
||||
{
|
||||
if (i > cameras->area[0])
|
||||
{ //reached the end of the known count. add it now.
|
||||
cameras->area[++cameras->area[0]] = area;
|
||||
break;
|
||||
}
|
||||
if (cameras->area[i] == area)
|
||||
break; //already have a camera in this area, don't make stuff slow with dupes.
|
||||
}
|
||||
sv.world.worldmodel->funcs.FatPVS(sv.world.worldmodel, org, &cameras->pvs, cameras->numents!=0);
|
||||
if (cameras->numents < SV_PVS_CAMERAS)
|
||||
{
|
||||
|
@ -3882,6 +3895,7 @@ void SV_AddCameraEntity(pvscamera_t *cameras, edict_t *ent, vec3_t viewofs)
|
|||
|
||||
void SV_Snapshot_SetupPVS(client_t *client, pvscamera_t *camera)
|
||||
{
|
||||
camera->area[0] = 0;
|
||||
camera->numents = 0;
|
||||
for (; client; client = client->controlled)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue