mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 06:42:26 +00:00
whitespace, small opt in pcx.c
This commit is contained in:
parent
eb8c267925
commit
6bae2b3010
2 changed files with 11 additions and 17 deletions
11
source/pcx.c
11
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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue