}
if (fullbrights)
{
- data2 = Mem_Alloc(tempmempool, tx->width*tx->height);
+ data2 = Mem_Alloc(loadmodel->mempool, tx->width*tx->height);
for (j = 0;j < tx->width*tx->height;j++)
data2[j] = data[j] >= 224 ? 0 : data[j]; // no fullbrights
tx->texture = R_LoadTexture (loadmodel->texturepool, tx->name, tx->width, tx->height, data2, TEXTYPE_QPALETTE, TEXF_MIPMAP | TEXF_PRECACHE);
Host_Error("NewWinding: too many points\n");
size = sizeof(windingsizeof_t) + sizeof(double[3]) * points;
- w = Mem_Alloc(tempmempool, size);
+ w = Mem_Alloc(loadmodel->mempool, size);
memset (w, 0, size);
return w;
for (i = 0;i < in->numpoints;i++)
{
+ if (neww->numpoints >= maxpts)
+ Host_Error ("ClipWinding: points exceeded estimate");
+
p1 = in->points[i];
if (sides[i] == SIDE_ON)
neww->numpoints++;
}
- if (neww->numpoints > maxpts)
- Host_Error ("ClipWinding: points exceeded estimate");
-
// free the original winding
FreeWinding (in);
for (i = 0;i < in->numpoints;i++)
{
+ if (f->numpoints >= maxpts || b->numpoints >= maxpts)
+ Host_Error ("DivideWinding: points exceeded estimate");
+
p1 = in->points[i];
if (sides[i] == SIDE_ON)
VectorCopy (mid, b->points[b->numpoints]);
b->numpoints++;
}
-
- if (f->numpoints > maxpts || b->numpoints > maxpts)
- Host_Error ("DivideWinding: points exceeded estimate");
}
typedef struct portal_s
static portal_t *AllocPortal (void)
{
portal_t *p;
- p = Mem_Alloc(tempmempool, sizeof(portal_t));
+ p = Mem_Alloc(loadmodel->mempool, sizeof(portal_t));
//memset(p, 0, sizeof(portal_t));
p->chain = portalchain;
portalchain = p;