The benefit? Bind a function key to capture_start and another one to capture_stop to quickly toggle video capture. Super cool when combined with Baker's demo rewind/fastforward/pause found in Mark V source.
Code: Select all
void Movie_Start_f (void)
{
char name[MAX_OSPATH], path[256]; //qbism jqavi was MAX_FILELENGTH
//////////////////////CUT+PASTE START/////////////////////////////////////////
int i;
if (Cmd_Argc() != 2) //qbism - autogenerate file name if none is given.
{
Q_strcpy(name,"quake00.avi");
for (i=0 ; i<=99 ; i++)
{
name[5] = i/10 + '0';
name[6] = i%10 + '0';
sprintf (path, "%s/%s", com_gamedir, name);
if (Sys_FileTime(path) == -1)
break; // file doesn't exist
}
if (i==100)
{
Con_Printf ("Movie_Start_f: Too many AVI files in directory.\n");
return;
}
}
else //read the arg
{
Q_strncpyz (name, Cmd_Argv(1), sizeof(name));
COM_ForceExtension (name, ".avi");
}
//////////////////////CUT+PASTE END/////////////////////////////////////////
hack_ctr = capture_hack.value;
Q_snprintfz (path, sizeof(path), "%s/%s", com_gamedir, name);
if (!(moviefile = fopen(path, "wb")))
{
COM_CreatePath (path);
if (!(moviefile = fopen(path, "wb")))
{
Con_Printf ("ERROR: Couldn't open %s\n", name);
return;
}
}
movie_is_capturing = Capture_Open (path);
}