]> 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)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 20 Mar 2011 18:56:50 +0000 (19:56 +0100)
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
cl_parse.c
cl_video.c

index cc3315f2c9414f2b77a50626244cac16da3d352a..35a84c48d4e71d1f68acbcf7eaa2ca13d97dcfa1 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 08c726faa80bfd469dea4600b86a5845cc50308f..ed97cd86d5dfbe510b4aa904cc373d12377baa73 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");
 
        // if server is active, we already began a loading plaque
index 2db4756e84f94880baaf98eb6b7e17a7dc051de4..7ed332b49ca713d95a9b9a2dc0731508b87f70b5 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");