A bit of house keeping.

This commit is contained in:
Bill Currie 2010-11-27 15:10:34 +09:00
parent dd87274027
commit e53ff2a36d
11 changed files with 44 additions and 68 deletions

View file

@ -63,6 +63,7 @@ static __attribute__ ((used)) const char rcsid[] =
# include <X11/extensions/xf86vmode.h>
#endif
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/input.h"
#include "QF/qargs.h"
@ -482,9 +483,18 @@ X11_UpdateFullscreen (cvar_t *fullscreen)
}
}
static void
VID_Center_f (void)
{
X11_ForceViewPort ();
}
void
X11_Init_Cvars (void)
{
Cmd_AddCommand ("vid_center", VID_Center_f, "Center the view port on the "
"quake window in a virtual desktop.\n");
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE,
&X11_UpdateFullscreen,
"Toggles fullscreen game mode");

View file

@ -39,6 +39,7 @@ static __attribute__ ((used)) const char rcsid[] =
#endif
#include <math.h>
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/qargs.h"
#include "QF/sys.h"
@ -165,6 +166,8 @@ VID_GetWindowSize (int def_w, int def_h)
Cvar_Set (con_height, va ("%d", max (con_height->int_val, 200)));
Cvar_SetFlags (con_height, con_height->flags | CVAR_ROM);
vid.conheight = con_height->int_val;
Con_CheckResize (); // Now that we have a window size, fix console
}
/* GAMMA FUNCTIONS */

View file

@ -303,8 +303,6 @@ VID_Init (unsigned char *palette)
attribs[4] = 1;
attribs[5] = FXMESA_NONE;
Con_CheckResize (); // Now that we have a window size, fix console
fc = qf_fxMesaCreateContext (0, findres (&vid.width, &vid.height),
GR_REFRESH_75Hz, attribs);
if (!fc)

View file

@ -455,7 +455,6 @@ VID_Init (unsigned char *palette)
current_mode = *vmode;
ioctl(tty_fd, KDSETMODE, KD_GRAPHICS);
VID_SetMode (current_mode.name, palette);
Con_CheckResize (); // Now that we have a window size, fix console
VID_InitGamma (palette);
VID_SetPalette (vid.palette);

View file

@ -55,7 +55,6 @@ static __attribute__ ((used)) const char rcsid[] =
#endif
#include "QF/cmd.h"
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/input.h"
#include "QF/qargs.h"
@ -150,6 +149,21 @@ QFGL_LoadLibrary (void)
}
#endif // HAVE_DLOPEN
static void
glx_get_functions (void)
{
GLF_Init ();
qfglXSwapBuffers = QFGL_ProcAddress (libgl_handle, "glXSwapBuffers", true);
qfglXChooseVisual = QFGL_ProcAddress (libgl_handle, "glXChooseVisual",
true);
qfglXCreateContext = QFGL_ProcAddress (libgl_handle, "glXCreateContext",
true);
qfglXMakeCurrent = QFGL_ProcAddress (libgl_handle, "glXMakeCurrent", true);
use_gl_procaddress = 1;
}
void
VID_Shutdown (void)
@ -172,12 +186,6 @@ GL_EndRendering (void)
Sbar_Changed ();
}
static void
VID_Center_f (void)
{
X11_ForceViewPort ();
}
void
VID_Init (unsigned char *palette)
{
@ -191,19 +199,7 @@ VID_Init (unsigned char *palette)
None
};
GLF_Init ();
qfglXSwapBuffers = QFGL_ProcAddress (libgl_handle, "glXSwapBuffers", true);
qfglXChooseVisual = QFGL_ProcAddress (libgl_handle, "glXChooseVisual",
true);
qfglXCreateContext = QFGL_ProcAddress (libgl_handle, "glXCreateContext",
true);
qfglXMakeCurrent = QFGL_ProcAddress (libgl_handle, "glXMakeCurrent", true);
use_gl_procaddress = 1;
Cmd_AddCommand ("vid_center", VID_Center_f, "Center the view port on the "
"quake window in a virtual desktop.\n");
glx_get_functions ();
VID_GetWindowSize (640, 480);
@ -212,8 +208,6 @@ VID_Init (unsigned char *palette)
vid.colormap8 = vid_colormap;
vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048));
Con_CheckResize (); // Now that we have a window size, fix console
X11_OpenDisplay ();
x_visinfo = qfglXChooseVisual (x_disp, x_screen, attrib);

View file

@ -122,8 +122,6 @@ VID_Init (unsigned char *palette)
VID_InitBuffers (); // allocate z buffer and surface cache
Con_CheckResize (); // Now that we have a window size, fix console
SDL_ShowCursor (0); // hide the mouse pointer
#ifdef _WIN32

