static void Movie_Start(double _time) { #ifdef GLQUAKE extern cvar_t scr_sshot_format; #endif #ifndef _WIN32 time_t t; t = time(NULL); localtime_r(&t, &movie_start_date); #else GetLocalTime(&movie_start_date); #endif movie_is_capturing = true; #ifdef _WIN32 movie_is_avi = !!avifile; //joe: capturing to avi #endif movie_len = _time; movie_start_time = cls.realtime; movie_frame_count = 0; #ifdef _WIN32 if (movie_is_avi) //joe: capturing to avi { movie_is_capturing = Capture_Open (avipath); } else #endif { #ifdef GLQUAKE // DEFAULT_SSHOT_FORMAT if (!strcmp(scr_sshot_format.string, "tga") || !strcmp(scr_sshot_format.string, "jpeg") || !strcmp(scr_sshot_format.string, "jpg") || !strcmp(scr_sshot_format.string, "png")) { strlcpy(image_ext, scr_sshot_format.string, sizeof(image_ext)); } else { strlcpy (image_ext, "tga", sizeof (image_ext)); } #else strlcpy (image_ext, "pcx", sizeof (image_ext)); #endif } }
void Movie_Start_f (void) { char name[MAX_OSPATH], path[256]; //qb: jqavi was MAX_FILELENGTH int i; if (Cmd_Argc() != 2) //qb: autogenerate file name if none is given. { Q_strcpy(name,"qbs8_000.avi"); //qb: screenshots dir for (i=0 ; i<=999 ; i++) { name[5] = i/100 + '0'; name[6] = (i/10)%10 + '0'; name[7] = i%10 + '0'; sprintf (path, "%s/%s/%s", com_gamedir, "screenshots", name); if (Sys_FileTime(path) == -1) break; // file doesn't exist } if (i==1000) { Con_Printf ("Movie_Start_f: Too many AVI files in directory.\n"); return; } } else { Q_strncpyz (name, Cmd_Argv(1), sizeof(name)); COM_ForceExtension (name, ".avi"); } hack_ctr = capture_hack.value; Q_snprintfz (path, sizeof(path), "%s/%s/%s", com_gamedir, "screenshots", 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); if (movie_is_capturing) Con_DPrintf("Capturing video %s\n", path); //qb: is printed on the vid, so only in debug mode. else Con_Printf("Movie_Start_f: Movie capture open failed.\n"); }