Quote:
Originally Posted by videoh
Every 30 frames, this function is called to write to stdout:
Code:
void OutputProgress(int progr)
{
static int lastprogress = -1;
if (progr != lastprogress)
{
char percent[20];
DWORD written;
sprintf(percent, "%d\r", progr);
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), percent, (DWORD) strlen(percent), &written, NULL);
lastprogress = progr;
}
}
progr is an int 0-100 indicating the percent completed. The caller determines the percent complete from the ratio of the current file position and the size of the file. That way you don't need to know the number of frames in the file.
Sweet.
|
Thanks, would be a great improvement for L-Smash-Works, I'll forward it.