dp_model_t *model;
// list of entities to test for collisions
int numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
if (hitnetworkentity)
*hitnetworkentity = 0;
dp_model_t *model;
// list of entities to test for collisions
int numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
#ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
vec3_t end;
vec_t len = 0;
dp_model_t *model;
// list of entities to test for collisions
int numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
#ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
vec3_t end;
vec_t len = 0;
static void R_InitBloodTextures (unsigned char *particletexturedata)
{
int i, j, k, m;
- unsigned char data[PARTICLETEXTURESIZE][PARTICLETEXTURESIZE][4];
+ unsigned char *data = Mem_Alloc(tempmempool, PARTICLETEXTURESIZE*PARTICLETEXTURESIZE*4);
// blood particles
for (i = 0;i < 8;i++)
{
- memset(&data[0][0][0], 255, sizeof(data));
+ memset(data, 255, sizeof(data));
for (k = 0;k < 24;k++)
- particletextureblotch(&data[0][0][0], PARTICLETEXTURESIZE/16, 96, 0, 0, 160);
- //particletextureclamp(&data[0][0][0], 32, 32, 32, 255, 255, 255);
- particletextureinvert(&data[0][0][0]);
- setuptex(tex_bloodparticle[i], &data[0][0][0], particletexturedata);
+ particletextureblotch(data, PARTICLETEXTURESIZE/16, 96, 0, 0, 160);
+ //particletextureclamp(data, 32, 32, 32, 255, 255, 255);
+ particletextureinvert(data);
+ setuptex(tex_bloodparticle[i], data, particletexturedata);
}
// blood decals
for (i = 0;i < 8;i++)
{
- memset(&data[0][0][0], 255, sizeof(data));
+ memset(data, 255, sizeof(data));
m = 8;
for (j = 1;j < 10;j++)
for (k = min(j, m - 1);k < m;k++)
- particletextureblotch(&data[0][0][0], (float)j*PARTICLETEXTURESIZE/64.0f, 96, 0, 0, 320 - j * 8);
- //particletextureclamp(&data[0][0][0], 32, 32, 32, 255, 255, 255);
- particletextureinvert(&data[0][0][0]);
- setuptex(tex_blooddecal[i], &data[0][0][0], particletexturedata);
+ particletextureblotch(data, (float)j*PARTICLETEXTURESIZE/64.0f, 96, 0, 0, 320 - j * 8);
+ //particletextureclamp(data, 32, 32, 32, 255, 255, 255);
+ particletextureinvert(data);
+ setuptex(tex_blooddecal[i], data, particletexturedata);
}
+ Mem_Free(data);
}
//uncomment this to make engine save out particle font to a tga file when run
#endif
{
unsigned char *particletexturedata = (unsigned char *)Mem_Alloc(tempmempool, PARTICLEFONTSIZE*PARTICLEFONTSIZE*4);
- unsigned char data[PARTICLETEXTURESIZE][PARTICLETEXTURESIZE][4];
+ unsigned char *data = (unsigned char *)Mem_Alloc(tempmempool, PARTICLETEXTURESIZE*PARTICLETEXTURESIZE*4);
+ unsigned char *noise1 = (unsigned char *)Mem_Alloc(tempmempool, PARTICLETEXTURESIZE*2*PARTICLETEXTURESIZE*2);
+ unsigned char *noise2 = (unsigned char *)Mem_Alloc(tempmempool, PARTICLETEXTURESIZE*2*PARTICLETEXTURESIZE*2);
particlefontwidth = particlefontheight = PARTICLEFONTSIZE;
particlefontcellwidth = particlefontcellheight = PARTICLETEXTURESIZE;
// smoke
for (i = 0;i < 8;i++)
{
- memset(&data[0][0][0], 255, sizeof(data));
+ memset(data, 255, sizeof(data));
do
{
- unsigned char noise1[PARTICLETEXTURESIZE*2][PARTICLETEXTURESIZE*2], noise2[PARTICLETEXTURESIZE*2][PARTICLETEXTURESIZE*2];
-
- fractalnoise(&noise1[0][0], PARTICLETEXTURESIZE*2, PARTICLETEXTURESIZE/8);
- fractalnoise(&noise2[0][0], PARTICLETEXTURESIZE*2, PARTICLETEXTURESIZE/4);
+ fractalnoise(noise1, PARTICLETEXTURESIZE*2, PARTICLETEXTURESIZE/8);
+ fractalnoise(noise2, PARTICLETEXTURESIZE*2, PARTICLETEXTURESIZE/4);
m = 0;
for (y = 0;y < PARTICLETEXTURESIZE;y++)
{
for (x = 0;x < PARTICLETEXTURESIZE;x++)
{
dx = (x - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
- d = (noise2[y][x] - 128) * 3 + 192;
+ d = (noise2[y*PARTICLETEXTURESIZE*2+x] - 128) * 3 + 192;
if (d > 0)
d = (int)(d * (1-(dx*dx+dy*dy)));
- d = (d * noise1[y][x]) >> 7;
+ d = (d * noise1[y*PARTICLETEXTURESIZE*2+x]) >> 7;
d = bound(0, d, 255);
- data[y][x][3] = (unsigned char) d;
+ data[(y*PARTICLETEXTURESIZE+x)*4+3] = (unsigned char) d;
if (m < d)
m = d;
}
}
}
while (m < 224);
- setuptex(tex_smoke[i], &data[0][0][0], particletexturedata);
+ setuptex(tex_smoke[i], data, particletexturedata);
}
// rain splash
- memset(&data[0][0][0], 255, sizeof(data));
+ memset(data, 255, sizeof(data));
for (y = 0;y < PARTICLETEXTURESIZE;y++)
{
dy = (y - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
{
dx = (x - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
f = 255.0f * (1.0 - 4.0f * fabs(10.0f - sqrt(dx*dx+dy*dy)));
- data[y][x][3] = (int) (bound(0.0f, f, 255.0f));
+ data[(y*PARTICLETEXTURESIZE+x)*4+3] = (int) (bound(0.0f, f, 255.0f));
}
}
- setuptex(tex_rainsplash, &data[0][0][0], particletexturedata);
+ setuptex(tex_rainsplash, data, particletexturedata);
// normal particle
- memset(&data[0][0][0], 255, sizeof(data));
+ memset(data, 255, sizeof(data));
for (y = 0;y < PARTICLETEXTURESIZE;y++)
{
dy = (y - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
dx = (x - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
d = (int)(256 * (1 - (dx*dx+dy*dy)));
d = bound(0, d, 255);
- data[y][x][3] = (unsigned char) d;
+ data[(y*PARTICLETEXTURESIZE+x)*4+3] = (unsigned char) d;
}
}
- setuptex(tex_particle, &data[0][0][0], particletexturedata);
+ setuptex(tex_particle, data, particletexturedata);
// rain
- memset(&data[0][0][0], 255, sizeof(data));
+ memset(data, 255, sizeof(data));
light[0] = 1;light[1] = 1;light[2] = 1;
VectorNormalize(light);
for (y = 0;y < PARTICLETEXTURESIZE;y++)
dx = (x - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
// shrink bubble width to half
dx *= 2.0f;
- data[y][x][3] = shadebubble(dx, dy, light);
+ data[(y*PARTICLETEXTURESIZE+x)*4+3] = shadebubble(dx, dy, light);
}
}
- setuptex(tex_raindrop, &data[0][0][0], particletexturedata);
+ setuptex(tex_raindrop, data, particletexturedata);
// bubble
- memset(&data[0][0][0], 255, sizeof(data));
+ memset(data, 255, sizeof(data));
light[0] = 1;light[1] = 1;light[2] = 1;
VectorNormalize(light);
for (y = 0;y < PARTICLETEXTURESIZE;y++)
for (x = 0;x < PARTICLETEXTURESIZE;x++)
{
dx = (x - 0.5f*PARTICLETEXTURESIZE) / (PARTICLETEXTURESIZE*0.5f-1);
- data[y][x][3] = shadebubble(dx, dy, light);
+ data[(y*PARTICLETEXTURESIZE+x)*4+3] = shadebubble(dx, dy, light);
}
}
- setuptex(tex_bubble, &data[0][0][0], particletexturedata);
+ setuptex(tex_bubble, data, particletexturedata);
// Blood particles and blood decals
R_InitBloodTextures (particletexturedata);
// bullet decals
for (i = 0;i < 8;i++)
{
- memset(&data[0][0][0], 255, sizeof(data));
+ memset(data, 255, sizeof(data));
for (k = 0;k < 12;k++)
- particletextureblotch(&data[0][0][0], PARTICLETEXTURESIZE/16, 0, 0, 0, 128);
+ particletextureblotch(data, PARTICLETEXTURESIZE/16, 0, 0, 0, 128);
for (k = 0;k < 3;k++)
- particletextureblotch(&data[0][0][0], PARTICLETEXTURESIZE/2, 0, 0, 0, 160);
- //particletextureclamp(&data[0][0][0], 64, 64, 64, 255, 255, 255);
- particletextureinvert(&data[0][0][0]);
- setuptex(tex_bulletdecal[i], &data[0][0][0], particletexturedata);
+ particletextureblotch(data, PARTICLETEXTURESIZE/2, 0, 0, 0, 160);
+ //particletextureclamp(data, 64, 64, 64, 255, 255, 255);
+ particletextureinvert(data);
+ setuptex(tex_bulletdecal[i], data, particletexturedata);
}
#ifdef DUMPPARTICLEFONT
particlefonttexture = decalskinframe->base;
Mem_Free(particletexturedata);
+ Mem_Free(data);
+ Mem_Free(noise1);
+ Mem_Free(noise2);
}
for (i = 0;i < MAX_PARTICLETEXTURES;i++)
{
#define BATCHSIZE 256
unsigned short particle_elements[BATCHSIZE*6];
+float particle_vertex3f[BATCHSIZE*12], particle_texcoord2f[BATCHSIZE*8], particle_color4f[BATCHSIZE*16];
void R_Particles_Init (void)
{
float up2[3], v[3], right[3], up[3], fog, ifog, size, len, lenfactor;
float ambient[3], diffuse[3], diffusenormal[3];
vec4_t colormultiplier;
- float particle_vertex3f[BATCHSIZE*12], particle_texcoord2f[BATCHSIZE*8], particle_color4f[BATCHSIZE*16];
RSurf_ActiveWorldEntity();
vec_t radius, radius2;
vec3_t org, eorg, mins, maxs;
int i, numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
int chainfield;
VM_SAFEPARMCOUNTRANGE(2, 3, VM_CL_findradius);
static rtexture_t *draw_generateconchars(void)
{
int i;
- unsigned char buffer[65536][4], *data = NULL;
+ unsigned char *data;
double random;
+ rtexture_t *tex;
data = LoadTGA_BGRA (concharimage, FONT_FILESIZE);
// Gold numbers
for (i = 0;i < 8192;i++)
{
random = lhrandom (0.0,1.0);
- buffer[i][2] = 83 + (unsigned char)(random * 64);
- buffer[i][1] = 71 + (unsigned char)(random * 32);
- buffer[i][0] = 23 + (unsigned char)(random * 16);
- buffer[i][3] = data[i*4+0];
+ data[i*4+3] = data[i*4+0];
+ data[i*4+2] = 83 + (unsigned char)(random * 64);
+ data[i*4+1] = 71 + (unsigned char)(random * 32);
+ data[i*4+0] = 23 + (unsigned char)(random * 16);
}
// White chars
for (i = 8192;i < 32768;i++)
{
random = lhrandom (0.0,1.0);
- buffer[i][2] = 95 + (unsigned char)(random * 64);
- buffer[i][1] = 95 + (unsigned char)(random * 64);
- buffer[i][0] = 95 + (unsigned char)(random * 64);
- buffer[i][3] = data[i*4+0];
+ data[i*4+3] = data[i*4+0];
+ data[i*4+2] = 95 + (unsigned char)(random * 64);
+ data[i*4+1] = 95 + (unsigned char)(random * 64);
+ data[i*4+0] = 95 + (unsigned char)(random * 64);
}
// Gold numbers
for (i = 32768;i < 40960;i++)
{
random = lhrandom (0.0,1.0);
- buffer[i][2] = 83 + (unsigned char)(random * 64);
- buffer[i][1] = 71 + (unsigned char)(random * 32);
- buffer[i][0] = 23 + (unsigned char)(random * 16);
- buffer[i][3] = data[i*4+0];
+ data[i*4+3] = data[i*4+0];
+ data[i*4+2] = 83 + (unsigned char)(random * 64);
+ data[i*4+1] = 71 + (unsigned char)(random * 32);
+ data[i*4+0] = 23 + (unsigned char)(random * 16);
}
// Red chars
for (i = 40960;i < 65536;i++)
{
random = lhrandom (0.0,1.0);
- buffer[i][2] = 96 + (unsigned char)(random * 64);
- buffer[i][1] = 43 + (unsigned char)(random * 32);
- buffer[i][0] = 27 + (unsigned char)(random * 32);
- buffer[i][3] = data[i*4+0];
+ data[i*4+3] = data[i*4+0];
+ data[i*4+2] = 96 + (unsigned char)(random * 64);
+ data[i*4+1] = 43 + (unsigned char)(random * 32);
+ data[i*4+0] = 27 + (unsigned char)(random * 32);
}
#if 0
- Image_WriteTGABGRA ("gfx/generated_conchars.tga", 256, 256, &buffer[0][0]);
+ Image_WriteTGABGRA ("gfx/generated_conchars.tga", 256, 256, data);
#endif
+ tex = R_LoadTexture2D(drawtexturepool, "conchars", 256, 256, data, TEXTYPE_BGRA, TEXF_ALPHA | TEXF_PRECACHE, NULL);
Mem_Free(data);
- return R_LoadTexture2D(drawtexturepool, "conchars", 256, 256, &buffer[0][0], TEXTYPE_BGRA, TEXF_ALPHA | TEXF_PRECACHE, NULL);
+ return tex;
}
static rtexture_t *draw_generateditherpattern(void)
float *av, *at, *ac;
float color[4];
int batchcount;
- float vertex3f[QUADELEMENTS_MAXQUADS*4*3];
- float texcoord2f[QUADELEMENTS_MAXQUADS*4*2];
- float color4f[QUADELEMENTS_MAXQUADS*4*4];
+ static float vertex3f[QUADELEMENTS_MAXQUADS*4*3];
+ static float texcoord2f[QUADELEMENTS_MAXQUADS*4*2];
+ static float color4f[QUADELEMENTS_MAXQUADS*4*4];
int ch;
int tempcolorindex;
vec3_t v;
vec_t s, t, intensity;
#define NORMSIZE 64
- unsigned char data[6][NORMSIZE][NORMSIZE][4];
+ unsigned char *data;
+ data = Mem_Alloc(tempmempool, 6*NORMSIZE*NORMSIZE*4);
for (side = 0;side < 6;side++)
{
for (y = 0;y < NORMSIZE;y++)
break;
}
intensity = 127.0f / sqrt(DotProduct(v, v));
- data[side][y][x][2] = (unsigned char)(128.0f + intensity * v[0]);
- data[side][y][x][1] = (unsigned char)(128.0f + intensity * v[1]);
- data[side][y][x][0] = (unsigned char)(128.0f + intensity * v[2]);
- data[side][y][x][3] = 255;
+ data[((side*64+y)*64+x)*4+2] = (unsigned char)(128.0f + intensity * v[0]);
+ data[((side*64+y)*64+x)*4+1] = (unsigned char)(128.0f + intensity * v[1]);
+ data[((side*64+y)*64+x)*4+0] = (unsigned char)(128.0f + intensity * v[2]);
+ data[((side*64+y)*64+x)*4+3] = 255;
}
}
}
- r_texture_normalizationcube = R_LoadTextureCubeMap(r_main_texturepool, "normalcube", NORMSIZE, &data[0][0][0][0], TEXTYPE_BGRA, TEXF_PRECACHE | TEXF_CLAMP | TEXF_PERSISTENT, NULL);
+ r_texture_normalizationcube = R_LoadTextureCubeMap(r_main_texturepool, "normalcube", NORMSIZE, data, TEXTYPE_BGRA, TEXF_PRECACHE | TEXF_CLAMP | TEXF_PERSISTENT, NULL);
+ Mem_Free(data);
}
static void R_BuildFogTexture(void)
{
#define MAXBATCHTRIANGLES 4096
int batchtriangles = 0;
- int batchelements[MAXBATCHTRIANGLES*3];
+ static int batchelements[MAXBATCHTRIANGLES*3];
for (i = 0;i < texturenumsurfaces;i = j)
{
surface = texturesurfacelist[i];
int texturenumsurfaces, endsurface;
texture_t *texture;
const msurface_t *surface;
- const msurface_t *texturesurfacelist[1024];
+ const msurface_t *texturesurfacelist[256];
// if the model is static it doesn't matter what value we give for
// wantnormals and wanttangents, so this logic uses only rules applicable
{
int i;
mportal_t *portal;
- double points[128][3];
+ static double points[128][3];
for (portal = leaf->portals;portal;portal = portal->next)
{
for (i = 0;i < portal->numpoints;i++)
const rtlight_t *rtlight;
void (*callback)(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfaceindices);
meshqueue_t *mqt;
- meshqueue_t *hash[4096], **hashpointer[4096];
+ static meshqueue_t *hash[4096], **hashpointer[4096];
int batchsurfaceindex[256];
if (!mqt_count)
return;
}
#define PORTAL_DIST_EPSILON (1.0 / 32.0)
+static double *portalpointsbuffer;
+static int portalpointsbufferoffset;
+static int portalpointsbuffersize;
static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node)
{
int i, side;
mplane_t clipplane, *plane;
portal_t *portal, *nextportal, *nodeportal, *splitportal, *temp;
int numfrontpoints, numbackpoints;
- double frontpoints[3*MAX_PORTALPOINTS], backpoints[3*MAX_PORTALPOINTS];
+ double *frontpoints, *backpoints;
// if a leaf, we're done
if (!node->plane)
return;
+ // get some space for our clipping operations to use
+ if (portalpointsbuffersize < portalpointsbufferoffset + 6*MAX_PORTALPOINTS)
+ {
+ portalpointsbuffersize = portalpointsbufferoffset * 2;
+ portalpointsbuffer = Mem_Realloc(loadmodel->mempool, portalpointsbuffer, portalpointsbuffersize * sizeof(*portalpointsbuffer));
+ }
+ frontpoints = portalpointsbuffer + portalpointsbufferoffset;
+ portalpointsbufferoffset += 3*MAX_PORTALPOINTS;
+ backpoints = portalpointsbuffer + portalpointsbufferoffset;
+ portalpointsbufferoffset += 3*MAX_PORTALPOINTS;
+
plane = node->plane;
front = node->children[0];
Mod_Q1BSP_RecursiveNodePortals(front);
Mod_Q1BSP_RecursiveNodePortals(back);
+
+ portalpointsbufferoffset -= 6*MAX_PORTALPOINTS;
}
static void Mod_Q1BSP_MakePortals(void)
{
Mem_ExpandableArray_NewArray(&portalarray, loadmodel->mempool, sizeof(portal_t), 1020*1024/sizeof(portal_t));
+ portalpointsbufferoffset = 0;
+ portalpointsbuffersize = 6*MAX_PORTALPOINTS*128;
+ portalpointsbuffer = Mem_Alloc(loadmodel->mempool, portalpointsbuffersize * sizeof(*portalpointsbuffer));
Mod_Q1BSP_RecursiveNodePortals(loadmodel->brush.data_nodes + loadmodel->brushq1.hulls[0].firstclipnode);
+ Mem_Free(portalpointsbuffer);
+ portalpointsbuffer = NULL;
+ portalpointsbufferoffset = 0;
+ portalpointsbuffersize = 0;
Mod_Q1BSP_FinalizePortals();
Mem_ExpandableArray_FreeArray(&portalarray);
}
int element[2];
}
edgehashentry_t;
- edgehashentry_t *edgehash[TRIANGLEEDGEHASH], *edgehashentries, edgehashentriesbuffer[TRIANGLEEDGEHASH*3], *hash;
+ static edgehashentry_t *edgehash[TRIANGLEEDGEHASH];
+ edgehashentry_t *edgehashentries, *hash;
+ if (!numtriangles)
+ return;
memset(edgehash, 0, sizeof(edgehash));
- edgehashentries = edgehashentriesbuffer;
// if there are too many triangles for the stack array, allocate larger buffer
- if (numtriangles > TRIANGLEEDGEHASH)
- edgehashentries = (edgehashentry_t *)Mem_Alloc(tempmempool, numtriangles * 3 * sizeof(edgehashentry_t));
+ edgehashentries = (edgehashentry_t *)Mem_Alloc(tempmempool, numtriangles * 3 * sizeof(edgehashentry_t));
// find neighboring triangles
for (i = 0, e = elements, n = neighbors;i < numtriangles;i++, e += 3, n += 3)
{
CL_KeepaliveMessage(false);
}
// free the allocated buffer
- if (edgehashentries != edgehashentriesbuffer)
- Mem_Free(edgehashentries);
+ Mem_Free(edgehashentries);
}
#else
// very slow but simple way
int i, j, n;
qboolean valid;
int ringfirst, ringlast;
- int recoversendflags[MAX_EDICTS];
+ static int recoversendflags[MAX_EDICTS];
csqcentityframedb_t *d;
n = client->csqcnumedicts;
static void r_explosion_start(void)
{
int x, y;
- unsigned char noise1[128][128], noise2[128][128], noise3[128][128], data[128][128][4];
+ static unsigned char noise1[128][128], noise2[128][128], noise3[128][128], data[128][128][4];
explosiontexturepool = R_AllocTexturePool();
explosiontexture = NULL;
explosiontexturefog = NULL;
matrix4x4_t matrix, imatrix;
dp_model_t *model;
prvm_edict_t *touch;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
vec3_t boxmins, boxmaxs;
vec3_t clipboxmins, clipboxmaxs;
vec3_t endpoints[MAX_LINEOFSIGHTTRACES];
dp_model_t *model;
// list of entities to test for collisions
int numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
//return SV_TraceBox(start, vec3_origin, vec3_origin, end, type, passedict, hitsupercontentsmask);
dp_model_t *model;
// list of entities to test for collisions
int numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
#ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
vec3_t end;
vec_t len = 0;
dp_model_t *model;
// list of entities to test for collisions
int numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
#ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
vec3_t end;
vec_t len = 0;
int frame;
// list of entities to test for collisions
int numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
// get world supercontents at this point
if (sv.worldmodel && sv.worldmodel->PointSuperContents)
void SV_LinkEdict_TouchAreaGrid(prvm_edict_t *ent)
{
int i, numtouchedicts, old_self, old_other;
- prvm_edict_t *touch, *touchedicts[MAX_EDICTS];
+ prvm_edict_t *touch;
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
if (ent == prog->edicts)
return; // don't add the world
dp_model_t *pushermodel;
trace_t trace, trace2;
matrix4x4_t pusherfinalmatrix, pusherfinalimatrix;
- unsigned short moved_edicts[MAX_EDICTS];
+ static unsigned short moved_edicts[MAX_EDICTS];
if (!pusher->fields.server->velocity[0] && !pusher->fields.server->velocity[1] && !pusher->fields.server->velocity[2] && !pusher->fields.server->avelocity[0] && !pusher->fields.server->avelocity[1] && !pusher->fields.server->avelocity[2])
{
vec3_t org, eorg, mins, maxs;
int i;
int numtouchedicts;
- prvm_edict_t *touchedicts[MAX_EDICTS];
+ static prvm_edict_t *touchedicts[MAX_EDICTS];
int chainfield;
VM_SAFEPARMCOUNTRANGE(2, 3, VM_SV_findradius);