]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_video.c
Add _DrawQ_ProcessDrawFlag to clean-up the glblend setup code.
[xonotic/darkplaces.git] / cl_video.c
index fabce36c33d626199edd0b9384d205969f0e77f0..8ea468b3475ed546b02eb6ac8a8307bd4770b776 100644 (file)
@@ -189,7 +189,7 @@ static void VideoFrame( clvideo_t *video )
        if( video->state == CLVIDEO_FIRSTFRAME )
                destframe = 0;
        else
-               destframe = (realtime - video->starttime) * video->framerate;
+               destframe = (int)((realtime - video->starttime) * video->framerate);
        if( destframe < 0 )
                destframe = 0;
        if( video->framenum < destframe ) {
@@ -276,6 +276,16 @@ void CL_VideoStart(char *filename)
        CL_RestartVideo( cl_videos );
 }
 
+void CL_Video_KeyEvent( int key, int ascii, qboolean down ) 
+{
+       // only react to up events, to allow the user to delay the abortion point if it suddenly becomes interesting..
+       if( !down ) {
+               if( key == K_ESCAPE || key == K_ENTER || key == K_SPACE ) {
+                       CL_VideoStop();
+               }
+       }
+}
+
 void CL_VideoStop(void)
 {
        cl_videoplaying = false;