Fixes #6 by using xwd to take screenshots.

This commit is contained in:
eukos 2015-09-05 23:44:37 +02:00
parent d068c4613e
commit e6542eeca6
3 changed files with 120 additions and 331 deletions

8
README
View file

@ -8,7 +8,7 @@ This is a novelty engine rendering in software mode, aka on your CPU.
It uses standard X11 functions, so aside from that no dependencies are necessary. It uses standard X11 functions, so aside from that no dependencies are necessary.
For sound, please get the Open Sound System running. For sound, please get the Open Sound System running.
It can run Xuake with all its fancy waterwarping, too. It can run Q1 with all its fancy waterwarping, too.
************ ************
Features Features
@ -42,8 +42,8 @@ For a release build (smaller and faster) issue 'make build_release'.
- Main sound is done via OSS, not ALSA - aoss will most likely not work - Main sound is done via OSS, not ALSA - aoss will most likely not work
- The input is 'not good' right now - The input is 'not good' right now
- Originally based on engoo by leileilol - Originally based on engoo by leileilol
- If you want to run Xuake with it, launch it with -data id1. - If you want to run Q1 with it, launch it with -data id1.
You can get a particles.spr file for Quake here: http://euksy.oldtimes-software.com/files/NGUNIX/particle.spr You can get a particles.spr file for Q1 here: http://euksy.oldtimes-software.com/files/NGUNIX/particle.spr
********* *********
Plans Plans
@ -51,6 +51,6 @@ For a release build (smaller and faster) issue 'make build_release'.
- Menu system done primarily using CSQC - Menu system done primarily using CSQC
- HUD system done primarily using CSQC - HUD system done primarily using CSQC
- Make the bots less Xuake specific, controllable via SSQC - Make the bots less Q1 specific, controllable via SSQC
- Ship with a game directory that can be used as a base and torn apart for any use - Ship with a game directory that can be used as a base and torn apart for any use
- Ship with a scratch QC base and the new engine extensions - Ship with a scratch QC base and the new engine extensions

View file

