]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - fractalnoise.c
rewrote memory system entirely (hunk, cache, and zone are gone, memory pools replaced...
[xonotic/darkplaces.git] / fractalnoise.c
index 3425daf84dca34e94bb7881c1d1939d109176214..31b140d518972459b866a85687df6722d056efa3 100644 (file)
@@ -18,7 +18,7 @@ void fractalnoise(byte *noise, int size, int startgrid)
        startgrid = bound(0, startgrid, size);
 
        amplitude = 0xFFFF; // this gets halved before use
-       noisebuf = qmalloc(size*size*sizeof(int));
+       noisebuf = Mem_Alloc(tempmempool, size*size*sizeof(int));
        memset(noisebuf, 0, size*size*sizeof(int));
 
        for (g2 = startgrid;g2;g2 >>= 1)
@@ -60,6 +60,6 @@ void fractalnoise(byte *noise, int size, int startgrid)
        for (y = 0;y < size;y++)
                for (x = 0;x < size;x++)
                        *noise++ = (byte) (((n(x,y) - min) * 256) / max);
-       qfree(noisebuf);
+       Mem_Free(noisebuf);
 #undef n
 }