]> icculus.org git repositories - divverent/darkplaces.git/blob - cl_video.h
no longer hits triangles of your own player model when tracing the prydoncursor from...
[divverent/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   "_video/"
7 #define CLTHRESHOLD             2.0
8
9 #define MENUOWNER               1
10
11 typedef enum clvideostate_e
12 {
13         CLVIDEO_UNUSED,
14         CLVIDEO_PLAY,
15         CLVIDEO_LOOP,
16         CLVIDEO_PAUSE,
17         CLVIDEO_FIRSTFRAME,
18         CLVIDEO_RESETONWAKEUP,
19         CLVIDEO_STATECOUNT
20 } clvideostate_t;
21
22 typedef struct clvideo_s
23 {
24         int             ownertag;
25         clvideostate_t state;
26
27         // private stuff
28         void    *stream;
29
30         double  starttime;
31         int             framenum;
32         double  framerate;
33
34         void    *imagedata;
35
36         cachepic_t cpif;
37
38         // if a video is suspended, it is automatically paused (else we'd still have to process the frames)
39     double  lasttime; // used to determine whether the video's resources should be freed or not
40         qboolean suspended; // when lasttime - realtime > THRESHOLD, all but the stream is freed
41
42         char    filename[MAX_QPATH];
43 } clvideo_t;
44
45 clvideo_t*      CL_OpenVideo( char *filename, char *name, int owner );
46 clvideo_t*      CL_GetVideo( char *name );
47 void            CL_SetVideoState( clvideo_t *video, clvideostate_t state );
48 void            CL_RestartVideo( clvideo_t *video );
49
50 void            CL_CloseVideo( clvideo_t * video );
51 void            CL_PurgeOwner( int owner );
52
53 void            CL_VideoFrame( void ); // update all videos
54 void            CL_Video_Init( void );
55 void            CL_Video_Shutdown( void );
56
57 // old interface
58 extern int cl_videoplaying;
59
60 void CL_DrawVideo( void );
61 void CL_VideoStart( char *filename );
62 void CL_VideoStop( void );
63
64 #endif