From: havoc Date: Sun, 20 Mar 2011 13:32:18 +0000 (+0000) Subject: make it easier to benchmark steelstorm by stopping video playback when X-Git-Tag: xonotic-v0.6.0~163^2~601 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=ceef40ca3c9282f8fc7d44e54998923257889bfb 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 --- diff --git a/cl_main.c b/cl_main.c index e5f6fef1..b195ddaa 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 29eb8b72..1f229fd6 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"); Collision_Cache_Reset(true); diff --git a/cl_video.c b/cl_video.c index 28be575a..4e37eb75 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");