X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=cl_video.h;h=8439e92cc65ba80ceac47048f3c2439258779814;hb=3f928aa8b5eae2c8a2b93c99205ba31a8682af60;hp=58738afcbf3ac2c04bf134acd7c874e4a569eb50;hpb=b0671fcac8564a24ec6d499c0a574d71d937ea7d;p=xonotic%2Fdarkplaces.git diff --git a/cl_video.h b/cl_video.h index 58738afc..8439e92c 100644 --- a/cl_video.h +++ b/cl_video.h @@ -2,11 +2,66 @@ #ifndef CL_VIDEO_H #define CL_VIDEO_H +#define MAXCLVIDEOS 64 + 1 // 1 video is reserved for the cinematic mode +#define CLVIDEOPREFIX "_video/" +#define CLTHRESHOLD 2.0 + +#define MENUOWNER 1 + +typedef enum clvideostate_e +{ + CLVIDEO_UNUSED, + CLVIDEO_PLAY, + CLVIDEO_LOOP, + CLVIDEO_PAUSE, + CLVIDEO_FIRSTFRAME, + CLVIDEO_RESETONWAKEUP, + CLVIDEO_STATECOUNT +} clvideostate_t; + +typedef struct clvideo_s +{ + int ownertag; + clvideostate_t state; + + // private stuff + void *stream; + + double starttime; + int framenum; + double framerate; + + void *imagedata; + + cachepic_t cpif; + + // if a video is suspended, it is automatically paused (else we'd still have to process the frames) + + // used to determine whether the video's resources should be freed or not + double lasttime; + // when lasttime - realtime > THRESHOLD, all but the stream is freed + qboolean suspended; + + char filename[MAX_QPATH]; +} clvideo_t; + +clvideo_t* CL_OpenVideo( const char *filename, const char *name, int owner ); +clvideo_t* CL_GetVideo( const char *name ); +void CL_SetVideoState( clvideo_t *video, clvideostate_t state ); +void CL_RestartVideo( clvideo_t *video ); + +void CL_CloseVideo( clvideo_t * video ); +void CL_PurgeOwner( int owner ); + +void CL_VideoFrame( void ); // update all videos +void CL_Video_Init( void ); +void CL_Video_Shutdown( void ); + +// old interface extern int cl_videoplaying; -void CL_VideoFrame(void); -void CL_DrawVideo(void); -void CL_VideoStart(char *filename); -void CL_VideoStop(void); -void CL_Video_Init(void); + +void CL_DrawVideo( void ); +void CL_VideoStart( char *filename ); +void CL_VideoStop( void ); #endif