Skip to content

Commit

Permalink
Use NoFill hunk allocations in a few more places
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Jul 21, 2024
1 parent 93260ab commit df88e3e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Quake/gl_texmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,15 +741,15 @@ void TexMgr_LoadPalette (void)
Sys_Error ("Couldn't load gfx/palette.lmp");

mark = Hunk_LowMark ();
pal = (byte *) Hunk_Alloc (768);
pal = (byte *) Hunk_AllocNoFill (768);
if (fread (pal, 768, 1, f) != 1)
Sys_Error ("Failed reading gfx/palette.lmp");
fclose(f);

COM_FOpenFile ("gfx/colormap.lmp", &f, NULL);
if (!f)
Sys_Error ("Couldn't load gfx/colormap.lmp");
colormap = (byte *) Hunk_Alloc (256 * 64);
colormap = (byte *) Hunk_AllocNoFill (256 * 64);
if (fread (colormap, 256 * 64, 1, f) != 1)
Sys_Error ("TexMgr_LoadPalette: colormap read error");
fclose(f);
Expand Down Expand Up @@ -1051,7 +1051,7 @@ static unsigned *TexMgr_ResampleTexture (unsigned *in, int inwidth, int inheight

outwidth = TexMgr_Pad(inwidth);
outheight = TexMgr_Pad(inheight);
out = (unsigned *) Hunk_Alloc(outwidth*outheight*4);
out = (unsigned *) Hunk_AllocNoFill (outwidth*outheight*4);

xfrac = ((inwidth-1) << 16) / (outwidth-1);
yfrac = ((inheight-1) << 16) / (outheight-1);
Expand Down Expand Up @@ -1236,7 +1236,7 @@ static unsigned *TexMgr_8to32 (byte *in, int pixels, unsigned int *usepal)
int i;
unsigned *out, *data;

out = data = (unsigned *) Hunk_Alloc(pixels*4);
out = data = (unsigned *) Hunk_AllocNoFill (pixels*4);

for (i = 0; i < pixels; i++)
*out++ = usepal[*in++];
Expand All @@ -1259,7 +1259,7 @@ static byte *TexMgr_PadImageW (byte *in, int width, int height, byte padbyte)

outwidth = TexMgr_Pad(width);

out = data = (byte *) Hunk_Alloc(outwidth*height);
out = data = (byte *) Hunk_AllocNoFill(outwidth*height);

for (i = 0; i < height; i++)
{
Expand Down Expand Up @@ -1288,7 +1288,7 @@ static byte *TexMgr_PadImageH (byte *in, int width, int height, byte padbyte)
srcpix = width * height;
dstpix = width * TexMgr_Pad(height);

out = data = (byte *) Hunk_Alloc(dstpix);
out = data = (byte *) Hunk_AllocNoFill(dstpix);

for (i = 0; i < srcpix; i++)
*out++ = *in++;
Expand Down Expand Up @@ -1667,7 +1667,7 @@ void TexMgr_ReloadImage (gltexture_t *glt, int shirt, int pants)
else if (glt->source_format == SRC_LIGHTMAP) {
size *= lightmap_bytes;
}
data = (byte *) Hunk_Alloc (size);
data = (byte *) Hunk_AllocNoFill (size);
sz = (int) fread (data, 1, size, f);
fclose (f);
if (sz != size) {
Expand Down Expand Up @@ -1739,7 +1739,7 @@ invalid: Con_Printf ("TexMgr_ReloadImage: invalid source for %s\n", glt->name);

//translate texture
size = glt->width * glt->height;
dst = translated = (byte *) Hunk_Alloc (size);
dst = translated = (byte *) Hunk_AllocNoFill (size);
src = data;

for (i = 0; i < size; i++)
Expand Down

0 comments on commit df88e3e

Please sign in to comment.