diff --git a/libs/video/renderer/gl/gl_draw.c b/libs/video/renderer/gl/gl_draw.c index 77dc927e0..208f4d39f 100644 --- a/libs/video/renderer/gl/gl_draw.c +++ b/libs/video/renderer/gl/gl_draw.c @@ -783,9 +783,9 @@ Draw_FadeScreen (void) qfglBegin (GL_QUADS); qfglVertex2f (0, 0); - qfglVertex2f (vid.width, 0); - qfglVertex2f (vid.width, vid.height); - qfglVertex2f (0, vid.height); + qfglVertex2f (vid.conwidth, 0); + qfglVertex2f (vid.conwidth, vid.conheight); + qfglVertex2f (0, vid.conheight); qfglEnd (); qfglColor3ubv (color_white); @@ -806,7 +806,7 @@ GL_Set2D (void) qfglMatrixMode (GL_PROJECTION); qfglLoadIdentity (); - qfglOrtho (0, vid.width, vid.height, 0, -99999, 99999); + qfglOrtho (0, vid.conwidth, vid.conheight, 0, -99999, 99999); qfglMatrixMode (GL_MODELVIEW); qfglLoadIdentity (); diff --git a/libs/video/renderer/sw/draw.c b/libs/video/renderer/sw/draw.c index a853b9242..bbf8b2f2b 100644 --- a/libs/video/renderer/sw/draw.c +++ b/libs/video/renderer/sw/draw.c @@ -205,7 +205,7 @@ Draw_Character (int x, int y, unsigned int chr) if (y <= -8) return; // totally off screen - if (y > (int) vid.height - 8 || x < 0 || x > (int) vid.width - 8) + if (y > (int) vid.conheight - 8 || x < 0 || x > (int) vid.conwidth - 8) return; if (chr < 0 || chr > 255) return; @@ -360,8 +360,8 @@ Draw_Pic (int x, int y, qpic_t *pic) byte *dest, *source, tbyte; int v, u; - if (x < 0 || (unsigned int) (x + pic->width) > vid.width || y < 0 || - (unsigned int) (y + pic->height) > vid.height) { + if (x < 0 || (unsigned int) (x + pic->width) > vid.conwidth || y < 0 || + (unsigned int) (y + pic->height) > vid.conheight) { Sys_Error ("Draw_Pic: bad coordinates"); } @@ -412,8 +412,8 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, byte *dest, *source, tbyte; int u, v; - if ((x < 0) || (x + width > (int) vid.width) - || (y < 0) || (y + height > (int) vid.height)) { + if ((x < 0) || (x + width > (int) vid.conwidth) + || (y < 0) || (y + height > (int) vid.conheight)) { Sys_Error ("Draw_SubPic: bad coordinates"); } @@ -606,8 +606,8 @@ Draw_Fill (int x, int y, int w, int h, int c) byte *dest; int u, v; - if (x < 0 || x + w > (int) vid.width - || y < 0 || y + h > (int) vid.height) { + if (x < 0 || x + w > (int) vid.conwidth + || y < 0 || y + h > (int) vid.conheight) { Sys_Printf ("Bad Draw_Fill(%d, %d, %d, %d, %c)\n", x, y, w, h, c); return; } @@ -629,13 +629,13 @@ Draw_FadeScreen (void) S_ExtraUpdate (); VID_LockBuffer (); - for (y = 0; y < vid.height; y++) { + for (y = 0; y < vid.conheight; y++) { unsigned int t; pbuf = ((byte *)vid.buffer) + vid.rowbytes * y; t = (y & 1) << 1; - for (x = 0; x < vid.width; x++) { + for (x = 0; x < vid.conwidth; x++) { if ((x & 3) != t) pbuf[x] = 0; } diff --git a/libs/video/renderer/sw32/draw.c b/libs/video/renderer/sw32/draw.c index 9b3ab4166..9163ca4b0 100644 --- a/libs/video/renderer/sw32/draw.c +++ b/libs/video/renderer/sw32/draw.c @@ -204,7 +204,7 @@ Draw_Character (int x, int y, unsigned int chr) if (y <= -8) return; // totally off screen - if (y > (int) vid.height - 8 || x < 0 || x > (int) vid.width - 8) + if (y > (int) vid.conheight - 8 || x < 0 || x > (int) vid.conwidth - 8) return; if (chr < 0 || chr > 255) return; @@ -433,8 +433,8 @@ Draw_Pic (int x, int y, qpic_t *pic) byte *source, tbyte; int v, u; - if (x < 0 || (unsigned int) (x + pic->width) > vid.width || y < 0 || - (unsigned int) (y + pic->height) > vid.height) { + if (x < 0 || (unsigned int) (x + pic->width) > vid.conwidth || y < 0 || + (unsigned int) (y + pic->height) > vid.conheight) { Sys_Error ("Draw_Pic: bad coordinates"); } @@ -525,8 +525,8 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, byte *source, tbyte; int v, u; - if ((x < 0) || (x + width > (int) vid.width) - || (y < 0) || (y + height > (int) vid.height)) { + if ((x < 0) || (x + width > (int) vid.conwidth) + || (y < 0) || (y + height > (int) vid.conheight)) { Sys_Error ("Draw_SubPic: bad coordinates"); } @@ -1018,8 +1018,8 @@ Draw_Fill (int x, int y, int w, int h, int c) { int u, v; - if (x < 0 || x + w > (int) vid.width - || y < 0 || y + h > (int) vid.height) { + if (x < 0 || x + w > (int) vid.conwidth + || y < 0 || y + h > (int) vid.conheight) { Sys_Printf ("Bad Draw_Fill(%d, %d, %d, %d, %c)\n", x, y, w, h, c); return; } @@ -1071,12 +1071,12 @@ Draw_FadeScreen (void) switch(r_pixbytes) { case 1: { - for (y = 0; y < vid.height; y++) { + for (y = 0; y < vid.conheight; y++) { unsigned int t; byte *pbuf = (byte *) ((byte *) vid.buffer + vid.rowbytes * y); t = (y & 1) << 1; - for (x = 0; x < vid.width; x++) { + for (x = 0; x < vid.conwidth; x++) { if ((x & 3) != t) pbuf[x] = 0; } @@ -1085,21 +1085,21 @@ Draw_FadeScreen (void) break; case 2: { - for (y = 0; y < vid.height; y++) { + for (y = 0; y < vid.conheight; y++) { unsigned short *pbuf = (unsigned short *) ((byte *) vid.buffer + vid.rowbytes * y); pbuf = (unsigned short *) vid.buffer + (vid.rowbytes >> 1) * y; - for (x = 0; x < vid.width; x++) + for (x = 0; x < vid.conwidth; x++) pbuf[x] = (pbuf[x] >>= 1) & 0x7BEF; } } break; case 4: { - for (y = 0; y < vid.height; y++) { + for (y = 0; y < vid.conheight; y++) { unsigned int *pbuf = (unsigned int *) ((byte *) vid.buffer + vid.rowbytes * y); - for (x = 0; x < vid.width; x++) + for (x = 0; x < vid.conwidth; x++) pbuf[x] = (pbuf[x] >>= 1) & 0x7F7F7F7F; } } diff --git a/libs/video/targets/vid_3dfxsvga.c b/libs/video/targets/vid_3dfxsvga.c index ae3d9915a..26b961877 100644 --- a/libs/video/targets/vid_3dfxsvga.c +++ b/libs/video/targets/vid_3dfxsvga.c @@ -304,10 +304,6 @@ VID_Init (unsigned char *palette) attribs[4] = 1; attribs[5] = FXMESA_NONE; - 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), diff --git a/libs/video/targets/vid_common_sw.c b/libs/video/targets/vid_common_sw.c index 036c9d1cf..d049e77c0 100644 --- a/libs/video/targets/vid_common_sw.c +++ b/libs/video/targets/vid_common_sw.c @@ -44,6 +44,10 @@ VID_InitBuffers (void) { int buffersize, zbuffersize, cachesize = 1; + // No console scaling in the sw renderer + vid.conwidth = vid.width; + vid.conheight = vid.height; + // Calculate the sizes we want first buffersize = vid.rowbytes * vid.height; zbuffersize = vid.width * vid.height * sizeof (*vid.zbuffer); diff --git a/libs/video/targets/vid_common_sw32.c b/libs/video/targets/vid_common_sw32.c index f16fc9f83..e449f6380 100644 --- a/libs/video/targets/vid_common_sw32.c +++ b/libs/video/targets/vid_common_sw32.c @@ -208,6 +208,10 @@ VID_InitBuffers (void) { int buffersize, zbuffersize, cachesize = 1; + // No console scaling in the sw renderer + vid.conwidth = vid.width; + vid.conheight = vid.height; + // Calculate the sizes we want first buffersize = vid.rowbytes * vid.height; zbuffersize = vid.width * vid.height * sizeof (*vid.zbuffer); diff --git a/libs/video/targets/vid_glx.c b/libs/video/targets/vid_glx.c index 9618ea1e6..4bce5fa05 100644 --- a/libs/video/targets/vid_glx.c +++ b/libs/video/targets/vid_glx.c @@ -208,10 +208,6 @@ VID_Init (unsigned char *palette) vid.colormap8 = vid_colormap; vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); - 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 (); diff --git a/libs/video/targets/vid_sdl.c b/libs/video/targets/vid_sdl.c index cd7f02bcd..3debb4481 100644 --- a/libs/video/targets/vid_sdl.c +++ b/libs/video/targets/vid_sdl.c @@ -108,8 +108,8 @@ VID_Init (unsigned char *palette) VID_SetPalette (vid.palette); // now know everything we need to know about the buffer - VGA_width = vid.conwidth = vid.width; - VGA_height = vid.conheight = vid.height; + VGA_width = vid.width; + VGA_height = vid.height; Con_CheckResize (); // Now that we have a window size, fix console vid.numpages = 1; vid.colormap8 = vid_colormap; diff --git a/libs/video/targets/vid_sdl32.c b/libs/video/targets/vid_sdl32.c index 64d96b790..bbdc2e7da 100644 --- a/libs/video/targets/vid_sdl32.c +++ b/libs/video/targets/vid_sdl32.c @@ -149,8 +149,8 @@ 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; + VGA_width = vid.width; + VGA_height = vid.height; Con_CheckResize (); // Now that we have a window size, fix console vid.numpages = 1; if (vid_colormap) diff --git a/libs/video/targets/vid_sgl.c b/libs/video/targets/vid_sgl.c index f83e7946b..759910946 100644 --- a/libs/video/targets/vid_sgl.c +++ b/libs/video/targets/vid_sgl.c @@ -117,17 +117,6 @@ VID_Init (unsigned char *palette) vid.colormap8 = vid_colormap; vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); - vid.conwidth &= 0xfff8; // make it a multiple of eight - if (vid.conwidth < 320) - vid.conwidth = 320; - - // pick a conheight that matches with correct aspect - vid.conheight = (vid.conwidth * 3) / 4; - - i = COM_CheckParm ("-conheight"); - if (i != 0) // Set console height, no smaller than 200 - vid.conheight = max (atoi (com_argv[i + 1]), 200); - // Check if we want fullscreen if (vid_fullscreen->int_val) { flags |= SDL_FULLSCREEN; @@ -176,9 +165,6 @@ VID_Init (unsigned char *palette) SDL_Quit (); success: - 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 vid.numpages = 2; diff --git a/libs/video/targets/vid_svgalib.c b/libs/video/targets/vid_svgalib.c index e9bdeb26e..6bf00d313 100644 --- a/libs/video/targets/vid_svgalib.c +++ b/libs/video/targets/vid_svgalib.c @@ -307,8 +307,6 @@ VID_SetMode (int modenum, unsigned char *palette) vid.colormap8 = (byte *) vid_colormap; vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); vid.conrowbytes = vid.rowbytes; - vid.conwidth = vid.width; - vid.conheight = vid.height; vid.numpages = 1; // alloc screen buffer, z-buffer, and surface cache diff --git a/libs/video/targets/vid_x11.c b/libs/video/targets/vid_x11.c index c6c1fef19..77e59545c 100644 --- a/libs/video/targets/vid_x11.c +++ b/libs/video/targets/vid_x11.c @@ -383,8 +383,6 @@ x11_init_buffers (void) } vid.conbuffer = vid.buffer; - vid.conwidth = vid.width; - vid.conheight = vid.height; vid.conrowbytes = vid.rowbytes; Con_CheckResize (); // Now that we have a window size, fix console }