@ -63,92 +63,6 @@ cvar_t *hud_inv_align;
void Sbar_MiniDeathmatchOverlay (void); void Sbar_MiniDeathmatchOverlay (void);
void Sbar_DeathmatchOverlay (void); void Sbar_DeathmatchOverlay (void);
void M_DrawPic (int x, int y, qpic_t *pic); void M_DrawPic (int x, int y, qpic_t *pic);
/*
=============
Draw_SubPic
=============
*/
void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height)
{
byte *dest, *source;
unsigned short *pusdest;
int v, u;
if ((x < 0) ||
(x + width > vid.width) ||
(y < 0) ||
(y + height > vid.height))
{
Sys_Error ("Draw_SubPic: bad coordinates");
}
source = pic->data + srcy * pic->width + srcx;
{
dest = vid.buffer + y * vid.rowbytes + x;
for (v=0 ; v<height ; v++)
{
Q_memcpy (dest, source, width);
dest += vid.rowbytes;
source += pic->width;
}
}
}
void Draw_SubPic_Scaled(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height)
{
byte *dest, *source;
unsigned short *pusdest;
int v, u, s;
float vmax, umax;
if ((x < 0) ||
(x + width > vid.width) ||
(y < 0) ||
(y + height > vid.height))
{
Sys_Error ("Draw_SubPic: bad coordinates");
}
source = pic->data + srcy * pic->width + srcx;
umax = pic->width * vid.width / (float)vid.vconwidth;
vmax = pic->height * vid.height / (float)vid.vconheight;
{
byte *dest = vid.buffer + (y*vid.height/vid.vconheight) * vid.rowbytes + (x*vid.width/vid.vconwidth);
for (v = 0; v < vmax; v++)
{
for (u = 0; u < umax; u++)
{
s = u * vid.vconwidth / vid.width + (v * vid.vconheight/vid.height) * pic->width;
dest[u] = source[s];
}
dest += vid.rowbytes;
}
}
}
/*
=============
Sbar_DrawSubPic
=============
JACK: Draws a portion of the picture in the status bar.
*/
void Sbar_DrawSubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height)
{
if (sb_scaled){
//Draw_SubPic_Scaled (x, y+(vid.vconheight-SBAR_HEIGHT), pic, srcx, srcy, vid.vconwidth, vid.vconheight);
}else
Draw_SubPic (x, y+(vid.height-SBAR_HEIGHT), pic, srcx, srcy, width, height);
}
/* /*
=============== ===============
@ -304,7 +218,7 @@ void Sbar_Init (void)
hud_ammo_posy = Cvar_Get ("hud_ammo_posy", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); hud_ammo_posy = Cvar_Get ("hud_ammo_posy", "0", CVAR_ARCHIVE | CVAR_ORIGINAL);
hud_ammo_align = Cvar_Get ("hud_ammo_align", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); hud_ammo_align = Cvar_Get ("hud_ammo_align", "0", CVAR_ARCHIVE | CVAR_ORIGINAL);
hud_inv = Cvar_Get ("hud_inv", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); hud_inv = Cvar_Get ("hud_inv", "0", CVAR_ARCHIVE | CVAR_ORIGINAL);
hud_inv_numbers = Cvar_Get ("hud_inv_numbers", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); hud_inv_numbers = Cvar_Get ("hud_inv_numbers", "1", CVAR_ARCHIVE | CVAR_ORIGINAL);
hud_inv_posx = Cvar_Get ("hud_inv_posx", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); hud_inv_posx = Cvar_Get ("hud_inv_posx", "0", CVAR_ARCHIVE | CVAR_ORIGINAL);
hud_inv_posy = Cvar_Get ("hud_inv_posy", "-24", CVAR_ARCHIVE | CVAR_ORIGINAL); hud_inv_posy = Cvar_Get ("hud_inv_posy", "-24", CVAR_ARCHIVE | CVAR_ORIGINAL);
@ -338,26 +252,8 @@ void Sbar_DrawPic (int x, int y, qpic_t *pic, int align)
Draw_Pic_Scaled (x, y, pic); Draw_Pic_Scaled (x, y, pic);
else else
Draw_Pic (x, y, pic); Draw_Pic (x, y, pic);
} }
void Sbar_DrawPicHalf (int x, int y, qpic_t *pic, int align)
{
if (cl.gametype != GAME_DEATHMATCH)
x += ((vid.vconwidth - 320)>>1);
if(align)
y += SBAR_HEIGHT;
else
y += (vid.vconheight-SBAR_HEIGHT);
if (sb_scaled)
Draw_Pic_Scaled_Two (x, y, pic);
else
Draw_Pic (x, y, pic);
}
/*x /*x
================ ================
Sbar_DrawCharacter Sbar_DrawCharacter
@ -378,9 +274,9 @@ void Sbar_DrawCharacter (int x, int y, int num, int align)
if (sb_scaled) if (sb_scaled)
Draw_Character_Scaled ( x /*+ ((vid.vconwidth - 320)>>1) */ + 4 , y, num); Draw_Character_Scaled ( x + 4 , y, num);
else else
Draw_Character ( x /*+ ((vid.width - 320)>>1) */ + 4 , y, num); Draw_Character ( x + 4 , y, num);
} }
/* /*
@ -479,12 +375,11 @@ void Sbar_DrawNum (int x, int y, int num, int digits, int color, int align)
//============================================================================= //=============================================================================
int fragsort[MAX_SCOREBOARD]; int fragsort[MAX_SCOREBOARD];
char scoreboardtext[MAX_SCOREBOARD][20];
int scoreboardtop[MAX_SCOREBOARD]; int scoreboardtop[MAX_SCOREBOARD];
int scoreboardbottom[MAX_SCOREBOARD]; int scoreboardbottom[MAX_SCOREBOARD];
int scoreboardcount[MAX_SCOREBOARD]; int scoreboardcount[MAX_SCOREBOARD];
int scoreboardlines; int scoreboardlines;
char scoreboardtext[MAX_SCOREBOARD][20];
/* /*
=============== ===============
@ -1093,7 +988,6 @@ Sbar_DeathmatchOverlay
*/ */
void Sbar_MiniDeathmatchOverlay (void) void Sbar_MiniDeathmatchOverlay (void)
{ {
// qpic_t *pic; // 2000-07-30 DJGPP compiler warning fix by Norberto Alfredo Bensa
int i, k; //, l // 2001-12-10 Reduced compiler warnings by Jeff Ford int i, k; //, l // 2001-12-10 Reduced compiler warnings by Jeff Ford
int top, bottom; int top, bottom;
int x, y, f; int x, y, f;
@ -1101,15 +995,9 @@ void Sbar_MiniDeathmatchOverlay (void)
scoreboard_t *s; scoreboard_t *s;
int numlines; int numlines;
if (sb_scaled){ if ((sb_scaled && vid.vconwidth < 512) || (!sb_scaled && vid.width < 51))
if (vid.vconwidth < 512)
return; return;
}
else
{
if (vid.width < 512)
return;
}
scr_copyeverything = 1; scr_copyeverything = 1;
scr_fullupdate = 0; scr_fullupdate = 0;

View file

@ -258,11 +258,6 @@ float CalcFovy (float fov_x, float width, float height)
return a; return a;
} }
// QUAKESPASM CODE BY SEZERO END
// leilei - i am a dirty bitch for not figuring this out on my own .-_-.
/* /*
==================== ====================
CalcFov CalcFov
@ -270,32 +265,14 @@ CalcFov
*/ */
float CalcFov (float fov_x, float width, float height) float CalcFov (float fov_x, float width, float height)
{ {
/*
float a;
float x; float x;
if (fov_x < 1 || fov_x > 179){
fov_x = 179; // leilei - don't crash.
}
// Sys_Error ("Bad fov: %f", fov_x);
x = width/tan(fov_x/360*M_PI);
a = atan (height/x);
a = a*360/M_PI;
return a;
*/
float x;
x = width / tan(fov_x / 360 * M_PI); x = width / tan(fov_x / 360 * M_PI);
return atan (height / x) * 360 / M_PI; return atan (height / x) * 360 / M_PI;
} }
// MH's correct thing // MH's correct thing
float SCR_CalcFovX (float fov_y, float width, float height) float SCR_CalcFovX (float fov_y, float width, float height)
{ {
// bound, don't crash // bound, don't crash
@ -361,8 +338,7 @@ float CalcFovOld (float fov_x, float width, float height)
return a; return a;
} }
int yeahimconsoled; int yeahimconsoled;
int screenfake; // leilei - forcing 320x200 metrics in any resolution no matter what (HACK HACK HACK!) int screenfake;
void SCR_StretchInit (void) void SCR_StretchInit (void)
{ {
@ -375,12 +351,10 @@ void SCR_StretchInit (void)
vid.vconwidth = Q_atoi(com_argv[i+1]); vid.vconwidth = Q_atoi(com_argv[i+1]);
scalefactor = vid.width / vid.vconwidth; scalefactor = vid.width / vid.vconwidth;
scalefactorv = vid.height / vid.vconheight; scalefactorv = vid.height / vid.vconheight;
// vid.vconwidth = vid.width / scalefactor;
// vid.vconheight = vid.height / scalefactor; // leilei - variable height doesn't work right now.
yeahimconsoled = 1; yeahimconsoled = 1;
sb_scaled = 1; sb_scaled = 1;
menu_scaled = 1; menu_scaled = 1;
console_scaled = 1; // currently bugged console_scaled = 1;
} }
else if ((i = COM_CheckParm("-youpickedupaclip")) != 0){ else if ((i = COM_CheckParm("-youpickedupaclip")) != 0){
@ -388,80 +362,25 @@ void SCR_StretchInit (void)
vid.vconheight = 32; vid.vconheight = 32;
scalefactor = vid.width / vid.vconwidth; scalefactor = vid.width / vid.vconwidth;
scalefactorv = vid.height / 32; scalefactorv = vid.height / 32;
// vid.vconwidth = vid.width / scalefactor;
// vid.vconheight = vid.height / scalefactor; // leilei - variable height doesn't work right now.
yeahimconsoled = 0; yeahimconsoled = 0;
sb_scaled = 1; sb_scaled = 1;
menu_scaled = 0; menu_scaled = 0;
console_scaled = 0; // currently bugged console_scaled = 0;
} }
else if ((i = COM_CheckParm("-conheight")) != 0){ else if ((i = COM_CheckParm("-conheight")) != 0){
vid.vconheight = Q_atoi(com_argv[i+1]); vid.vconheight = Q_atoi(com_argv[i+1]);
scalefactor = vid.width / vid.vconwidth; scalefactor = vid.width / vid.vconwidth;
scalefactorv = vid.height / vid.vconheight; scalefactorv = vid.height / vid.vconheight;
// vid.vconwidth = vid.width / scalefactor;
// vid.vconheight = vid.height / scalefactor; // leilei - variable height doesn't work right now.
yeahimconsoled = 1; yeahimconsoled = 1;
sb_scaled = 1; sb_scaled = 1;
menu_scaled = 1; menu_scaled = 1;
console_scaled = 1; // currently bugged console_scaled = 1;
} }
else{ else
scalefactor = 0; // we don't stretch. scalefactor = 0; // we don't stretch.
}
if (scalefactor > (vid.height / 200)) if (scalefactor > (vid.height / 200))
scalefactor = vid.height / 200; scalefactor = vid.height / 200;
// scr_scale->value = scalefactor + scalefactorv / 2; // transfer are cvar's ovar.
/*
int i;
float eh;
if ((i = COM_CheckParm("-conwidth")) != 0){
vid.vconwidth = Q_atoi(com_argv[i+1]);
eh = vid.width / vid.vconwidth;
vid.vconwidth = vid.width / eh;
vid.vconheight = vid.height / eh; // leilei - variable height doesn't work right now.
yeahimconsoled = 1;
sb_scaled = 1;
menu_scaled = 1;
console_scaled = 0; // currently bugged
}
else
vid.vconwidth = vid.width;
*/
/*
if (yeahimconsoled){
vid.vconwidth &= 0xfff8; // make it a multiple of eight
// pick a conheight that matches with correct aspect
// vid.vconheight = vid.vconwidth*3 / 4;
if ((i = COM_CheckParm("-conheight")) != 0)
// vid.vconheight = Q_atoi(com_argv[i+1]);
vid.vconheight = vid.height / (vid.width / vid.vconwidth); // leilei - variable height doesn't work right now.
if (vid.vconheight < 200)
vid.vconheight = 200;
}
else
{
vid.vconwidth = vid.width;
vid.vconheight = vid.height;
}
*/
// if (vid.vconheight > vid.height)
// vid.vconheight = 200; // clamping it crashes, so fall back to 320x200 anyway
// if (yeahimconsoled)
// vid.vconheight = vid.height / (vid.width / vid.vconwidth); // leilei - variable height doesn't work right now.
}; };
void SCR_CvarCheck (void) void SCR_CvarCheck (void)
@ -469,41 +388,37 @@ void SCR_CvarCheck (void)
scalefactor = scr_scale->value; scalefactor = scr_scale->value;
scalefactorv = scr_scale->value; scalefactorv = scr_scale->value;
if (scr_retroscale->value){ if (scr_retroscale->value)
{
scalefactorv = vid.height / 200; // force old metrics etc!! scalefactorv = vid.height / 200;
scalefactor = scalefactorv; scalefactor = scalefactorv;
retroscalefactor = 1; retroscalefactor = 1;
} }
else else
retroscalefactor = 0; retroscalefactor = 0;
if (scalefactorv > (vid.height / 200)) if (scalefactorv > (vid.height / 200))
scalefactorv = vid.height / 200; // if we go beyond 320x200, then clamp! scalefactorv = vid.height / 200;
// if (scalefactor > (vid.width / 320))
// scalefactor = vid.width / 320; // if we go beyond 320x200, then clamp!
if (scalefactor < 1) if (scalefactor < 1)
scalefactor = 1; scalefactor = 1;
if (scalefactorv < 1) if (scalefactorv < 1)
scalefactorv = 1; scalefactorv = 1;
SCR_StretchRefresh(); SCR_StretchRefresh();
}; };
void SCR_StretchRefresh (void) void SCR_StretchRefresh (void)
{ {
int i; int i;
float eh; float eh;
if (!scalefactor) if (!scalefactor)
return; // don't even try return; // don't even try
if (!scalefactorv) if (!scalefactorv)
return; // don't even try return; // don't even try
/*
screenfake = 0; screenfake = 0;
if (screenfake == 1){ if (screenfake == 1){
vid.vconwidth = 320; vid.vconwidth = 320;
@ -563,6 +478,8 @@ void SCR_StretchRefresh (void)
return; return;
} }
*/
if (scalefactorv < 1){ if (scalefactorv < 1){
vid.vconheight = vid.height; vid.vconheight = vid.height;
yeahimconsoled = 0; yeahimconsoled = 0;
@ -579,25 +496,21 @@ void SCR_StretchRefresh (void)
return; // avoid div0 at all costs return; // avoid div0 at all costs
} }
// if (scalefactor > (vid.height / 200))
// scalefactor = vid.height / 200;
// if (scalefactor < (vid.vconheight / vid.height))
// scalefactor = vid.vconheight / vid.height;
vid.vconwidth = vid.width / scalefactor; vid.vconwidth = vid.width / scalefactor;
vid.vconheight = vid.height / scalefactorv; // leilei - variable height doesn't work right now. vid.vconheight = vid.height / scalefactorv; // leilei - variable height doesn't work right now.
yeahimconsoled = 1; yeahimconsoled = 1;
sb_scaled = 1; sb_scaled = 1;
menu_scaled = 1; menu_scaled = 1;
console_scaled = 0; // currently bugged console_scaled = 0;
// minimum safeguards so we don't make a size too small to enter if (vid.vconwidth < 320)
// the evil land of crash city vid.vconwidth = 320;
if (vid.vconwidth < 320) vid.vconwidth = 320; if (vid.vconheight < 200)
if (vid.vconheight < 200) vid.vconheight = 200; vid.vconheight = 200;
if (vid.vconwidth > vid.width && vid.vconheight > vid.height)
if (vid.vconwidth > vid.width && vid.vconheight > vid.height){ {
vid.vconwidth = vid.width; vid.vconwidth = vid.width;
vid.vconheight = vid.height; vid.vconheight = vid.height;
yeahimconsoled = 0; yeahimconsoled = 0;
@ -608,9 +521,8 @@ void SCR_StretchRefresh (void)
scalefactorv = 1; scalefactorv = 1;
} }
vid.recalc_refdef = 1; // yeah vid.recalc_refdef = 1;
}; }
/* /*
================= =================
@ -688,7 +600,6 @@ static void SCR_CalcRefdef (void)
// notify the refresh of the change // notify the refresh of the change
R_ViewChanged (&vrect, sb_what_lines, vid.aspect); R_ViewChanged (&vrect, sb_what_lines, vid.aspect);
// R_ViewChanged (vid.aspect);
} }
//============================================================================ //============================================================================
@ -714,14 +625,12 @@ void SCR_Init_Cvars (void)
scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_ORIGINAL); scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_ORIGINAL);
scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_ORIGINAL); scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_ORIGINAL);
scr_fov_adapt = Cvar_Get ("scr_fov_adapt", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); scr_fov_adapt = Cvar_Get ("scr_fov_adapt", "1", CVAR_ARCHIVE | CVAR_ORIGINAL);
// 2000-01-12 Variable console height by Fett start
scr_conheight = Cvar_Get ("scr_conheight", "0.5", CVAR_ARCHIVE); scr_conheight = Cvar_Get ("scr_conheight", "0.5", CVAR_ARCHIVE);
Cvar_SetRangecheck (scr_conheight, Cvar_RangecheckFloat, 0, 1); Cvar_SetRangecheck (scr_conheight, Cvar_RangecheckFloat, 0, 1);
Cvar_Set(scr_conheight, scr_conheight->string); // do rangecheck Cvar_Set(scr_conheight, scr_conheight->string);
// 2000-01-12 Variable console height by Fett end
scr_scale = Cvar_Get ("scr_scale", "2", CVAR_ARCHIVE | CVAR_ORIGINAL); // leilei - default to 2 scr_scale = Cvar_Get ("scr_scale", "2", CVAR_ARCHIVE | CVAR_ORIGINAL);
scr_retroscale = Cvar_Get ("scr_retroscale", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); // leilei - default to 1 since it's fast now..... scr_retroscale = Cvar_Get ("scr_retroscale", "1", CVAR_ARCHIVE | CVAR_ORIGINAL);
scr_aspectmode = Cvar_Get ("scr_aspectmode", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); scr_aspectmode = Cvar_Get ("scr_aspectmode", "1", CVAR_ARCHIVE | CVAR_ORIGINAL);
} }
// 2001-09-18 New cvar system by Maddes (Init) end // 2001-09-18 New cvar system by Maddes (Init) end
@ -742,8 +651,6 @@ void SCR_Init (void)
scr_initialized = true; scr_initialized = true;
} }
/* /*
============== ==============
SCR_DrawRam SCR_DrawRam
@ -753,9 +660,9 @@ void SCR_DrawRam (void)
{ {
if (!scr_showram->value) if (!scr_showram->value)
return; return;
if (!r_cache_thrash) if (!r_cache_thrash)
return; return;
if (menu_scaled) if (menu_scaled)
Draw_Pic_Scaled (scr_vrect.x+32, scr_vrect.y, scr_ram); Draw_Pic_Scaled (scr_vrect.x+32, scr_vrect.y, scr_ram);
else else
@ -774,18 +681,17 @@ void SCR_DrawTurtle (void)
if (!scr_showturtle->value) if (!scr_showturtle->value)
return; return;
// 2001-10-20 TIMESCALE extension by Tomaz/Maddes start
// if (host_frametime < 0.1)
if (host_cpu_frametime < 0.1) if (host_cpu_frametime < 0.1)
// 2001-10-20 TIMESCALE extension by Tomaz/Maddes end
{ {
count = 0; count = 0;
return; return;
} }
count++; count++;
if (count < 3) if (count < 3)
return; return;
if (menu_scaled) if (menu_scaled)
Draw_Pic_Scaled (scr_vrect.x, scr_vrect.y, scr_turtle); Draw_Pic_Scaled (scr_vrect.x, scr_vrect.y, scr_turtle);
else else
@ -803,6 +709,7 @@ void SCR_DrawNet (void)
return; return;
if (cls.demoplayback) if (cls.demoplayback)
return; return;
if (menu_scaled) if (menu_scaled)
Draw_Pic_Scaled (scr_vrect.x+64, scr_vrect.y, scr_net); Draw_Pic_Scaled (scr_vrect.x+64, scr_vrect.y, scr_net);
else else
@ -828,18 +735,23 @@ void SCR_DrawFPS (void)
return; return;
t = Sys_FloatTime (); t = Sys_FloatTime ();
if ((t - lastframetime) >= 1.0) {
if ((t - lastframetime) >= 1.0)
{
lastfps = fps_count; lastfps = fps_count;
fps_count = 0; fps_count = 0;
lastframetime = t; lastframetime = t;
} }
sprintf(st, "%3d FPS", lastfps); sprintf(st, "%3d FPS", lastfps);
if (sb_scaled) if (sb_scaled)
x = vid.vconwidth - strlen(st) * 16 - 16; x = vid.vconwidth - strlen(st) * 16 - 16;
else else
x = vid.width - strlen(st) * 16 - 16; x = vid.width - strlen(st) * 16 - 16;
y = 0; y = 0;
if (sb_scaled) if (sb_scaled)
Draw_String_Scaled(x, y, st); Draw_String_Scaled(x, y, st);
else else
@ -859,11 +771,11 @@ void SCR_DrawPause (void)
if (!scr_showpause->value) // turn off for screenshots if (!scr_showpause->value) // turn off for screenshots
return; return;
if (!cl.paused) if (!cl.paused)
return; return;
pic = Draw_CachePic ("gfx/pause.lmp"); pic = Draw_CachePic ("gfx/pause.lmp");
if (menu_scaled) if (menu_scaled)
Draw_Pic_Scaled ( (vid.vconwidth - pic->width)/2, Draw_Pic_Scaled ( (vid.vconwidth - pic->width)/2,
(vid.vconheight - 48 - pic->height)/2, pic); (vid.vconheight - 48 - pic->height)/2, pic);
@ -872,8 +784,6 @@ void SCR_DrawPause (void)
(vid.height - 48 - pic->height)/2, pic); (vid.height - 48 - pic->height)/2, pic);
} }
/* /*
============== ==============
SCR_DrawLoading SCR_DrawLoading
@ -887,12 +797,11 @@ void SCR_DrawLoading (void)
return; return;
pic = Draw_CachePic ("gfx/loading.lmp"); pic = Draw_CachePic ("gfx/loading.lmp");
if (menu_scaled) if (menu_scaled)
Draw_Pic_Scaled ( (vid.vconwidth - pic->width)/2, Draw_Pic_Scaled ( (vid.vconwidth - pic->width)/2, (vid.vconheight - 48 - pic->height)/2, pic);
(vid.vconheight - 48 - pic->height)/2, pic);
else else
Draw_Pic ( (vid.width - pic->width)/2, Draw_Pic ( (vid.width - pic->width)/2, (vid.height - 48 - pic->height)/2, pic);
(vid.height - 48 - pic->height)/2, pic);
} }
@ -905,7 +814,7 @@ else
SCR_SetUpToDrawConsole SCR_SetUpToDrawConsole
================== ==================
*/ */
extern cvar_t *con_alpha; // 2000-08-04 "Transparent" console background for software renderer by Norberto Alfredo Bensa/Maddes extern cvar_t *con_alpha;
void SCR_SetUpToDrawConsole (void) void SCR_SetUpToDrawConsole (void)
{ {
@ -1116,7 +1025,7 @@ void SCR_ScreenShot_f (void)
// //
// find a file name to save it to // find a file name to save it to
// //
#ifndef LINUX #ifndef linux
strcpy(pcxname,"scrsh00.pcx"); strcpy(pcxname,"scrsh00.pcx");
#else #else
strcpy(pcxname,"scrsh00.xwd"); strcpy(pcxname,"scrsh00.xwd");
@ -1132,28 +1041,20 @@ void SCR_ScreenShot_f (void)
} }
if (i==100) if (i==100)
{ {
Con_Printf ("SCR_ScreenShot_f: Couldn't create a PCX file\n"); Con_Printf ("SCR_ScreenShot_f: Couldn't create a screenshot!\n");
return; return;
} }
#ifndef LINUX #ifndef linux
//
// save the pcx file
//
D_EnableBackBufferAccess (); // enable direct drawing of console to back D_EnableBackBufferAccess (); // enable direct drawing of console to back
printf("Writing PCX - %ix%i named %s\n", vid.width, vid.height, pcxname);
#ifdef _WIN32
WritePCXfile (pcxname, vid.buffer, vid.width, vid.height, vid.rowbytes, vid_curpal); WritePCXfile (pcxname, vid.buffer, vid.width, vid.height, vid.rowbytes, vid_curpal);
#else // WritePCXfile (pcxname, vid.buffer, vid.width, vid.height, vid.rowbytes, host_basepal);
WritePCXfile (pcxname, vid.buffer, vid.width, vid.height, vid.rowbytes, host_basepal);
#endif
D_DisableBackBufferAccess (); // for adapters that can't stay mapped in D_DisableBackBufferAccess (); // for adapters that can't stay mapped in
#else #else
sprintf(pcxnametwo, "xwd -name 'NGUNIX X11' -out %s", pcxname); sprintf(pcxnametwo, "xwd -name \"NGUNIX X11\" -display :0 -out ./%s/%s", com_gamedir, pcxname);
system(pcxnametwo); system(pcxnametwo);
// popen(buffer, "r");
#endif #endif
Con_Printf ("Wrote %s\n", pcxname); Con_Printf ("Wrote %s\n", pcxname);