hedgewars/uVideoRec.pas
changeset 14461 9844450389a4
parent 14199 3c36a4e66c82
child 14879 002f7d41f5ce
equal deleted inserted replaced
14460:3897da404301 14461:9844450389a4
    34 interface
    34 interface
    35 
    35 
    36 var flagPrerecording: boolean = false;
    36 var flagPrerecording: boolean = false;
    37 
    37 
    38 function BeginVideoRecording: Boolean;
    38 function BeginVideoRecording: Boolean;
    39 function LoadNextCameraPosition(out newRealTicks, newGameTicks: LongInt): Boolean;
    39 function LoadNextCameraPosition(var newRealTicks, newGameTicks: LongInt): Boolean;
    40 procedure EncodeFrame;
    40 procedure EncodeFrame;
    41 procedure StopVideoRecording;
    41 procedure StopVideoRecording;
    42 
    42 
    43 procedure BeginPreRecording;
    43 procedure BeginPreRecording;
    44 procedure StopPreRecording;
    44 procedure StopPreRecording;
   188     SDLNet_Write16(progress*10000 div maxProgress, @s[2]);
   188     SDLNet_Write16(progress*10000 div maxProgress, @s[2]);
   189     SendIPC(s);
   189     SendIPC(s);
   190     inc(numFrames);
   190     inc(numFrames);
   191 end;
   191 end;
   192 
   192 
   193 function LoadNextCameraPosition(out newRealTicks, newGameTicks: LongInt): Boolean;
   193 function LoadNextCameraPosition(var newRealTicks, newGameTicks: LongInt): Boolean;
   194 var frame: TFrame = (realTicks: 0; gameTicks: 0; CamX: 0; CamY: 0; zoom: 0);
   194 var frame: TFrame = (realTicks: 0; gameTicks: 0; CamX: 0; CamY: 0; zoom: 0);
   195 begin
   195 begin
   196     // we need to skip or duplicate frames to match target framerate
   196     // we need to skip or duplicate frames to match target framerate
   197     while Int64(curTime)*cVideoFramerateNum <= Int64(numFrames)*cVideoFramerateDen*1000 do
   197     while Int64(curTime)*cVideoFramerateNum <= Int64(numFrames)*cVideoFramerateDen*1000 do
   198     begin
   198     begin