diff options
author | James Haley | 2010-01-26 00:59:02 +0000 |
---|---|---|
committer | James Haley | 2010-01-26 00:59:02 +0000 |
commit | b80409202d07732ec201c9816887262b505b81d4 (patch) | |
tree | 364dcb86f2c22411a720447bfa21c4de9191ff6f /src/heretic/r_data.c | |
parent | 66e8dc63bd0b384c99f0d0ff60b3d75c42d441b1 (diff) | |
parent | 8f6edc1f7402215c5e38d1f03939ce6b5ff5e3ae (diff) | |
download | chocolate-doom-b80409202d07732ec201c9816887262b505b81d4.tar.gz chocolate-doom-b80409202d07732ec201c9816887262b505b81d4.tar.bz2 chocolate-doom-b80409202d07732ec201c9816887262b505b81d4.zip |
Merge from raven-branch
Subversion-branch: /branches/strife-branch
Subversion-revision: 1825
Diffstat (limited to 'src/heretic/r_data.c')
-rw-r--r-- | src/heretic/r_data.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c index 9846196a..ee005248 100644 --- a/src/heretic/r_data.c +++ b/src/heretic/r_data.c @@ -221,7 +221,7 @@ void R_GenerateLookup(int texnum) // fill in the lump / offset, so columns with only a single patch are // all done // - patchcount = (byte *) alloca(texture->width); + patchcount = (byte *) Z_Malloc(texture->width, PU_STATIC, &patchcount); memset(patchcount, 0, texture->width); patch = texture->patches; @@ -263,6 +263,8 @@ void R_GenerateLookup(int texnum) texturecompositesize[texnum] += texture->height; } } + + Z_Free(patchcount); } @@ -322,7 +324,7 @@ void R_InitTextures(void) names = W_CacheLumpName("PNAMES", PU_STATIC); nummappatches = LONG(*((int *) names)); name_p = names + 4; - patchlookup = alloca(nummappatches * sizeof(*patchlookup)); + patchlookup = Z_Malloc(nummappatches * sizeof(*patchlookup), PU_STATIC, NULL); for (i = 0; i < nummappatches; i++) { strncpy(name, name_p + i * 8, 8); @@ -423,6 +425,8 @@ void R_InitTextures(void) totalwidth += texture->width; } + Z_Free(patchlookup); + W_ReleaseLumpName("TEXTURE1"); if (maptex2) { @@ -654,7 +658,7 @@ void R_PrecacheLevel(void) // // precache flats // - flatpresent = alloca(numflats); + flatpresent = Z_Malloc(numflats, PU_STATIC, NULL); memset(flatpresent, 0, numflats); for (i = 0; i < numsectors; i++) { @@ -671,10 +675,12 @@ void R_PrecacheLevel(void) W_CacheLumpNum(lump, PU_CACHE); } + Z_Free(flatpresent); + // // precache textures // - texturepresent = alloca(numtextures); + texturepresent = Z_Malloc(numtextures, PU_STATIC, NULL); memset(texturepresent, 0, numtextures); for (i = 0; i < numsides; i++) @@ -700,10 +706,12 @@ void R_PrecacheLevel(void) } } + Z_Free(texturepresent); + // // precache sprites // - spritepresent = alloca(numsprites); + spritepresent = Z_Malloc(numsprites, PU_STATIC, NULL); memset(spritepresent, 0, numsprites); for (th = thinkercap.next; th != &thinkercap; th = th->next) @@ -728,4 +736,6 @@ void R_PrecacheLevel(void) } } } + + Z_Free(spritepresent); } |