23#ifdef CONFIG_VIDEO_CAPTURE
24extern cvar_t cl_capturevideo;
25extern cvar_t cl_capturevideo_demo_stop;
62 Con_Print(
"No demos listed with startdemos\n");
83#ifdef CONFIG_VIDEO_CAPTURE
84 if (cl_capturevideo_demo_stop.
integer)
121 for (
i=0 ;
i<3 ;
i++)
148 Sys_Error(
"failed to reopen the demo file");
168 while(startoffset < *filesize && ((
char *)(*
buf))[startoffset] !=
'\n')
170 if(startoffset < *filesize)
270 for (
i = 0;
i < 3;
i++)
310 unsigned char bufdata[64];
321 buf.maxsize =
sizeof(bufdata);
330 Con_Print(
"Completed and deleted demo\n");
354 if (c != 2 && c != 3 && c != 4)
356 Con_Print(
"record <demoname> [<map> [cd track]]\n");
362 Con_Print(
"Relative pathnames are not allowed.\n");
368 Con_Print(
"Can not record - already connected to server\nClient demo recording must be started before connecting\n");
472 Con_Print(
"playdemo <demoname> : plays a demo\n");
508 double time, totalfpsavg;
509 double fpsmin, fpsavg, fpsmax;
510 static int benchmark_runs = 0;
517 totalfpsavg =
time > 0 ? frames /
time : 0;
522 Con_Printf(
"%i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", frames,
time, totalfpsavg, fpsmin, fpsavg, fpsmax,
cls.
td_onesecondavgcount);
524 Log_Printf(
"benchmark.log",
"date %s | enginedate %s | demo %s | commandline %s | run %d | result %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", vabuf,
engineversion,
cls.
demoname,
cmdline.
string, benchmark_runs + 1, frames,
time, totalfpsavg, fpsmin, fpsavg, fpsmax,
cls.
td_onesecondavgcount);
535 history[benchmark_runs - 1].frames = frames;
537 history[benchmark_runs - 1].totalfpsavg = totalfpsavg;
538 history[benchmark_runs - 1].fpsmin = fpsmin;
539 history[benchmark_runs - 1].fpsavg = fpsavg;
540 history[benchmark_runs - 1].fpsmax = fpsmax;
542 if(atoi(
sys.
argv[
i + 1]) > benchmark_runs)
552 if(benchmark_runs >
first)
555 for(i = first; i < benchmark_runs; ++i) if((i == first) || (history[i].f < f)) f = history[i].f
558 for(i = first; i < benchmark_runs; ++i) if((i == first) || (history[i].f > f)) f = history[i].f
561 doublecmp_offset = (char *)&history->f - (char *)history; \
562 qsort(history + first, benchmark_runs - first, sizeof(*history), doublecmp_withoffset); \
563 if((first + benchmark_runs) & 1) \
564 f = history[(first + benchmark_runs - 1) / 2].f; \
566 f = (history[(first + benchmark_runs - 2) / 2].f + history[(first + benchmark_runs) / 2].f) / 2
574 Con_Printf(
"MIN: %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", frames,
time, totalfpsavg, fpsmin, fpsavg, fpsmax,
cls.
td_onesecondavgcount);
582 Con_Printf(
"MED: %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", frames,
time, totalfpsavg, fpsmin, fpsavg, fpsmax,
cls.
td_onesecondavgcount);
590 Con_Printf(
"MAX: %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", frames,
time, totalfpsavg, fpsmin, fpsavg, fpsmax,
cls.
td_onesecondavgcount);
616 Con_Print(
"timedemo <demoname> : gets demo speeds\n");
669 for (
i=1 ;
i<c+1 ;
i++)
747 Cmd_AddCommand(
CF_CLIENT,
"pausedemo",
CL_PauseDemo_f,
"pause demo playback (can also safely pause demo recording if using QUAKE, QUAKEDP or NEHAHRAMOVIE protocol, useful for making movies)");
void CL_PlayDemo_f(cmd_state_t *cmd)
void CL_Stop_f(cmd_state_t *cmd)
static void CL_Demos_f(cmd_state_t *cmd)
static int doublecmp_withoffset(const void *a_, const void *b_)
static void CL_PauseDemo_f(cmd_state_t *cmd)
static void CL_Stopdemo_f(cmd_state_t *cmd)
static void CL_Startdemos_f(cmd_state_t *cmd)
void CL_PasteDemo(unsigned char **buf, fs_offset_t *filesize)
void CL_ReadDemoMessage(void)
static void CL_FinishTimeDemo(void)
static size_t doublecmp_offset
void CL_TimeDemo_f(cmd_state_t *cmd)
void CL_Record_f(cmd_state_t *cmd)
void CL_CutDemo(unsigned char **buf, fs_offset_t *filesize)
void CL_StopPlayback(void)
void CL_PlayDemo(const char *demo)
void CL_WriteDemoMessage(sizebuf_t *message)
void CL_DisconnectEx(qbool kicked, const char *fmt,...)
cvar_t cl_autodemo_delete
cvar_t cl_autodemo_nameformat
void CL_ParseServerMessage(void)
unsigned int scr_con_current
void Cbuf_InsertText(cmd_state_t *cmd, const char *text)
void Cbuf_AddText(cmd_state_t *cmd, const char *text)
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...
void Cmd_ExecuteString(cmd_state_t *cmd, const char *text, size_t textlen, cmd_source_t src, qbool lockmutex)
Parses a single line of text into arguments and tries to execute it.
cmd_state_t * cmd_local
command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code uses...
void Cbuf_Execute(cmd_buf_t *cbuf)
@ src_local
from the command buffer
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
void MSG_BeginReading(sizebuf_t *sb)
void MSG_WriteByte(sizebuf_t *sb, int c)
void SZ_Clear(sizebuf_t *buf)
char * va(char *buf, size_t buflen, const char *format,...)
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 ...
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
#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 Log_Printf(const char *logfilename, const char *fmt,...)
void Cvar_SetQuick(cvar_t *var, const char *value)
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
void Cvar_Callback(cvar_t *var)
char engineversion[128]
version string for the corner of the console, crash messages, status command, etc
fs_offset_t FS_Read(qfile_t *file, void *buffer, size_t buffersize)
qfile_t * FS_OpenVirtualFile(const char *filepath, qbool quiet)
fs_offset_t FS_Write(qfile_t *file, const void *data, size_t datasize)
void FS_DefaultExtension(char *path, const char *extension, size_t size_path)
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
int FS_Seek(qfile_t *file, fs_offset_t offset, int whence)
qfile_t * FS_OpenRealFile(const char *filepath, const char *mode, qbool quiet)
void FS_RemoveOnClose(qfile_t *file)
int FS_Close(qfile_t *file)
int FS_Printf(qfile_t *file, const char *format,...)
int FS_Getc(qfile_t *file)
GLenum GLuint GLenum GLsizei const GLchar * buf
@ host_shutdown
states >= host_shutdown cause graceful shutdown, see Sys_HandleCrash() comments
#define VectorCopy(in, out)
void NetConn_UpdateSockets(void)
#define MAX_INPUTLINE
maximum size of console commandline, QuakeC strings, and many other text processing buffers
#define MAX_OSPATH
max length of a filesystem pathname
#define MAX_QPATH
max length of a quake game pathname
#define MAX_DEMOS
max demos provided to demos command
#define DEMOMSG_CLIENT_TO_SERVER
double td_onesecondframes
double td_onesecondavgfps
double td_onesecondrealtime
double td_onesecondmaxfps
fs_offset_t demo_lastcsprogssize
double td_onesecondnexttime
protocolversion_t protocol
char demos[MAX_DEMOS][MAX_DEMONAME]
double td_onesecondminfps
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cv...
qbool restless
don't sleep
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
qbool active
false if only a net client
size_t Sys_TimeString(char buf[], size_t bufsize, const char *timeformat)
void Sys_Error(const char *error,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
Causes the entire program to exit ASAP.
int Sys_CheckParm(const char *parm)