From 228847c7c27c1a24ebb23bdac46ea5cb7b395475 Mon Sep 17 00:00:00 2001 From: black Date: Sat, 18 Dec 2004 11:22:10 +0000 Subject: [PATCH] -Castrated the new CL_Video subsystem. It doesnt allow more than 1 video 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 | 10 ++++++---- cl_video.h | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cl_video.c b/cl_video.c index 70053f1b..295fb79a 100644 --- a/cl_video.c +++ b/cl_video.c @@ -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 ); } + diff --git a/cl_video.h b/cl_video.h index 5d9cd2f1..eff1cc5c 100644 --- a/cl_video.h +++ b/cl_video.h @@ -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 -- 2.39.2