]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
-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 70053f1b557fe2aae4387ad54ed8dfa9c7a3931b..295fb79a71b5f9dc9193404313d327c41a90d5a6 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 5d9cd2f16f0d55e8e398ce698be960f9891aca5a..eff1cc5c2f7ea1b6aae26facce748b2b0ef50bd8 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