]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Host_Main improvements. Workaround to avoid crash with +map no longer needed.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 19 Jun 2020 15:24:18 +0000 (15:24 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 19 Jun 2020 15:24:18 +0000 (15:24 +0000)
* FreeType2 now tries to load by default, regardless of game.
  This fixes font issues if this cvar is turned off after the subsystem
  is already initialized. This has no side effects in Quake as far as I
  can tell.

* Host_StartVideo has been moved to CL_Init where it honestly should be.
  This makes it easier to initialize the engine without a client
  compiled in. The FT2 fix allows initialization to happen early without
  screwing with the fonts.

* VID_Start will now parse +vid_width and +vid_height just the same as
  -width and -height, as well as +vid_fullscreen 1 and 0 for -fullscreen
  and -window respectively.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12699 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
cmd.c
ft2.c
host.c
vid_shared.c

index 45eeac779c654840d453a68688f0382e8c774172..4f87574316b38ea2198a24cb6b87acfd9db05ea1 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -2776,5 +2776,7 @@ void CL_Init (void)
                CL_MeshEntities_Init();
 
                CL_Video_Init();
+               Host_StartVideo();
+
        }
 }
diff --git a/cmd.c b/cmd.c
index 010568de53985ecae6fe27ca0a46077d3258b98a..f3d0a1cb1a5bbefeb92db6535b33eba2d03e4f3d 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -411,10 +411,6 @@ static void Cmd_StuffCmds_f (cmd_state_t *cmd)
        // this is for all commandline options combined (and is bounds checked)
        char    build[MAX_INPUTLINE];
 
-       // come back later so we don't crash
-       if(host.state == host_init)
-               return;
-
        if (Cmd_Argc (cmd) != 1)
        {
                Con_Print("stuffcmds : execute command line parameters\n");
diff --git a/ft2.c b/ft2.c
index 9eff4a2b7777a45756ae839753896a0920d19629..906ad70ceae4e7d49c486ab5c62fbe752e6ed3ca 100644 (file)
--- a/ft2.c
+++ b/ft2.c
@@ -33,7 +33,7 @@ CVars introduced with the freetype extension
 ================================================================================
 */
 
-cvar_t r_font_disable_freetype = {CVAR_CLIENT | CVAR_SAVE, "r_font_disable_freetype", "1", "disable freetype support for fonts entirely"};
+cvar_t r_font_disable_freetype = {CVAR_CLIENT | CVAR_SAVE, "r_font_disable_freetype", "0", "disable freetype support for fonts entirely"};
 cvar_t r_font_use_alpha_textures = {CVAR_CLIENT | CVAR_SAVE, "r_font_use_alpha_textures", "0", "use alpha-textures for font rendering, this should safe memory"};
 cvar_t r_font_size_snapping = {CVAR_CLIENT | CVAR_SAVE, "r_font_size_snapping", "1", "stick to good looking font sizes whenever possible - bad when the mod doesn't support it!"};
 cvar_t r_font_kerning = {CVAR_CLIENT | CVAR_SAVE, "r_font_kerning", "1", "Use kerning if available"};
diff --git a/host.c b/host.c
index 0d33ce2d88390e7553555181adb90e3159548711..7959dd570c762feb193d399ad7cedf37e0a2a387 100644 (file)
--- a/host.c
+++ b/host.c
@@ -1286,8 +1286,6 @@ static void Host_Init (void)
 
        Host_AddConfigText(cmd);
 
-       Host_StartVideo();
-
        // if quake.rc is missing, use default
        if (!FS_FileExists("quake.rc"))
        {
@@ -1297,10 +1295,6 @@ static void Host_Init (void)
 
        host.state = host_active;
 
-       // run stuffcmds now, deferred previously because it can crash if a server starts that early
-       Cbuf_AddText(cmd,"stuffcmds\n");
-       Cbuf_Execute(cmd);
-
        Log_Start();
        
        // put up the loading image so the user doesn't stare at a black screen...
index 580d9b33002fc327574b29e5d500832a87685ce3..c35dbffd2fe64c25ba6c7b098719e660d1f7e5bf 100644 (file)
@@ -1507,24 +1507,25 @@ const char *vidfallbacks[][2] =
 // this is only called once by Host_StartVideo and again on each FS_GameDir_f
 void VID_Start(void)
 {
-       int i, width, height, success;
+       int i = 0;
+       int width, height, success;
        if (vid_commandlinecheck)
        {
                // interpret command-line parameters
                vid_commandlinecheck = false;
 // COMMANDLINEOPTION: Video: -window performs +vid_fullscreen 0
-               if (COM_CheckParm("-window") || COM_CheckParm("-safe"))
+               if (COM_CheckParm("-window") || COM_CheckParm("-safe") || (i = COM_CheckParm("+vid_fullscreen") != 0 && atoi(sys.argv[i+1]) == 0))
                        Cvar_SetValueQuick(&vid_fullscreen, false);
 // COMMANDLINEOPTION: Video: -fullscreen performs +vid_fullscreen 1
-               if (COM_CheckParm("-fullscreen"))
+               if (COM_CheckParm("-fullscreen") || (i = COM_CheckParm("+vid_fullscreen") != 0 && atoi(sys.argv[i+1]) == 1))
                        Cvar_SetValueQuick(&vid_fullscreen, true);
                width = 0;
                height = 0;
 // COMMANDLINEOPTION: Video: -width <pixels> performs +vid_width <pixels> and also +vid_height <pixels*3/4> if only -width is specified (example: -width 1024 sets 1024x768 mode)
-               if ((i = COM_CheckParm("-width")) != 0)
+               if ((i = COM_CheckParm("-width")) != 0 || (i = COM_CheckParm("+vid_width") != 0))
                        width = atoi(sys.argv[i+1]);
 // COMMANDLINEOPTION: Video: -height <pixels> performs +vid_height <pixels> and also +vid_width <pixels*4/3> if only -height is specified (example: -height 768 sets 1024x768 mode)
-               if ((i = COM_CheckParm("-height")) != 0)
+               if ((i = COM_CheckParm("-height")) != 0 || (i = COM_CheckParm("+vid_height") != 0))
                        height = atoi(sys.argv[i+1]);
                if (width == 0)
                        width = height * 4 / 3;