try to fix a crash or two.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4664 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6e9f1eb0c6
commit
bacf9e90ba
8 changed files with 15 additions and 11 deletions
|
@ -1369,7 +1369,7 @@ static qbyte *R_MarkLeafSurfaces_Q1 (void)
|
||||||
|
|
||||||
vis = R_CalcVis_Q1();
|
vis = R_CalcVis_Q1();
|
||||||
|
|
||||||
for (i=0 ; i<cl.worldmodel->numleafs ; i++)
|
for (i=0 ; i<cl.worldmodel->numvisleafs ; i++)
|
||||||
{
|
{
|
||||||
if (vis[i>>3] & (1<<(i&7)))
|
if (vis[i>>3] & (1<<(i&7)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -2030,7 +2030,7 @@ qbyte *R_CalcVis_Q1 (void)
|
||||||
int c;
|
int c;
|
||||||
Q1BSP_LeafPVS (cl.worldmodel, r_viewleaf2, curframevis, sizeof(curframevis));
|
Q1BSP_LeafPVS (cl.worldmodel, r_viewleaf2, curframevis, sizeof(curframevis));
|
||||||
vis = Q1BSP_LeafPVS (cl.worldmodel, r_viewleaf, NULL, sizeof(curframevis));
|
vis = Q1BSP_LeafPVS (cl.worldmodel, r_viewleaf, NULL, sizeof(curframevis));
|
||||||
c = (cl.worldmodel->numleafs+31)/32;
|
c = (cl.worldmodel->numvisleafs+31)/32;
|
||||||
for (i=0 ; i<c ; i++)
|
for (i=0 ; i<c ; i++)
|
||||||
((int *)curframevis)[i] |= ((int *)vis)[i];
|
((int *)curframevis)[i] |= ((int *)vis)[i];
|
||||||
vis = curframevis;
|
vis = curframevis;
|
||||||
|
@ -2080,7 +2080,7 @@ qbyte *R_MarkLeaves_Q1 (void)
|
||||||
if (r_novis.ival)
|
if (r_novis.ival)
|
||||||
{
|
{
|
||||||
vis = cvis[portal] = fatvis[portal];
|
vis = cvis[portal] = fatvis[portal];
|
||||||
memset (fatvis[portal], 0xff, (cl.worldmodel->numleafs+7)>>3);
|
memset (fatvis[portal], 0xff, (cl.worldmodel->numvisleafs+7)>>3);
|
||||||
|
|
||||||
r_oldviewleaf = NULL;
|
r_oldviewleaf = NULL;
|
||||||
r_oldviewleaf2 = NULL;
|
r_oldviewleaf2 = NULL;
|
||||||
|
@ -2090,7 +2090,7 @@ qbyte *R_MarkLeaves_Q1 (void)
|
||||||
int c;
|
int c;
|
||||||
Q1BSP_LeafPVS (cl.worldmodel, r_viewleaf2, fatvis[portal], sizeof(fatvis[portal]));
|
Q1BSP_LeafPVS (cl.worldmodel, r_viewleaf2, fatvis[portal], sizeof(fatvis[portal]));
|
||||||
vis = cvis[portal] = Q1BSP_LeafPVS (cl.worldmodel, r_viewleaf, NULL, 0);
|
vis = cvis[portal] = Q1BSP_LeafPVS (cl.worldmodel, r_viewleaf, NULL, 0);
|
||||||
c = (cl.worldmodel->numleafs+31)/32;
|
c = (cl.worldmodel->numvisleafs+31)/32;
|
||||||
for (i=0 ; i<c ; i++)
|
for (i=0 ; i<c ; i++)
|
||||||
((int *)fatvis[portal])[i] |= ((int *)vis)[i];
|
((int *)fatvis[portal])[i] |= ((int *)vis)[i];
|
||||||
|
|
||||||
|
@ -2104,7 +2104,7 @@ qbyte *R_MarkLeaves_Q1 (void)
|
||||||
|
|
||||||
r_visframecount++;
|
r_visframecount++;
|
||||||
|
|
||||||
for (i=0 ; i<cl.worldmodel->numleafs ; i++)
|
for (i=0 ; i<cl.worldmodel->numvisleafs ; i++)
|
||||||
{
|
{
|
||||||
if (vis[i>>3] & (1<<(i&7)))
|
if (vis[i>>3] & (1<<(i&7)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1662,7 +1662,7 @@ qbyte *Q1BSP_DecompressVis (qbyte *in, model_t *model, qbyte *decompressed, unsi
|
||||||
qbyte *out;
|
qbyte *out;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
row = (model->numleafs+7)>>3;
|
row = (model->numvisleafs+7)>>3;
|
||||||
out = decompressed;
|
out = decompressed;
|
||||||
|
|
||||||
if (buffersize < row)
|
if (buffersize < row)
|
||||||
|
|
|
@ -3337,6 +3337,7 @@ qboolean Mod_LoadLeafs (lump_t *l, int lm)
|
||||||
|
|
||||||
loadmodel->leafs = out;
|
loadmodel->leafs = out;
|
||||||
loadmodel->numleafs = count;
|
loadmodel->numleafs = count;
|
||||||
|
loadmodel->numvisleafs = count-1;
|
||||||
|
|
||||||
for ( i=0 ; i<count ; i++, in++, out++)
|
for ( i=0 ; i<count ; i++, in++, out++)
|
||||||
{
|
{
|
||||||
|
@ -3399,6 +3400,7 @@ qboolean Mod_LoadLeafs (lump_t *l, int lm)
|
||||||
|
|
||||||
loadmodel->leafs = out;
|
loadmodel->leafs = out;
|
||||||
loadmodel->numleafs = count;
|
loadmodel->numleafs = count;
|
||||||
|
loadmodel->numvisleafs = count-1;
|
||||||
|
|
||||||
for ( i=0 ; i<count ; i++, in++, out++)
|
for ( i=0 ; i<count ; i++, in++, out++)
|
||||||
{
|
{
|
||||||
|
@ -3461,6 +3463,7 @@ qboolean Mod_LoadLeafs (lump_t *l, int lm)
|
||||||
|
|
||||||
loadmodel->leafs = out;
|
loadmodel->leafs = out;
|
||||||
loadmodel->numleafs = count;
|
loadmodel->numleafs = count;
|
||||||
|
loadmodel->numvisleafs = count-1;
|
||||||
|
|
||||||
for ( i=0 ; i<count ; i++, in++, out++)
|
for ( i=0 ; i<count ; i++, in++, out++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -881,7 +881,7 @@ void GLR_DrawPortal(batch_t *batch, batch_t **blist, batch_t *depthmasklist[2],
|
||||||
int lnum, i, j;
|
int lnum, i, j;
|
||||||
float d;
|
float d;
|
||||||
vec3_t point;
|
vec3_t point;
|
||||||
int pvsbytes = (cl.worldmodel->numleafs+7)>>3;
|
int pvsbytes = (cl.worldmodel->numvisleafs+7)>>3;
|
||||||
if (pvsbytes > sizeof(newvis))
|
if (pvsbytes > sizeof(newvis))
|
||||||
pvsbytes = sizeof(newvis);
|
pvsbytes = sizeof(newvis);
|
||||||
r_refdef.forcevis = true;
|
r_refdef.forcevis = true;
|
||||||
|
|
|
@ -90,7 +90,7 @@ static void pp_flush(multicast_t to, vec3_t origin, void (*flushfunc)(client_t *
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
leafnum = sv.world.worldmodel->funcs.LeafnumForPoint(sv.world.worldmodel, origin);
|
leafnum = sv.world.worldmodel->funcs.LeafnumForPoint(sv.world.worldmodel, origin);
|
||||||
mask = sv.phs + leafnum * 4*((sv.world.worldmodel->numleafs+31)>>5);
|
mask = sv.phs + leafnum * 4*((sv.world.worldmodel->numvisleafs+31)>>5);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ static void pp_flush(multicast_t to, vec3_t origin, void (*flushfunc)(client_t *
|
||||||
reliable = true; // intentional fallthrough
|
reliable = true; // intentional fallthrough
|
||||||
case MULTICAST_PVS:
|
case MULTICAST_PVS:
|
||||||
leafnum = sv.world.worldmodel->funcs.LeafnumForPoint(sv.world.worldmodel, origin);
|
leafnum = sv.world.worldmodel->funcs.LeafnumForPoint(sv.world.worldmodel, origin);
|
||||||
mask = sv.pvs + leafnum * 4*((sv.world.worldmodel->numleafs+31)>>5);
|
mask = sv.pvs + leafnum * 4*((sv.world.worldmodel->numvisleafs+31)>>5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -3221,7 +3221,7 @@ void SV_Snapshot_BuildQ1(client_t *client, packet_entities_t *pack, pvscamera_t
|
||||||
if (sv.phs)
|
if (sv.phs)
|
||||||
{
|
{
|
||||||
leafnum = sv.world.worldmodel->funcs.LeafnumForPoint(sv.world.worldmodel, host_client->edict->v->origin);
|
leafnum = sv.world.worldmodel->funcs.LeafnumForPoint(sv.world.worldmodel, host_client->edict->v->origin);
|
||||||
mask = sv.phs + leafnum * 4*((sv.world.worldmodel->numleafs+31)>>5);
|
mask = sv.phs + leafnum * 4*((sv.world.worldmodel->numvisleafs+31)>>5);
|
||||||
|
|
||||||
leafnum = sv.world.worldmodel->funcs.LeafnumForPoint (sv.world.worldmodel, ent->v->origin)-1;
|
leafnum = sv.world.worldmodel->funcs.LeafnumForPoint (sv.world.worldmodel, ent->v->origin)-1;
|
||||||
if ( !(mask[leafnum>>3] & (1<<(leafnum&7)) ) )
|
if ( !(mask[leafnum>>3] & (1<<(leafnum&7)) ) )
|
||||||
|
|
|
@ -284,7 +284,7 @@ qbyte *Mod_DecompressVis (qbyte *in, model_t *model, qbyte *decompressed)
|
||||||
qbyte *out;
|
qbyte *out;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
row = (model->numleafs+7)>>3;
|
row = (model->numvisleafs+7)>>3;
|
||||||
out = decompressed;
|
out = decompressed;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -1379,6 +1379,7 @@ qboolean Mod_LoadLeafs (lump_t *l, qboolean lm)
|
||||||
|
|
||||||
loadmodel->leafs = out;
|
loadmodel->leafs = out;
|
||||||
loadmodel->numleafs = count;
|
loadmodel->numleafs = count;
|
||||||
|
loadmodel->numvisleafs = count-1;
|
||||||
|
|
||||||
for ( i=0 ; i<count ; i++, in++, out++)
|
for ( i=0 ; i<count ; i++, in++, out++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue