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