mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
nuke scr_width and scr_height
This commit is contained in:
parent
a2fa2d425b
commit
f2004abecc
8 changed files with 24 additions and 25 deletions
|
@ -85,7 +85,6 @@ extern viddef_t vid; // global video state
|
|||
extern unsigned short d_8to16table[256];
|
||||
extern unsigned int d_8to24table[256];
|
||||
|
||||
extern int scr_width, scr_height;
|
||||
extern byte gammatable[256];
|
||||
extern struct cvar_s *vid_gamma;
|
||||
extern qboolean vid_gamma_avail;
|
||||
|
|
|
@ -322,7 +322,8 @@ check_mouse_event (Display *disp, XEvent *ev, XPointer arg)
|
|||
XMotionEvent *me = &ev->xmotion;
|
||||
if (ev->type != MotionNotify)
|
||||
return False;
|
||||
if (me->x != scr_width / 2 || me->y != scr_height / 2)
|
||||
if ((unsigned) me->x != vid.width / 2
|
||||
|| (unsigned) me->y != vid.height / 2)
|
||||
return False;
|
||||
return True;
|
||||
}
|
||||
|
@ -333,8 +334,8 @@ X11_SetMouse (void)
|
|||
XEvent ev;
|
||||
|
||||
XWarpPointer (x_disp, None, x_win, 0, 0, 0, 0, 0, 0);
|
||||
XWarpPointer (x_disp, None, x_win, 0, 0, 0, 0, scr_width / 2,
|
||||
scr_height / 2);
|
||||
XWarpPointer (x_disp, None, x_win, 0, 0, 0, 0,
|
||||
vid.width / 2, vid.height / 2);
|
||||
XPeekIfEvent (x_disp, &ev, check_mouse_event, 0);
|
||||
x_mouse_time = ev.xmotion.time;
|
||||
}
|
||||
|
@ -418,8 +419,8 @@ X11_SetVidMode (int width, int height)
|
|||
}
|
||||
|
||||
for (i = 0; i < nummodes; i++) {
|
||||
if ((vidmodes[i]->hdisplay == scr_width) &&
|
||||
(vidmodes[i]->vdisplay == scr_height)) {
|
||||
if ((vidmodes[i]->hdisplay == vid.width) &&
|
||||
(vidmodes[i]->vdisplay == vid.height)) {
|
||||
found_mode = true;
|
||||
best_mode = i;
|
||||
break;
|
||||
|
@ -427,8 +428,8 @@ X11_SetVidMode (int width, int height)
|
|||
}
|
||||
|
||||
if (found_mode) {
|
||||
Sys_DPrintf ("VID: Chose video mode: %dx%d\n", scr_width,
|
||||
scr_height);
|
||||
Sys_DPrintf ("VID: Chose video mode: %dx%d\n",
|
||||
vid.width, vid.height);
|
||||
|
||||
XF86VidModeSwitchToMode (x_disp, x_screen,
|
||||
vidmodes[best_mode]);
|
||||
|
@ -436,7 +437,7 @@ X11_SetVidMode (int width, int height)
|
|||
X11_SetScreenSaver ();
|
||||
} else {
|
||||
Sys_Printf ("VID: Mode %dx%d can't go fullscreen.\n",
|
||||
scr_width, scr_height);
|
||||
vid.width, vid.height);
|
||||
vidmode_avail = vidmode_active = false;
|
||||
}
|
||||
}
|
||||
|
@ -465,7 +466,7 @@ X11_UpdateFullscreen (cvar_t *fullscreen)
|
|||
window_y = pos_y;
|
||||
window_saved = 1;
|
||||
|
||||
X11_SetVidMode (scr_width, scr_height);
|
||||
X11_SetVidMode (vid.width, vid.height);
|
||||
|
||||
if (!vidmode_active) {
|
||||
window_saved = 0;
|
||||
|
|
|
@ -59,7 +59,6 @@ qboolean vid_gamma_avail; // hardware gamma availability
|
|||
VISIBLE unsigned int d_8to24table[256];
|
||||
|
||||
/* Screen size */
|
||||
int scr_width, scr_height;
|
||||
cvar_t *vid_width;
|
||||
cvar_t *vid_height;
|
||||
|
||||
|
@ -110,12 +109,12 @@ VID_GetWindowSize (int def_w, int def_h)
|
|||
Cvar_SetFlags (vid_width, vid_width->flags | CVAR_ROM);
|
||||
Cvar_SetFlags (vid_height, vid_height->flags | CVAR_ROM);
|
||||
|
||||
scr_width = vid.width = vid_width->int_val;
|
||||
scr_height = vid.height = vid_height->int_val;
|
||||
vid.width = vid_width->int_val;
|
||||
vid.height = vid_height->int_val;
|
||||
|
||||
vid.aspect = (4.0 * vid.height) / (3.0 * vid.width);
|
||||
|
||||
con_width = Cvar_Get ("con_width", va ("%d", scr_width), CVAR_NONE, NULL,
|
||||
con_width = Cvar_Get ("con_width", va ("%d", vid.width), CVAR_NONE, NULL,
|
||||
"console effective width (GL only)");
|
||||
if ((pnum = COM_CheckParm ("-conwidth"))) {
|
||||
if (pnum >= com_argc - 1)
|
||||
|
|
|
@ -306,7 +306,7 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
fc = qf_fxMesaCreateContext (0, findres (&scr_width, &scr_height),
|
||||
fc = qf_fxMesaCreateContext (0, findres (&vid.width, &vid.height),
|
||||
GR_REFRESH_75Hz, attribs);
|
||||
if (!fc)
|
||||
Sys_Error ("Unable to create 3DFX context.");
|
||||
|
@ -327,7 +327,7 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
vid.initialized = true;
|
||||
|
||||
Sys_DPrintf ("Video mode %dx%d initialized.\n", scr_width, scr_height);
|
||||
Sys_DPrintf ("Video mode %dx%d initialized.\n", vid.width, vid.height);
|
||||
|
||||
vid.recalc_refdef = 1; // force a surface cache flush
|
||||
}
|
||||
|
|
|
@ -617,8 +617,8 @@ VISIBLE void
|
|||
GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
*x = *y = 0;
|
||||
*width = scr_width;
|
||||
*height = scr_height;
|
||||
*width = vid.width;
|
||||
*height = vid.height;
|
||||
}
|
||||
|
||||
VISIBLE qboolean
|
||||
|
|
|
@ -410,8 +410,8 @@ VID_Init (unsigned char *palette)
|
|||
return;
|
||||
|
||||
if (COM_CheckParm ("-novideo")) {
|
||||
scr_width = vid.width = 320;
|
||||
scr_height = vid.height = 200;
|
||||
vid.width = 320;
|
||||
vid.height = 200;
|
||||
vid.rowbytes = 320;
|
||||
vid.aspect = ((float) vid.height / (float) vid.width) * (4.0 / 3.0);
|
||||
vid.colormap8 = (byte *) vid_colormap;
|
||||
|
|
|
@ -218,8 +218,8 @@ VID_Init (unsigned char *palette)
|
|||
}
|
||||
x_vis = x_visinfo->visual;
|
||||
|
||||
X11_SetVidMode (scr_width, scr_height);
|
||||
X11_CreateWindow (scr_width, scr_height);
|
||||
X11_SetVidMode (vid.width, vid.height);
|
||||
X11_CreateWindow (vid.width, vid.height);
|
||||
X11_CreateNullCursor (); // hide mouse pointer
|
||||
|
||||
XSync (x_disp, 0);
|
||||
|
@ -238,7 +238,7 @@ VID_Init (unsigned char *palette)
|
|||
VID_Init8bitPalette ();
|
||||
VID_SetPalette (vid.palette);
|
||||
|
||||
Sys_DPrintf ("Video mode %dx%d initialized.\n", scr_width, scr_height);
|
||||
Sys_DPrintf ("Video mode %dx%d initialized.\n", vid.width, vid.height);
|
||||
|
||||
vid.initialized = true;
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ VID_Init (unsigned char *palette)
|
|||
for (j = 0; j < 5; j++) {
|
||||
for (k = 32; k >= 16; k -= 8) {
|
||||
SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, k);
|
||||
if ((screen = SDL_SetVideoMode (scr_width, scr_height,
|
||||
if ((screen = SDL_SetVideoMode (vid.width, vid.height,
|
||||
color[j], flags)))
|
||||
goto success;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ success:
|
|||
VID_SetPalette (vid.palette);
|
||||
VID_Init8bitPalette (); // Check for 3DFX Extensions and initialize them.
|
||||
|
||||
Sys_DPrintf ("Video mode %dx%d initialized.\n", scr_width, scr_height);
|
||||
Sys_DPrintf ("Video mode %dx%d initialized.\n", vid.width, vid.height);
|
||||
|
||||
vid.initialized = true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue