|
Quake has a major memory leak, LordHavoc discovered it and patched it
while working on Nehahra some time ago, and fixes are now in Nehahra,
DarkPlaces, QuakeWorld Forever, and QuakeForge. The patch code is below.. int lhcsum; The fix is pretty simple, mainly just get rid of the reallocation else :) == Ender Find the gl_loadtexture function in gl_draw.c and replace it with the patched version below.
/*
================
GL_LoadTexture
================
*/
int lhcsumtable[256];
int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolean mipmap, qboolean alpha)
{
qboolean noalpha;
int i, p, s, lhcsum;
gltexture_t *glt;
// LordHavoc: do a checksum to confirm the data really is the same as previous
// occurances. well this isn't exactly a checksum, it's better than that but
// not following any standards.
lhcsum = 0;
s = width*height;
for (i = 0;i < 256;i++) lhcsumtable[i] = i + 1;
for (i = 0;i < s;i++) lhcsum += (lhcsumtable[data[i] & 255]++);
// see if the texture is allready present
if (identifier[0])
{
for (i=0, glt=gltextures ; i |