@@ -93,6 +93,64 @@ extern int s_rawend;
9393static void RoQ_init ( void );
9494static void CIN_SetLooping (int handle, qboolean loop);
9595
96+ static const char *CL_CinematicBasename ( const char *path )
97+ {
98+ const char *slash;
99+ const char *backslash;
100+
101+ if ( !path ) {
102+ return " " ;
103+ }
104+
105+ slash = strrchr ( path, ' /' );
106+ backslash = strrchr ( path, ' \\ ' );
107+
108+ if ( slash && ( !backslash || slash > backslash ) ) {
109+ return slash + 1 ;
110+ }
111+ if ( backslash ) {
112+ return backslash + 1 ;
113+ }
114+
115+ return path;
116+ }
117+
118+ static qboolean CL_ShouldSkipIdLogoCinematic ( const char *arg )
119+ {
120+ const char *base;
121+ const char *dot;
122+ size_t len;
123+
124+ if ( !Cvar_VariableIntegerValue ( " com_skipIdLogo" ) ) {
125+ return qfalse;
126+ }
127+
128+ base = CL_CinematicBasename ( arg );
129+ dot = strrchr ( base, ' .' );
130+ len = dot ? (size_t )( dot - base ) : strlen ( base );
131+
132+ if ( len != 6 || Q_stricmpn ( base, " idlogo" , 6 ) != 0 ) {
133+ return qfalse;
134+ }
135+
136+ if ( dot && Q_stricmp ( dot, " .roq" ) != 0 ) {
137+ return qfalse;
138+ }
139+
140+ return qtrue;
141+ }
142+
143+ static void CL_RunCinematicNextmap ( void )
144+ {
145+ const char *s;
146+
147+ s = Cvar_VariableString ( " nextmap" );
148+ if ( s[0 ] ) {
149+ Cbuf_ExecuteText ( EXEC_APPEND , va (" %s\n " , s) );
150+ Cvar_Set ( " nextmap" , " " );
151+ }
152+ }
153+
96154/* *****************************************************************************
97155*
98156* Class: trFMV
@@ -1329,8 +1387,6 @@ static void RoQ_init( void )
13291387******************************************************************************/
13301388
13311389static void RoQShutdown ( void ) {
1332- const char *s;
1333-
13341390 if (!cinTable[currentHandle].buf ) {
13351391 return ;
13361392 }
@@ -1349,11 +1405,7 @@ static void RoQShutdown( void ) {
13491405 // if we are aborting the intro cinematic with
13501406 // a devmap command, nextmap would be valid by
13511407 // the time it was referenced
1352- s = Cvar_VariableString ( " nextmap" );
1353- if ( s[0 ] ) {
1354- Cbuf_ExecuteText ( EXEC_APPEND , va (" %s\n " , s) );
1355- Cvar_Set ( " nextmap" , " " );
1356- }
1408+ CL_RunCinematicNextmap ();
13571409 CL_handle = -1 ;
13581410 }
13591411 cinTable[currentHandle].fileName [0 ] = ' \0 ' ;
@@ -1472,6 +1524,14 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
14721524 std::array<char , MAX_OSPATH > name;
14731525 int i;
14741526
1527+ if ( CL_ShouldSkipIdLogoCinematic ( arg )
1528+ && ( ( systemBits & CIN_system ) != 0 || cls.state < CA_LOADING ) ) {
1529+ if ( ( systemBits & CIN_system ) != 0 ) {
1530+ CL_RunCinematicNextmap ();
1531+ }
1532+ return -1 ;
1533+ }
1534+
14751535 if (strchr (arg, ' /' ) == nullptr && strchr (arg, ' \\ ' ) == nullptr ) {
14761536 Com_sprintf ( name.data (), static_cast <int >( name.size () ), " video/%s" , arg );
14771537 } else {
@@ -1694,13 +1754,18 @@ void CL_PlayCinematic_f( void ) {
16941754 int bits = CIN_system;
16951755
16961756 Com_DPrintf (" CL_PlayCinematic_f\n " );
1757+ arg = Cmd_Argv ( 1 );
1758+ s = Cmd_Argv (2 );
1759+
1760+ if ( CL_ShouldSkipIdLogoCinematic ( arg ) ) {
1761+ CL_RunCinematicNextmap ();
1762+ return ;
1763+ }
1764+
16971765 if (cls.state == CA_CINEMATIC ) {
16981766 SCR_StopCinematic ();
16991767 }
17001768
1701- arg = Cmd_Argv ( 1 );
1702- s = Cmd_Argv (2 );
1703-
17041769 if ((s && s[0 ] == ' 1' ) || Q_stricmp (arg," demoend.roq" )==0 || Q_stricmp (arg," end.roq" )==0 ) {
17051770 bits |= CIN_hold;
17061771 }
0 commit comments