whitespace, some optimizations

This commit is contained in:
Jeff Teunissen 2000-10-28 05:05:17 +00:00
parent decea3fd39
commit 0ec5c00c18

View file

@ -49,7 +49,6 @@
#include "input.h"
#include "sbar.h"
#include "context_x11.h"
#include "dga_check.h"
#include "quakedef.h"
#include "qendian.h"
#include "qargs.h"
@ -61,19 +60,6 @@ static qboolean vid_initialized = false;
static GLXContext ctx = NULL;
extern cvar_t *in_dga_mouseaccel;
#ifdef HAVE_DGA
static int hasdgavideo = 0;
static int hasdga = 0;
#endif
#if defined(HAVE_DGA)
int VID_options_items = 2;
#else
int VID_options_items = 1;
#endif
extern void GL_Init_Common (void);
extern void VID_Init8bitPalette (void);
/*-----------------------------------------------------------------------*/
@ -165,23 +151,20 @@ VID_Init(unsigned char *palette)
/* Set vid parameters */
if ((i = COM_CheckParm("-conwidth")) != 0)
if ((i = COM_CheckParm ("-conwidth")))
vid.conwidth = atoi(com_argv[i+1]);
else
vid.conwidth = scr_width;
vid.conwidth &= 0xfff8; // make it a multiple of eight
if (vid.conwidth < 320)
vid.conwidth = 320;
vid.conwidth = max (vid.conwidth, 320);
// pick a conheight that matches with correct aspect
vid.conheight = vid.conwidth * 3 / 4;
i = COM_CheckParm ("-conheight");
if ( i != 0 ) // Set console height, but no smaller than 200 px
if ((i = COM_CheckParm ("-conheight"))) // conheight no smaller than 200px
vid.conheight = atoi (com_argv[i+1]);
if (vid.conheight < 200)
vid.conheight = 200;
vid.conheight = max (vid.conheight, 200);
x11_open_display ();
@ -192,17 +175,6 @@ VID_Init(unsigned char *palette)
}
x_vis = x_visinfo->visual;
#ifdef HAVE_DGA
{
int maj_ver;
hasdga = VID_CheckDGA(x_disp, &maj_ver, NULL, &hasdgavideo);
if (!hasdga || maj_ver < 1) {
hasdga = hasdgavideo = 0;
}
}
Con_Printf ("hasdga = %i\nhasdgavideo = %i\n", hasdga, hasdgavideo);
#endif
x11_set_vidmode (scr_width, scr_height);
x11_create_window (scr_width, scr_height);
/* Invisible cursor */
@ -216,12 +188,8 @@ VID_Init(unsigned char *palette)
glXMakeCurrent (x_disp, x_win, ctx);
if (vid.conheight > scr_height)
vid.conheight = scr_height;
if (vid.conwidth > scr_width)
vid.conwidth = scr_width;
vid.width = vid.conwidth;
vid.height = vid.conheight;
vid.height = vid.conheight = min (vid.conheight, scr_height);
vid.width = vid.conwidth = min (vid.conwidth, scr_width);
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
vid.numpages = 2;
@ -232,11 +200,10 @@ VID_Init(unsigned char *palette)
VID_SetPalette (palette);
// Check for 3DFX Extensions and initialize them.
// Check for 8-bit extension and initialize if present
VID_Init8bitPalette ();
Con_Printf ("Video mode %dx%d initialized.\n",
scr_width, scr_height);
Con_Printf ("Video mode %dx%d initialized.\n", scr_width, scr_height);
vid_initialized = true;