From 4719703516db89df5962791c31e243e036f123b8 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 29 Nov 2002 00:33:13 +0000 Subject: [PATCH] -width and -height can now be used alone (instead of having to use both) for better compatibility with stock glquake behavior git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2658 d7cf8633-e32d-0410-b094-e92efae38249 --- vid_shared.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/vid_shared.c b/vid_shared.c index 2b1b370c..89bfdfac 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -520,7 +520,7 @@ void VID_Restart_f(void) int vid_commandlinecheck = true; void VID_Open(void) { - int i; + int i, width, height; if (vid_commandlinecheck) { // interpret command-line parameters @@ -529,10 +529,20 @@ void VID_Open(void) Cvar_SetValueQuick(&vid_fullscreen, false); if ((i = COM_CheckParm("-fullscreen")) != 0) Cvar_SetValueQuick(&vid_fullscreen, true); + width = 0; + height = 0; if ((i = COM_CheckParm("-width")) != 0) - Cvar_SetQuick(&vid_width, com_argv[i+1]); + width = atoi(com_argv[i+1]); if ((i = COM_CheckParm("-height")) != 0) - Cvar_SetQuick(&vid_height, com_argv[i+1]); + height = atoi(com_argv[i+1]); + if (width == 0) + width = height * 4 / 3; + if (height == 0) + height = width * 3 / 4; + if (width) + Cvar_SetValueQuick(&vid_width, width); + if (height) + Cvar_SetValueQuick(&vid_height, height); if ((i = COM_CheckParm("-bpp")) != 0) Cvar_SetQuick(&vid_bitsperpixel, com_argv[i+1]); if ((i = COM_CheckParm("-nostencil")) != 0) -- 2.39.2