]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
make it easier to benchmark steelstorm by stopping video playback when
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 Mar 2011 13:32:18 +0000 (13:32 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 Mar 2011 13:32:18 +0000 (13:32 +0000)
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

cl_main.c
cl_parse.c
cl_video.c

index e5f6fef1cd9c2166375966332043f379e6e7968a..b195ddaaf98736e5e12dddbc7135d8395d660216 100644 (file)
--- 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;
index 29eb8b726760437a2425bf91643cf1c6ec06bca8..1f229fd6a51177b0af6a6083c4cba0f5373cb3b5 100644 (file)
@@ -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);
 
index 28be575a0a5d587888d9789e6e6ee4726a8c3186..4e37eb7548dc46ab6220bacb921991c93e34ff79 100644 (file)
@@ -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 <videoname> [custom_subtitles_file]\nplays video named video/<videoname>.dpv\nif custom subtitles file is not presented\nit tries video/<videoname>.sub");