13cvar_t cl_video_keepaspectratio = {
CF_CLIENT |
CF_ARCHIVE,
"cl_video_keepaspectratio",
"0",
"keeps aspect ratio of fullscreen videos, leaving black color on unfilled areas, a value of 2 let video to be stretched horizontally with top & bottom being sliced out"};
51 const char *errorstring;
132 float subtime, sublen;
141 subtitle_text =
NULL;
144 dpsnprintf(overridename,
sizeof(overridename),
"locale/%s/%s", langcvar->
string, subtitlesfile);
156 Con_DPrintf(
"LoadSubtitles: can't open subtitle file '%s'!\n", subtitlesfile );
165 data = subtitle_text;
239 if (subtitlesfile[0])
256 Con_Printf(
CON_ERROR "CL_OpenVideo: unable to open video \"%s\" - video limit reached\n", filename );
304 video->
state = state;
396 }
while(video->
framenum < destframe);
441 else if(maxWidth == -1)
453 DrawQ_String(
x, si->
y, line,
length, si->
fontsize, si->
fontsize, 1.0, 1.0, 1.0, si->
textalpha, 0,
NULL,
false, si->
font);
463 float videotime,
px, py, sx, sy, st[8],
b;
483 st[0] = 0.0; st[1] = 0.0;
484 st[2] = 1.0; st[3] = 0.0;
485 st[4] = 0.0; st[5] = 1.0;
486 st[6] = 1.0; st[7] = 1.0;
495 st[1] = st[3] = (1 -
a)*0.5;
496 st[5] = st[7] = 1 - (1 -
a)*0.5;
500 st[0] = st[4] = (1 - 1/
a)*0.5;
501 st[2] = st[6] = (1/
a)*0.5;
506 px += sx * (1 -
a) * 0.5;
539 Con_Print(
"FIXME: cl_video_stipple not implemented\n");
545 DrawQ_SuperPic(
px, py, video->
cachepic, sx, sy, st[0], st[1],
b,
b,
b, 1, st[2], st[3],
b,
b,
b, 1, st[4], st[5],
b,
b,
b, 1, st[6], st[7],
b,
b,
b, 1, 0);
548 DrawQ_SuperPic(
px, py, video->
cachepic, sx, sy, st[0], st[1],
b,
b,
b, 1, st[2], st[3],
b,
b,
b, 1, st[4], st[5],
b,
b,
b, 1, st[6], st[7],
b,
b,
b, 1,
DRAWFLAG_NOGAMMA);
550 DrawQ_SuperPic(
px, py, video->
cachepic, sx, sy, st[0], st[1],
b,
b,
b,
v_glslgamma_video.
value, st[2], st[3],
b,
b,
b,
v_glslgamma_video.
value, st[4], st[5],
b,
b,
b,
v_glslgamma_video.
value, st[6], st[7],
b,
b,
b,
v_glslgamma_video.
value, 0);
561 if (videotime >= video->
subtitle_start[
i] && videotime <= video->subtitle_end[
i])
616 const char *extension;
625 Con_Print(
"usage: playvideo <videoname> [custom_subtitles_file]\nplays video named video/<videoname>.dpv\nif custom subtitles file is not presented\nit tries video/<videoname>.sub");
static void LoadSubtitles(clvideo_t *video, const char *subtitlesfile)
void CL_SetVideoState(clvideo_t *video, clvideostate_t state)
clvideo_t * CL_GetVideoByName(const char *name)
void CL_VideoStart(char *filename, const char *subtitlesfile)
static void cl_video_start(void)
cvar_t cl_video_scale_vpos
static void cl_video_shutdown(void)
static void VideoUpdateCallback(rtexture_t *rt, void *data)
cvar_t cl_video_subtitles_textsize
static void UnlinkVideoTexture(clvideo_t *video)
void CL_RestartVideo(clvideo_t *video)
static void cl_video_newmap(void)
static clvideo_t * FindUnusedVid(void)
static float CL_DrawVideo_WordWidthFunc(void *passthrough, const char *w, size_t *length, float maxWidth)
static void LinkVideoTexture(clvideo_t *video)
void CL_Video_KeyEvent(int key, int ascii, qbool down)
void CL_Video_Shutdown(void)
static rtexturepool_t * cl_videotexturepool
cvar_t cl_video_brightness
static qbool WakeVideo(clvideo_t *video)
void CL_CloseVideo(clvideo_t *video)
static clvideo_t * CL_GetVideoBySlot(int slot)
static int cl_videobytesperpixel
cvar_t cl_video_subtitles_lines
cvar_t cl_video_subtitles
void CL_Video_Frame(void)
static clvideo_t cl_videos[MAXCLVIDEOS]
static void CL_StopVideo_f(cmd_state_t *cmd)
static int CL_DrawVideo_DisplaySubtitleLine(void *passthrough, const char *line, size_t length, float width, qbool isContinuation)
cvar_t cl_video_keepaspectratio
static void CL_PlayVideo_f(cmd_state_t *cmd)
static clvideo_t * OpenVideo(clvideo_t *video, const char *filename, const char *name, int owner, const char *subtitlesfile)
void CL_PurgeOwner(int owner)
static qbool OpenStream(clvideo_t *video)
static void SuspendVideo(clvideo_t *video)
clvideo_t * CL_OpenVideo(const char *filename, const char *name, int owner, const char *subtitlesfile)
#define CLVIDEO_MAX_SUBTITLES
void * jam_open(clvideo_t *video, char *filename, const char **errorstring)
void * LibAvW_OpenVideo(clvideo_t *video, char *filename, const char **errorstring)
qbool LibAvW_OpenLibrary(void)
void LibAvW_CloseLibrary(void)
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
#define CF_SERVER
cvar/command that only the server can change/execute
static int Cmd_Argc(cmd_state_t *cmd)
static const char * Cmd_Argv(cmd_state_t *cmd, int arg)
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are alwa...
#define CF_CLIENT
cvar/command that only the client can change/execute
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
int COM_Wordwrap(const char *string, size_t length, float continuationWidth, float maxWidth, COM_WordWidthFunc_t wordWidth, void *passthroughCW, COM_LineProcessorFunc processLine, void *passthroughPL)
char com_token[MAX_INPUTLINE]
qbool COM_ParseToken_QuakeC(const char **datapointer, qbool returnnewline)
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
#define dp_strlcpy(dst, src, dsize)
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
void Cvar_SetValueQuick(cvar_t *var, float value)
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
cvar_t * Cvar_FindVar(cvar_state_t *cvars, const char *var_name, unsigned neededflags)
void * dpvsimpledecode_open(clvideo_t *video, char *filename, const char **errorstring)
@ CACHEPICFLAG_NOTPERSISTENT
void DrawQ_Fill(float x, float y, float width, float height, float red, float green, float blue, float alpha, int flags)
void Draw_FreePic(const char *picname)
void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height, float s1, float t1, float r1, float g1, float b1, float a1, float s2, float t2, float r2, float g2, float b2, float a2, float s3, float t3, float r3, float g3, float b3, float a3, float s4, float t4, float r4, float g4, float b4, float a4, int flags)
cachepic_t * Draw_NewPic(const char *picname, int width, int height, unsigned char *pixels, textype_t textype, int texflags)
float DrawQ_String(float x, float y, const char *text, size_t maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt)
cachepic_t * Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
float DrawQ_TextWidth(const char *text, size_t maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt)
rtexture_t * Draw_GetPicTexture(cachepic_t *pic)
float DrawQ_TextWidth_UntilWidth(const char *text, size_t *maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt, float maxWidth)
const char * FS_FileExtension(const char *in)
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
static int(ZEXPORT *qz_inflate)(z_stream *strm
void R_FreeTexturePool(rtexturepool_t **rtexturepool)
void R_MakeTextureDynamic(rtexture_t *rt, updatecallback_t updatecallback, void *data)
rtexturepool_t * R_AllocTexturePool(void)
void R_MarkDirtyTexture(rtexture_t *rt)
GLubyte GLubyte GLubyte GLubyte w
GLenum GLuint GLenum GLsizei length
GLsizeiptr const GLvoid * data
#define bound(min, num, max)
#define MAXCLVIDEOS
maximum number of video streams being played back at once (1 is reserved for the playvideo command)
#define MAX_QPATH
max length of a quake game pathname
void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
mempool_t * permanentmempool
float subtitle_start[CLVIDEO_MAX_SUBTITLES]
struct cachepic_s * cachepic
void(* close)(void *stream)
double(* getframerate)(void *stream)
unsigned int(* getheight)(void *stream)
float subtitle_end[CLVIDEO_MAX_SUBTITLES]
int(* decodeframe)(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow)
double(* getaspectratio)(void *stream)
unsigned int(* getwidth)(void *stream)
char * subtitle_text[CLVIDEO_MAX_SUBTITLES]
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cv...
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
viddef_mode_t mode
currently active video mode
int Sys_CheckParm(const char *parm)
viddef_t vid
global video state
#define Mem_Alloc(pool, size)