From 6bae2b30100c5834f06746392202971c62b5cb7d Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Mon, 5 Feb 2001 23:17:48 +0000 Subject: [PATCH] whitespace, small opt in pcx.c --- source/pcx.c | 11 +++++------ source/screen.c | 17 ++++++----------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/source/pcx.c b/source/pcx.c index 0583be7..0034ba5 100644 --- a/source/pcx.c +++ b/source/pcx.c @@ -154,14 +154,13 @@ LoadPCX (QFile *f, int convert) */ void WritePCXfile (char *filename, byte * data, int width, int height, - int rowbytes, byte * palette, qboolean upload, qboolean flip) + int rowbytes, byte * palette, qboolean upload, qboolean flip) { - int i, j, length; - pcx_t *pcx; - byte *pack; + int i, j, length; + pcx_t *pcx; + byte *pack; - pcx = Hunk_TempAlloc (width * height * 2 + 1000); - if (pcx == NULL) { + if (!(pcx = Hunk_TempAlloc (width * height * 2 + 1000))) { Con_Printf ("WritePCXfile: not enough memory\n"); return; } diff --git a/source/screen.c b/source/screen.c index 1fbfdc1..7ff688e 100644 --- a/source/screen.c +++ b/source/screen.c @@ -660,26 +660,21 @@ SCR_ScreenShot_f (void) { char pcxname[MAX_OSPATH]; - // // find a file name to save it to - // if (!COM_NextFilename (pcxname, "qf", ".pcx")) { Con_Printf ("SCR_ScreenShot_f: Couldn't create a PCX"); return; } - // - // save the pcx file - // - D_EnableBackBufferAccess (); // enable direct drawing of console - // to back - // buffer + // enable direct drawing of console to back buffer + D_EnableBackBufferAccess (); + + // save the pcx file WritePCXfile (pcxname, vid.buffer, vid.width, vid.height, vid.rowbytes, host_basepal, false, false); - D_DisableBackBufferAccess (); // for adapters that can't stay - // mapped in - // for linear writes all the time + // for adapters that can't stay mapped in for linear writes all the time + D_DisableBackBufferAccess (); Con_Printf ("Wrote %s\n", pcxname); }