-Castrated the new CL_Video subsystem. It doesnt allow more than 1 video
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 18 Dec 2004 11:22:10 +0000 (11:22 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 18 Dec 2004 11:22:10 +0000 (11:22 +0000)
 stream at a time again. I've moved the texture pool stuff into OpenVideo
 and CloseVideo, so it should work exactly like the old code.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4855 d7cf8633-e32d-0410-b094-e92efae38249

cl_video.c
cl_video.h

index 70053f1..295fb79 100644 (file)
@@ -86,6 +86,8 @@ static clvideo_t* OpenVideo( clvideo_t *video, char *filename, char *name, int o
        video->framerate = dpvsimpledecode_getframerate( video->stream );
        video->lasttime = realtime;
 
+       cl_videotexturepool = R_AllocTexturePool();
+
        video->cpif.width = dpvsimpledecode_getwidth( video->stream );
        video->cpif.height = dpvsimpledecode_getheight( video->stream );
        video->cpif.tex = R_LoadTexture2D( cl_videotexturepool, video->cpif.name, 
@@ -168,6 +170,7 @@ void CL_CloseVideo( clvideo_t * video )
        if( !video->suspended ) {
                Mem_Free( video->imagedata );
                R_FreeTexture( video->cpif.tex );
+               R_FreeTexturePool( &cl_videotexturepool );
        }
 
        video->state = CLVIDEO_UNUSED;
@@ -226,7 +229,6 @@ void CL_Video_Shutdown( void )
        for( i = 0 ; i < MAXCLVIDEOS ; i++ )
                CL_CloseVideo( &videoarray[ i ] );
 
-       R_FreeTexturePool( &cl_videotexturepool );
        Mem_FreePool( &cl_videomempool );
 }
 
@@ -292,9 +294,9 @@ void CL_Video_Init( void )
        cl_videogmask = BigLong(0x00FF0000);
        cl_videobmask = BigLong(0x0000FF00);
 
-       cl_videomempool = Mem_AllocPool( "CL_Video", 0, NULL );
-       cl_videotexturepool = R_AllocTexturePool();
-
        Cmd_AddCommand( "playvideo", CL_PlayVideo_f );
        Cmd_AddCommand( "stopvideo", CL_StopVideo_f );
+       
+       cl_videomempool = Mem_AllocPool( "CL_Video", 0, NULL );
 }
+
index 5d9cd2f..eff1cc5 100644 (file)
@@ -2,7 +2,8 @@
 #ifndef CL_VIDEO_H
 #define CL_VIDEO_H
 
-#define MAXCLVIDEOS            64 + 1 // 1 video is reserved for the cinematic mode
+//#define MAXCLVIDEOS          64 + 1 // 1 video is reserved for the cinematic mode
+#define MAXCLVIDEOS            1
 #define CLVIDEOPREFIX  "_video/"
 #define CLTHRESHOLD            2.0