]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - cl_video.h
-Added the console command prvm_globalset
[xonotic/darkplaces.git] / cl_video.h
1
2 #ifndef CL_VIDEO_H
3 #define CL_VIDEO_H
4
5 #define MAXCLVIDEOS             64 + 1 // 1 video is reserved for the cinematic mode
6 #define CLVIDEOPREFIX   "_"
7 #define CLTHRESHOLD             2.0
8
9 typedef enum clvideostate_s
10 {
11         CLVIDEO_UNUSED,
12         CLVIDEO_PLAY,
13         CLVIDEO_LOOP,
14         CLVIDEO_PAUSE,
15         CLVIDEO_FIRSTFRAME,
16 } clvideostate_t;
17
18 typedef struct clvideo_s
19 {
20         int             ownertag;
21         clvideostate_t state;
22
23         // private stuff
24         void    *stream;
25
26         double  starttime;
27         int             framenum;
28         double  framerate;
29
30         void    *imagedata;
31
32         cachepic_t cpif;
33
34         // if a video is suspended, it is automatically paused (else we'd still have to process the frames)
35     double  lasttime; // used to determine whether the video's resources should be freed or not
36         qboolean suspended; // when lasttime - realtime > THRESHOLD, all but the stream is freed
37
38         char    filename[MAX_QPATH];
39 } clvideo_t;
40
41 clvideo_t*      CL_OpenVideo( char *filename, char *name, int owner );
42 clvideo_t*      CL_GetVideo( char *name );
43 void            CL_StartVideo( clvideo_t * video );
44 void            CL_LoopVideo( clvideo_t * video );
45 void            CL_PauseVideo( clvideo_t * video );
46 void            CL_StopVideo( clvideo_t * video );
47 void            CL_RestartVideo( clvideo_t *video );
48 void            CL_CloseVideo( clvideo_t * video );
49 void            CL_PurgeOwner( int owner );
50
51 void            CL_VideoFrame( void ); // update all videos
52 void            CL_Video_Init( void );
53 void            CL_Video_Shutdown( void );
54
55 // old interface
56 extern int cl_videoplaying;
57
58 void CL_DrawVideo( void );
59 void CL_VideoStart( char *filename );
60 void CL_VideoStop( void );
61
62 #endif