Two new cvars for blood particles: decal alpha, decal random scaling (min/max)
[divverent/darkplaces.git] / cl_video.h
1
2 #ifndef CL_VIDEO_H
3 #define CL_VIDEO_H
4
5 #include "cl_dyntexture.h"
6
7 // yields DYNAMIC_TEXTURE_PATH_PREFIX CLVIDEOPREFIX video name for a path
8 #define CLVIDEOPREFIX   CLDYNTEXTUREPREFIX "video/"
9 #define CLTHRESHOLD             2.0
10
11 #define MENUOWNER               1
12
13 typedef enum clvideostate_e
14 {
15         CLVIDEO_UNUSED,
16         CLVIDEO_PLAY,
17         CLVIDEO_LOOP,
18         CLVIDEO_PAUSE,
19         CLVIDEO_FIRSTFRAME,
20         CLVIDEO_RESETONWAKEUP,
21         CLVIDEO_STATECOUNT
22 } clvideostate_t;
23
24 typedef struct clvideo_s
25 {
26         int             ownertag;
27         clvideostate_t state;
28
29         // private stuff
30         void    *stream;
31
32         double  starttime;
33         int             framenum;
34         double  framerate;
35
36         void    *imagedata;
37
38         cachepic_t cpif;
39
40         // if a video is suspended, it is automatically paused (else we'd still have to process the frames)
41
42         // used to determine whether the video's resources should be freed or not
43     double  lasttime;
44         // when lasttime - realtime > THRESHOLD, all but the stream is freed
45         qboolean suspended;
46
47         char    filename[MAX_QPATH];
48 } clvideo_t;
49
50 clvideo_t*      CL_OpenVideo( const char *filename, const char *name, int owner );
51 clvideo_t*      CL_GetVideoByName( const char *name );
52 void            CL_SetVideoState( clvideo_t *video, clvideostate_t state );
53 void            CL_RestartVideo( clvideo_t *video );
54
55 void            CL_CloseVideo( clvideo_t * video );
56 void            CL_PurgeOwner( int owner );
57
58 void            CL_Video_Frame( void ); // update all videos
59 void            CL_Video_Init( void );
60 void            CL_Video_Shutdown( void );
61
62 // old interface
63 extern int cl_videoplaying;
64
65 void CL_DrawVideo( void );
66 void CL_VideoStart( char *filename );
67 void CL_VideoStop( void );
68
69 // new function used for fullscreen videos
70 // TODO: Andreas Kirsch: move this subsystem somewhere else (preferably host) since the cl_video system shouldnt do such work like managing key events..
71 void CL_Video_KeyEvent( int key, int ascii, qboolean down );
72
73 #endif