View file

@ -165,8 +165,6 @@ VID_Init (unsigned char *palette)
VID_InitBuffers (); // allocate z buffer and surface cache
Con_CheckResize (); // Now that we have a window size, fix console
SDL_ShowCursor (0); // initialize the mouse
#ifdef _WIN32

View file

@ -165,8 +165,6 @@ VID_Init (unsigned char *palette)
SDL_Quit ();
success:
Con_CheckResize (); // Now that we have a window size, fix console
vid.numpages = 2;
GL_Init ();

View file

@ -383,7 +383,6 @@ VID_Init (unsigned char *palette)
/* Set vid parameters */
VID_SetMode (current_mode, palette);
Con_CheckResize (); // Now that we have a window size, fix console
VID_InitGamma (palette);
VID_SetPalette (vid.palette);

View file

@ -538,8 +538,6 @@ VID_Init (unsigned char *palette)
vid.colormap8 = vid_colormap;
vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048));
Con_CheckResize ();
#ifdef SPLASH_SCREEN
if(hwnd_dialog)
DestroyWindow (hwnd_dialog);

View file

@ -92,8 +92,6 @@ static XShmSegmentInfo x_shminfo[2];
static int current_framebuffer;
static XImage *x_framebuffer[2] = { 0, 0 };
static int verbose = 0;
int VID_options_items = 1;
static byte current_palette[768];
@ -384,13 +382,6 @@ x11_init_buffers (void)
vid.conbuffer = vid.buffer;
vid.conrowbytes = vid.rowbytes;
Con_CheckResize (); // Now that we have a window size, fix console
}
static void
VID_Center_f (void)
{
X11_ForceViewPort ();
}
/*
@ -408,22 +399,14 @@ VID_Init (unsigned char *palette)
int num_visuals;
int template_mask;
Cmd_AddCommand ("vid_center", VID_Center_f, "Center the view port on the "
"quake window in a virtual desktop.\n");
VID_GetWindowSize (320, 200);
vid.width = vid_width->int_val;
vid.height = vid_height->int_val;
vid.numpages = 2;
vid.colormap8 = vid_colormap;
vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048));
srandom (getpid ());
verbose = COM_CheckParm ("-verbose");
// open the display
X11_OpenDisplay ();
@ -464,23 +447,21 @@ VID_Init (unsigned char *palette)
}
}
if (verbose) {
Sys_MaskPrintf (SYS_VID, "Using visualid %d:\n",
(int) x_visinfo->visualid);
Sys_MaskPrintf (SYS_VID, " class %d\n", x_visinfo->class);
Sys_MaskPrintf (SYS_VID, " screen %d\n", x_visinfo->screen);
Sys_MaskPrintf (SYS_VID, " depth %d\n", x_visinfo->depth);
Sys_MaskPrintf (SYS_VID, " red_mask 0x%x\n",
(int) x_visinfo->red_mask);
Sys_MaskPrintf (SYS_VID, " green_mask 0x%x\n",
(int) x_visinfo->green_mask);
Sys_MaskPrintf (SYS_VID, " blue_mask 0x%x\n",
(int) x_visinfo->blue_mask);
Sys_MaskPrintf (SYS_VID, " colormap_size %d\n",
x_visinfo->colormap_size);
Sys_MaskPrintf (SYS_VID, " bits_per_rgb %d\n",
x_visinfo->bits_per_rgb);
}
Sys_MaskPrintf (SYS_VID, "Using visualid %d:\n",
(int) x_visinfo->visualid);
Sys_MaskPrintf (SYS_VID, " class %d\n", x_visinfo->class);
Sys_MaskPrintf (SYS_VID, " screen %d\n", x_visinfo->screen);
Sys_MaskPrintf (SYS_VID, " depth %d\n", x_visinfo->depth);
Sys_MaskPrintf (SYS_VID, " red_mask 0x%x\n",
(int) x_visinfo->red_mask);
Sys_MaskPrintf (SYS_VID, " green_mask 0x%x\n",
(int) x_visinfo->green_mask);
Sys_MaskPrintf (SYS_VID, " blue_mask 0x%x\n",
(int) x_visinfo->blue_mask);
Sys_MaskPrintf (SYS_VID, " colormap_size %d\n",
x_visinfo->colormap_size);
Sys_MaskPrintf (SYS_VID, " bits_per_rgb %d\n",
x_visinfo->bits_per_rgb);
/* Setup attributes for main window */
X11_SetVidMode (vid.width, vid.height);