video->imagedata = Mem_Alloc( cls.permanentmempool, video->cpif.width * video->cpif.height * cl_videobytesperpixel );
video->cpif.tex = R_LoadTexture2D( cl_videotexturepool, video->cpif.name,
- video->cpif.width, video->cpif.height, NULL, TEXTYPE_RGBA, 0, NULL );
+ video->cpif.width, video->cpif.height, NULL, TEXTYPE_RGBA, TEXF_ALWAYSPRECACHE, NULL );
// update starttime
video->starttime += realtime - video->lasttime;
video->cpif.width = dpvsimpledecode_getwidth( video->stream );
video->cpif.height = dpvsimpledecode_getheight( video->stream );
video->cpif.tex = R_LoadTexture2D( cl_videotexturepool, video->cpif.name,
- video->cpif.width, video->cpif.height, NULL, TEXTYPE_RGBA, 0, NULL );
+ video->cpif.width, video->cpif.height, NULL, TEXTYPE_RGBA, TEXF_ALWAYSPRECACHE, NULL );
video->imagedata = Mem_Alloc( cls.permanentmempool, video->cpif.width * video->cpif.height * cl_videobytesperpixel );
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 ) {
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;
for( video = cl_videos, i = 0 ; i < cl_num_videos ; i++, video++ )
if( video->state != CLVIDEO_UNUSED && !video->suspended )
video->cpif.tex = R_LoadTexture2D( cl_videotexturepool, video->cpif.name,
- video->cpif.width, video->cpif.height, NULL, TEXTYPE_RGBA, 0, NULL );
+ video->cpif.width, video->cpif.height, NULL, TEXTYPE_RGBA, TEXF_ALWAYSPRECACHE, NULL );
}
static void cl_video_shutdown( void )