--- a/hedgewars/hwengine.pas Fri Jul 13 16:35:42 2012 +0400
+++ b/hedgewars/hwengine.pas Fri Jul 13 16:39:20 2012 +0400
@@ -82,15 +82,15 @@
end;
gsConfirm, gsGame:
begin
+ DrawWorld(Lag);
DoGameTick(Lag);
ProcessVisualGears(Lag);
- DrawWorld(Lag);
end;
gsChat:
begin
+ DrawWorld(Lag);
DoGameTick(Lag);
ProcessVisualGears(Lag);
- DrawWorld(Lag);
end;
gsExit:
begin
@@ -273,27 +273,32 @@
{$IFDEF USE_VIDEO_RECORDING}
procedure RecorderMainLoop;
-var CurrTime, PrevTime: LongInt;
+var oldGameTicks, oldRealTicks, newGameTicks, newRealTicks: LongInt;
begin
if not BeginVideoRecording() then
exit;
DoTimer(0); // gsLandGen -> gsStart
DoTimer(0); // gsStart -> gsGame
- CurrTime:= LoadNextCameraPosition();
+ if not LoadNextCameraPosition(newRealTicks, newGameTicks) then
+ exit;
fastScrolling:= true;
- DoTimer(CurrTime);
+ DoGameTick(newGameTicks);
fastScrolling:= false;
- while true do
+ oldRealTicks:= 0;
+ oldGameTicks:= newGameTicks;
+
+ while LoadNextCameraPosition(newRealTicks, newGameTicks) do
begin
+ IPCCheckSock();
+ DoGameTick(newGameTicks - oldGameTicks);
+ if GameState = gsExit then
+ break;
+ ProcessVisualGears(newRealTicks - oldRealTicks);
+ DrawWorld(newRealTicks - oldRealTicks);
EncodeFrame();
- PrevTime:= CurrTime;
- CurrTime:= LoadNextCameraPosition();
- if CurrTime = -1 then
- break;
- if DoTimer(CurrTime - PrevTime) then
- break;
- IPCCheckSock();
+ oldRealTicks:= newRealTicks;
+ oldGameTicks:= newGameTicks;
end;
StopVideoRecording();
end;