]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_video.c
rewrote timing code, now a much better and very different sleeping method, no longer...
[xonotic/darkplaces.git] / cl_video.c
index 5f56b889014c50308f5b9d4701c466be6144fb56..bc226e46e8bcfb2b48861f482ee2cca82fab518a 100644 (file)
@@ -62,7 +62,7 @@ static qboolean WakeVideo( clvideo_t * video )
 
        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;
@@ -89,7 +89,7 @@ static clvideo_t* OpenVideo( clvideo_t *video, const char *filename, const char
        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 );
 
@@ -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 ) {
@@ -314,7 +314,7 @@ static void cl_video_start( void )
        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 )