The first messages on the console now wrap like they should, to the window

width instead of to 40 characters.
This commit is contained in:
Jeff Teunissen 2001-01-09 00:03:08 +00:00
parent 91bfddbf58
commit 8247d35d32
8 changed files with 15 additions and 28 deletions

View file

@ -45,12 +45,10 @@ cvar_t *vid_height;
void void
VID_GetWindowSize (int def_w, int def_h) VID_GetWindowSize (int def_w, int def_h)
{ {
int pnum; int pnum;
vid_width = vid_width = Cvar_Get ("vid_width", va ("%d", def_w), CVAR_NONE, "screen width");
Cvar_Get ("vid_width", va ("%d", def_w), CVAR_NONE, "screen width"); vid_height = Cvar_Get ("vid_height", va ("%d", def_h), CVAR_NONE, "screen height");
vid_height =
Cvar_Get ("vid_height", va ("%d", def_h), CVAR_NONE, "screen height");
if ((pnum = COM_CheckParm ("-width"))) { if ((pnum = COM_CheckParm ("-width"))) {
if (pnum >= com_argc - 1) if (pnum >= com_argc - 1)

View file

@ -219,6 +219,7 @@ VID_Init (unsigned char *palette)
GLint attribs[32]; GLint attribs[32];
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;

View file

@ -296,29 +296,7 @@ VID_Init (unsigned char *pal)
/* Go into async mode */ /* Go into async mode */
ggiSetFlags (ggivis, GGIFLAG_ASYNC); ggiSetFlags (ggivis, GGIFLAG_ASYNC);
/* check for command-line window size */ VID_GetWindowSize (320, 200);
if ((pnum = COM_CheckParm ("-winsize"))) {
if (pnum >= com_argc - 2)
Sys_Error ("VID: -winsize <width> <height>\n");
vid.width = atoi (com_argv[pnum + 1]);
vid.height = atoi (com_argv[pnum + 2]);
if (!vid.width || !vid.height)
Sys_Error ("VID: Bad window width/height\n");
}
if ((pnum = COM_CheckParm ("-width"))) {
if (pnum >= com_argc - 1)
Sys_Error ("VID: -width <width>\n");
vid.width = atoi (com_argv[pnum + 1]);
if (!vid.width)
Sys_Error ("VID: Bad window width\n");
}
if ((pnum = COM_CheckParm ("-height"))) {
if (pnum >= com_argc - 1)
Sys_Error ("VID: -height <height>\n");
vid.height = atoi (com_argv[pnum + 1]);
if (!vid.height)
Sys_Error ("VID: Bad window height\n");
}
scale = COM_CheckParm ("-scale"); scale = COM_CheckParm ("-scale");
@ -387,6 +365,7 @@ VID_Init (unsigned char *pal)
vid.width = realwidth; vid.width = realwidth;
vid.height = realheight; vid.height = realheight;
} }
Con_CheckResize (); // Now that we have a window size, fix console
if (mode.frames >= 2) if (mode.frames >= 2)
doublebuffer = 1; doublebuffer = 1;

View file

@ -145,6 +145,8 @@ VID_Init (unsigned char *palette)
}; };
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;
vid.colormap = host_colormap; vid.colormap = host_colormap;

View file

@ -38,6 +38,7 @@
#include <SDL.h> #include <SDL.h>
#include "console.h"
#include "cvar.h" #include "cvar.h"
#include "d_local.h" #include "d_local.h"
#include "host.h" #include "host.h"
@ -143,6 +144,8 @@ 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;

View file

@ -189,6 +189,7 @@ VID_Init (unsigned char *palette)
vid.height = vid.conheight = min (vid.conheight, scr_height); vid.height = vid.conheight = min (vid.conheight, scr_height);
vid.width = vid.conwidth = min (vid.conwidth, scr_width); vid.width = vid.conwidth = min (vid.conwidth, scr_width);
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 = 2; vid.numpages = 2;

View file

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

View file

@ -513,6 +513,8 @@ 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.maxwarpwidth = WARP_WIDTH; vid.maxwarpwidth = WARP_WIDTH;
vid.maxwarpheight = WARP_HEIGHT; vid.maxwarpheight = WARP_HEIGHT;
vid.numpages = 2; vid.numpages = 2;