configure.in:

make DGA off by default

merge qw_client/screen.c and uquake/screen.c into common/screen.c
This commit is contained in:
Bill Currie 2000-03-05 11:28:25 +00:00
parent b2b6b999ae
commit 0efddfca3b
3 changed files with 128 additions and 1112 deletions

View file

@ -25,16 +25,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <qtypes.h>
#include <quakedef.h>
#include <r_local.h>
#include <wad.h>
#include <draw.h>
#include <cvar.h>
#include <console.h>
#include <keys.h>
#include <sbar.h>
#include <keys.h>
#include <sys.h>
#include <console.h>
#include <cmd.h>
#include <sound.h>
#include <screen.h>
#include <lib_replace.h>
#include <menu.h>
#include <view.h>
#include <mathlib.h>
#include <input.h>
#include <plugin.h>
#include <time.h>
#include <mathlib.h>
@ -133,6 +141,8 @@ vrect_t *pconupdate;
vrect_t scr_vrect;
qboolean scr_disabled_for_loading;
qboolean scr_drawloading;
float scr_disabled_time;
qboolean scr_skipupdate;
@ -419,7 +429,9 @@ void SCR_Init (void)
// register our commands
//
Cmd_AddCommand ("screenshot",SCR_ScreenShot_f);
#ifdef QUAKEWORLD
Cmd_AddCommand ("snap",SCR_RSShot_f);
#endif
Cmd_AddCommand ("sizeup",SCR_SizeUp_f);
Cmd_AddCommand ("sizedown",SCR_SizeDown_f);
@ -480,7 +492,11 @@ SCR_DrawNet
*/
void SCR_DrawNet (void)
{
#ifdef QUAKEWORLD
if (cls.netchan.outgoing_sequence - cls.netchan.incoming_acknowledged < UPDATE_BACKUP-1)
#else
if (realtime - cl.last_received_message < 0.3)
#endif
return;
if (cls.demoplayback)
return;
@ -488,6 +504,14 @@ void SCR_DrawNet (void)
Draw_Pic (scr_vrect.x+64, scr_vrect.y, scr_net);
}
/*
===============
SCR_DrawFPS
Backported by Jules Bean <jules@jellybean.co.uk> from
quakeworld client
===============
*/
void SCR_DrawFPS (void)
{
extern cvar_t *show_fps;
@ -536,6 +560,23 @@ void SCR_DrawPause (void)
}
/*
==============
SCR_DrawLoading
==============
*/
void SCR_DrawLoading (void)
{
qpic_t *pic;
if (!scr_drawloading)
return;
pic = Draw_CachePic ("gfx/loading.lmp");
Draw_Pic ( (vid.width - pic->width)/2,
(vid.height - 48 - pic->height)/2, pic);
}
//=============================================================================
@ -548,6 +589,9 @@ void SCR_SetUpToDrawConsole (void)
{
Con_CheckResize ();
if (scr_drawloading)
return; // never a console with loading plaque
// decide on the height of the console
if (cls.state != ca_active)
{
@ -679,9 +723,11 @@ void WritePCXfile (char *filename, byte *data, int width, int height,
// write output file
length = pack - (byte *)pcx;
#ifdef QUAKEWORLD
if (upload)
CL_StartUpload((void *)pcx, length);
else
#endif
COM_WriteFile (filename, pcx, length);
}
@ -808,7 +854,7 @@ void SCR_DrawStringToSnap (const char *s, byte *buf, int x, int y, int width)
}
}
#ifdef QUAKEWORLD
/*
==================
SCR_RSShot_f
@ -934,10 +980,54 @@ void SCR_RSShot_f (void)
// Con_Printf ("Wrote %s\n", pcxname);
Con_Printf ("Sending shot to server...\n");
}
#endif
//=============================================================================
/*
===============
SCR_BeginLoadingPlaque
================
*/
void SCR_BeginLoadingPlaque (void)
{
S_StopAllSounds (true);
if (cls.state < ca_connected)
return;
if (cls.signon != SIGNONS)
return;
// redraw with no console and the loading plaque
Con_ClearNotify ();
scr_centertime_off = 0;
scr_con_current = 0;
scr_drawloading = true;
scr_fullupdate = 0;
Sbar_Changed ();
SCR_UpdateScreen ();
scr_drawloading = false;
scr_disabled_for_loading = true;
scr_disabled_time = realtime;
scr_fullupdate = 0;
}
/*
===============
SCR_EndLoadingPlaque
================
*/
void SCR_EndLoadingPlaque (void)
{
scr_disabled_for_loading = false;
scr_fullupdate = 0;
Con_ClearNotify ();
}
char *scr_notifystring;
qboolean scr_drawdialog;
@ -973,6 +1063,8 @@ void SCR_DrawNotifyString (void)
} while (1);
}
//=============================================================================
/*
==================
SCR_ModalMessage
@ -983,6 +1075,9 @@ keypress.
*/
int SCR_ModalMessage (char *text)
{
if (cls.state == ca_dedicated)
return true;
scr_notifystring = text;
// draw a fresh screen
@ -1043,13 +1138,25 @@ needs almost the entire 256k of stack space!
void SCR_UpdateScreen (void)
{
static float oldscr_viewsize;
static float oldlcd_x;
vrect_t vrect;
if (scr_skipupdate || block_drawing)
return;
scr_copytop = 0;
scr_copyeverything = 0;
if (scr_disabled_for_loading)
{
if (realtime - scr_disabled_time > 60)
{
scr_disabled_for_loading = false;
Con_Printf ("load failed.\n");
}
else
return;
}
#ifdef _WIN32
{ // don't suck up any cpu if minimized
@ -1063,6 +1170,9 @@ void SCR_UpdateScreen (void)
scr_copytop = 0;
scr_copyeverything = 0;
if (cls.state == ca_dedicated)
return;
if (!scr_initialized || !con_initialized)
return; // not initialized yet
@ -1081,6 +1191,12 @@ void SCR_UpdateScreen (void)
vid.recalc_refdef = true;
}
if (oldlcd_x != lcd_x->value)
{
oldlcd_x = lcd_x->value;
vid.recalc_refdef = true;
}
if (oldscreensize != scr_viewsize->value)
{
oldscreensize = scr_viewsize->value;
@ -1133,6 +1249,11 @@ void SCR_UpdateScreen (void)
SCR_DrawNotifyString ();
scr_copyeverything = true;
}
else if (scr_drawloading)
{
SCR_DrawLoading ();
Sbar_Draw ();
}
else if (cl.intermission == 1 && key_dest == key_game)
{
Sbar_IntermissionOverlay ();
@ -1142,6 +1263,10 @@ void SCR_UpdateScreen (void)
Sbar_FinaleOverlay ();
SCR_CheckDrawCenterString ();
}
else if (cl.intermission == 3 && key_dest == key_game)
{
SCR_CheckDrawCenterString ();
}
else
{
SCR_DrawRam ();

View file

@ -179,7 +179,7 @@ dnl Check for DGA support
AC_ARG_ENABLE(DGA,
[ --enable-DGA use XFree86 DGA extension, if available],
HAS_DGA=$enableval, HAS_DGA=auto)
if test "x$HAS_DGA" != xno; then
if test "x$HAS_DGA" == xyes; then
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
AC_CHECK_HEADER(X11/extensions/xf86dga.h, HAS_DGA=yes, HAS_DGA=no)

File diff suppressed because it is too large Load diff