]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_video.h
Fix engine not starting on Windows if linked against SDL > 2.0.5
[xonotic/darkplaces.git] / cl_video.h
index 589a11b875d79d3d1da1b47e8fd4742ac1b1eb7c..e96e2a478d4d9d3981c0ef5ff0ea17d3e5d947c9 100644 (file)
@@ -2,10 +2,7 @@
 #ifndef CL_VIDEO_H
 #define CL_VIDEO_H
 
-#include "cl_dyntexture.h"
-
-// yields DYNAMIC_TEXTURE_PATH_PREFIX CLVIDEOPREFIX video name for a path
-#define CLVIDEOPREFIX  CLDYNTEXTUREPREFIX "video/"
+#define CLVIDEOPREFIX  "video/"
 #define CLTHRESHOLD            2.0
 
 #define MENUOWNER              1
@@ -46,7 +43,11 @@ typedef struct clvideo_s
 
        void    *imagedata;
 
-       cachepic_t cpif;
+       // cachepic holds the relevant texture_t and we simply update the texture as needed
+       cachepic_t *cachepic;
+       char    name[MAX_QPATH]; // name of this video UI element (not the filename)
+       int             width;
+       int             height;
 
        // VorteX: subtitles array
        int             subtitles;
@@ -54,8 +55,15 @@ typedef struct clvideo_s
        float   subtitle_start[CLVIDEO_MAX_SUBTITLES];
        float   subtitle_end[CLVIDEO_MAX_SUBTITLES];
 
-       // if a video is suspended, it is automatically paused (else we'd still have to process the frames)
+       // this functions gets filled by video format module
+       void (*close) (void *stream);
+       unsigned int (*getwidth) (void *stream);
+       unsigned int (*getheight) (void *stream);
+       double (*getframerate) (void *stream);
+       double (*getaspectratio) (void *stream);
+       int (*decodeframe) (void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow);
 
+       // 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