271 end; |
271 end; |
272 end; |
272 end; |
273 |
273 |
274 {$IFDEF USE_VIDEO_RECORDING} |
274 {$IFDEF USE_VIDEO_RECORDING} |
275 procedure RecorderMainLoop; |
275 procedure RecorderMainLoop; |
276 var CurrTime, PrevTime: LongInt; |
276 var oldGameTicks, oldRealTicks, newGameTicks, newRealTicks: LongInt; |
277 begin |
277 begin |
278 if not BeginVideoRecording() then |
278 if not BeginVideoRecording() then |
279 exit; |
279 exit; |
280 DoTimer(0); // gsLandGen -> gsStart |
280 DoTimer(0); // gsLandGen -> gsStart |
281 DoTimer(0); // gsStart -> gsGame |
281 DoTimer(0); // gsStart -> gsGame |
282 |
282 |
283 CurrTime:= LoadNextCameraPosition(); |
283 if not LoadNextCameraPosition(newRealTicks, newGameTicks) then |
|
284 exit; |
284 fastScrolling:= true; |
285 fastScrolling:= true; |
285 DoTimer(CurrTime); |
286 DoGameTick(newGameTicks); |
286 fastScrolling:= false; |
287 fastScrolling:= false; |
287 while true do |
288 oldRealTicks:= 0; |
|
289 oldGameTicks:= newGameTicks; |
|
290 |
|
291 while LoadNextCameraPosition(newRealTicks, newGameTicks) do |
288 begin |
292 begin |
|
293 IPCCheckSock(); |
|
294 DoGameTick(newGameTicks - oldGameTicks); |
|
295 if GameState = gsExit then |
|
296 break; |
|
297 ProcessVisualGears(newRealTicks - oldRealTicks); |
|
298 DrawWorld(newRealTicks - oldRealTicks); |
289 EncodeFrame(); |
299 EncodeFrame(); |
290 PrevTime:= CurrTime; |
300 oldRealTicks:= newRealTicks; |
291 CurrTime:= LoadNextCameraPosition(); |
301 oldGameTicks:= newGameTicks; |
292 if CurrTime = -1 then |
|
293 break; |
|
294 if DoTimer(CurrTime - PrevTime) then |
|
295 break; |
|
296 IPCCheckSock(); |
|
297 end; |
302 end; |
298 StopVideoRecording(); |
303 StopVideoRecording(); |
299 end; |
304 end; |
300 {$ENDIF} |
305 {$ENDIF} |
301 |
306 |