From 408473fbd776751beb25b9fd88b2bd50ecea0aa6 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 20 Mar 2011 13:32:18 +0000 Subject: [PATCH] make it easier to benchmark steelstorm by stopping video playback when a serverinfo packet is received, and ignoring attempts to connect to a server when -benchmark is used git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10945 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=ceef40ca3c9282f8fc7d44e54998923257889bfb --- cl_main.c | 4 ++++ cl_parse.c | 4 ++++ cl_video.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/cl_main.c b/cl_main.c index cc3315f2..35a84c48 100644 --- a/cl_main.c +++ b/cl_main.c @@ -416,6 +416,10 @@ void CL_EstablishConnection(const char *host, int firstarg) if (cls.state == ca_dedicated) return; + // don't connect to a server if we're benchmarking a demo + if (COM_CheckParm("-benchmark")) + return; + // clear menu's connect error message M_Update_Return_Reason(""); cls.demonum = -1; diff --git a/cl_parse.c b/cl_parse.c index 08c726fa..ed97cd86 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "libcurl.h" #include "utf8lib.h" #include "menu.h" +#include "cl_video.h" const char *svc_strings[128] = { @@ -1619,6 +1620,9 @@ void CL_ParseServerInfo (void) protocolversion_t protocol; int nummodels, numsounds; + // if we start loading a level and a video is still playing, stop it + CL_VideoStop(); + Con_DPrint("Serverinfo packet received.\n"); // if server is active, we already began a loading plaque diff --git a/cl_video.c b/cl_video.c index 2db4756e..7ed332b4 100644 --- a/cl_video.c +++ b/cl_video.c @@ -613,6 +613,9 @@ static void CL_PlayVideo_f(void) Host_StartVideo(); + if (COM_CheckParm("-benchmark")) + return; + if (Cmd_Argc() < 2) { Con_Print("usage: playvideo [custom_subtitles_file]\nplays video named video/.dpv\nif custom subtitles file is not presented\nit tries video/.sub"); -- 2.39.2