]> git.xonotic.org Git - xonotic/darkplaces.git/blob - dpvsimpledecode.h
Set groundentity when sv_gameplayfix_downtracesupportsongroundflag detects a floor
[xonotic/darkplaces.git] / dpvsimpledecode.h
1 /*
2 Copyright (C) 2002-2012 DarkPlaces contributors
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 #ifndef DPVSIMPLEDECODE_H
22 #define DPVSIMPLEDECODE_H
23
24 #include "qtypes.h"
25 #include "qdefs.h"
26 #include "cvar.h"
27 #include "cl_video.h"
28 #include "draw.h"
29
30 #define DPVSIMPLEDECODEERROR_NONE 0
31 #define DPVSIMPLEDECODEERROR_EOF 1
32 #define DPVSIMPLEDECODEERROR_READERROR 2
33 #define DPVSIMPLEDECODEERROR_SOUNDBUFFERTOOSMALL 3
34 #define DPVSIMPLEDECODEERROR_INVALIDRMASK 4
35 #define DPVSIMPLEDECODEERROR_INVALIDGMASK 5
36 #define DPVSIMPLEDECODEERROR_INVALIDBMASK 6
37 #define DPVSIMPLEDECODEERROR_COLORMASKSOVERLAP 7
38 #define DPVSIMPLEDECODEERROR_COLORMASKSEXCEEDBPP 8
39 #define DPVSIMPLEDECODEERROR_UNSUPPORTEDBPP 9
40
41 // opening and closing streams
42
43 // opens a stream
44 void *dpvsimpledecode_open(clvideo_t *video, char *filename, const char **errorstring);
45
46 // closes a stream
47 void dpvsimpledecode_close(void *stream);
48
49 // utilitarian functions
50
51 // returns the current error number for the stream, and resets the error
52 // number to DPVDECODEERROR_NONE
53 // if the supplied string pointer variable is not NULL, it will be set to the
54 // error message
55 int dpvsimpledecode_error(void *stream, const char **errorstring);
56
57 // returns the width of the image data
58 unsigned int dpvsimpledecode_getwidth(void *stream);
59
60 // returns the height of the image data
61 unsigned int dpvsimpledecode_getheight(void *stream);
62
63 // returns the framerate of the stream
64 double dpvsimpledecode_getframerate(void *stream);
65
66 // returns aspect ratio of the stream
67 double dpvsimpledecode_getaspectratio(void *stream);
68
69 // decodes a video frame to the supplied output pixels
70 int dpvsimpledecode_video(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow);
71
72 #endif