mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
fix various sizing issues
This commit is contained in:
parent
c903cfdb78
commit
dc9d2c89da
10 changed files with 35 additions and 33 deletions
|
@ -221,8 +221,6 @@ Resize (old_console_t *con)
|
|||
|
||||
con->current = con_totallines - 1;
|
||||
con->display = con->current;
|
||||
|
||||
view_resize (con_data.view, vid.width, vid.height);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -235,6 +233,8 @@ C_CheckResize (void)
|
|||
{
|
||||
Resize (&con_main);
|
||||
Resize (&con_chat);
|
||||
|
||||
view_resize (con_data.view, vid.conwidth, vid.conheight);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -183,8 +183,8 @@ view_draw (view_t *view)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
view_resize (view_t *view, int xl, int yl)
|
||||
static void
|
||||
_resize (view_t *view, int xl, int yl)
|
||||
{
|
||||
int i, xd, yd;
|
||||
|
||||
|
@ -192,30 +192,30 @@ view_resize (view_t *view, int xl, int yl)
|
|||
yd = yl - view->ylen;
|
||||
view->xlen = xl;
|
||||
view->ylen = yl;
|
||||
setgeometry (view);
|
||||
for (i = 0; i < view->num_children; i++) {
|
||||
view_t *v = view->children[i];
|
||||
|
||||
if (v->resize_x && v->resize_y) {
|
||||
view_resize (v, v->xlen + xd, v->ylen + yd);
|
||||
_resize (v, v->xlen + xd, v->ylen + yd);
|
||||
} else if (v->resize_x) {
|
||||
view_resize (v, v->xlen + xd, v->ylen);
|
||||
_resize (v, v->xlen + xd, v->ylen);
|
||||
} else if (v->resize_y) {
|
||||
view_resize (v, v->xlen, v->ylen + yd);
|
||||
} else {
|
||||
setgeometry (v);
|
||||
_resize (v, v->xlen, v->ylen + yd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
view_resize (view_t *view, int xl, int yl)
|
||||
{
|
||||
_resize (view, xl, yl);
|
||||
setgeometry (view);
|
||||
}
|
||||
|
||||
void
|
||||
view_move (view_t *view, int xp, int yp)
|
||||
{
|
||||
int i;
|
||||
|
||||
view->xpos = xp;
|
||||
view->ypos = yp;
|
||||
setgeometry (view);
|
||||
for (i = 0; i < view->num_children; i++)
|
||||
setgeometry (view->children[i]);
|
||||
}
|
||||
|
|
|
@ -113,8 +113,8 @@ VID_GetWindowSize (int def_w, int def_h)
|
|||
scr_width = vid.width = vid_width->int_val;
|
||||
scr_height = vid.height = vid_height->int_val;
|
||||
|
||||
vid_conwidth = Cvar_Get ("vid_conwidth", va ("%d", def_w), CVAR_NONE, NULL,
|
||||
"console effective width (GL only)");
|
||||
vid_conwidth = Cvar_Get ("vid_conwidth", va ("%d", scr_width), CVAR_NONE,
|
||||
NULL, "console effective width (GL only)");
|
||||
if ((pnum = COM_CheckParm ("-conwidth"))) {
|
||||
if (pnum >= com_argc - 1)
|
||||
Sys_Error ("VID: -conwidth <width>");
|
||||
|
|
|
@ -286,7 +286,6 @@ VID_Init (unsigned char *palette)
|
|||
"fxMesaSwapBuffers", true);
|
||||
|
||||
VID_GetWindowSize (640, 480);
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -308,13 +307,19 @@ VID_Init (unsigned char *palette)
|
|||
vid.conwidth = max (vid.conwidth, 320);
|
||||
|
||||
// pick a conheight that matches with correct aspect
|
||||
vid.conheight = vid.conwidth * 3 / 4;
|
||||
vid.conheight = (vid.conwidth * 3) / 4;
|
||||
|
||||
if ((i = COM_CheckParm ("-conheight")) != 0)
|
||||
vid.conheight = atoi (com_argv[i + 1]);
|
||||
|
||||
vid.conheight = max (vid.conheight, 200);
|
||||
|
||||
vid.width = vid.conwidth = min (vid.conwidth, (unsigned int) scr_width);
|
||||
vid.height = vid.conheight = min (vid.conheight,
|
||||
(unsigned int) scr_height);
|
||||
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
fc = qf_fxMesaCreateContext (0, findres (&scr_width, &scr_height),
|
||||
GR_REFRESH_75Hz, attribs);
|
||||
if (!fc)
|
||||
|
@ -322,10 +327,6 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
qf_fxMesaMakeCurrent (fc);
|
||||
|
||||
vid.width = vid.conwidth = min (vid.conwidth, (unsigned int) scr_width);
|
||||
vid.height = vid.conheight = min (vid.conheight,
|
||||
(unsigned int) scr_height);
|
||||
|
||||
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
|
||||
vid.numpages = 2;
|
||||
|
||||
|
|
|
@ -203,7 +203,6 @@ VID_Init (unsigned char *palette)
|
|||
"quake window in a virtual desktop.\n");
|
||||
|
||||
VID_GetWindowSize (640, 480);
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -214,12 +213,18 @@ VID_Init (unsigned char *palette)
|
|||
vid.conwidth = max (vid.conwidth, 320);
|
||||
|
||||
// pick a conheight that matches with correct aspect
|
||||
vid.conheight = vid.conwidth * 3 / 4;
|
||||
vid.conheight = (vid.conwidth * 3) / 4;
|
||||
|
||||
if ((i = COM_CheckParm ("-conheight"))) // conheight no smaller than 200p
|
||||
vid.conheight = atoi (com_argv[i + 1]);
|
||||
vid.conheight = max (vid.conheight, 200);
|
||||
|
||||
vid.height = vid.conheight = min (vid.conheight,
|
||||
(unsigned int) scr_height);
|
||||
vid.width = vid.conwidth = min (vid.conwidth, (unsigned int) scr_width);
|
||||
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
X11_OpenDisplay ();
|
||||
|
||||
x_visinfo = qfglXChooseVisual (x_disp, x_screen, attrib);
|
||||
|
@ -238,10 +243,6 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
qfglXMakeCurrent (x_disp, x_win, ctx);
|
||||
|
||||
vid.height = vid.conheight = min (vid.conheight,
|
||||
(unsigned int) scr_height);
|
||||
vid.width = vid.conwidth = min (vid.conwidth, (unsigned int) scr_width);
|
||||
|
||||
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
|
||||
vid.numpages = 2;
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
// Set up display mode (width and height)
|
||||
VID_GetWindowSize (BASEWIDTH, BASEHEIGHT);
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
// Set video width, height and flags
|
||||
flags = (SDL_SWSURFACE | SDL_HWPALETTE);
|
||||
|
@ -111,6 +110,7 @@ VID_Init (unsigned char *palette)
|
|||
// now know everything we need to know about the buffer
|
||||
VGA_width = vid.conwidth = vid.width;
|
||||
VGA_height = vid.conheight = vid.height;
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
|
||||
vid.numpages = 1;
|
||||
vid.colormap8 = vid_colormap;
|
||||
|
|
|
@ -94,7 +94,6 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
// Set up display mode (width and height)
|
||||
VID_GetWindowSize (BASEWIDTH, BASEHEIGHT);
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -147,6 +146,7 @@ VID_Init (unsigned char *palette)
|
|||
// now we know everything we need to know about the buffer
|
||||
VGA_width = vid.conwidth = vid.width;
|
||||
VGA_height = vid.conheight = vid.height;
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
|
||||
vid.numpages = 1;
|
||||
if (vid_colormap)
|
||||
|
|
|
@ -122,7 +122,7 @@ VID_Init (unsigned char *palette)
|
|||
vid.conwidth = 320;
|
||||
|
||||
// pick a conheight that matches with correct aspect
|
||||
vid.conheight = vid.conwidth * 3 / 4;
|
||||
vid.conheight = (vid.conwidth * 3) / 4;
|
||||
|
||||
i = COM_CheckParm ("-conheight");
|
||||
if (i != 0) // Set console height, no smaller than 200
|
||||
|
|
|
@ -966,7 +966,7 @@ VID_Init (unsigned char *palette)
|
|||
vid.conwidth = 320;
|
||||
|
||||
// pick a conheight that matches with correct aspect
|
||||
vid.conheight = vid.conwidth * 3 / 4;
|
||||
vid.conheight = (vid.conwidth * 3) / 4;
|
||||
|
||||
if ((i = COM_CheckParm ("-conheight")) != 0)
|
||||
vid.conheight = atoi (com_argv[i + 1]);
|
||||
|
|
|
@ -384,6 +384,7 @@ x11_init_buffers (void)
|
|||
vid.conwidth = vid.width;
|
||||
vid.conheight = vid.height;
|
||||
vid.conrowbytes = vid.rowbytes;
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
|
||||
}
|
||||
|
@ -422,7 +423,6 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
vid.width = vid_width->int_val;
|
||||
vid.height = vid_height->int_val;
|
||||
Con_CheckResize (); // Now that we have a window size, fix console
|
||||
|
||||
vid.numpages = 2;
|
||||
vid.colormap8 = vid_colormap;
|
||||
|
|
Loading…
Reference in a new issue