fix bug with desynced camera positions
authorStepan777 <stepik-777@mail.ru>
Mon, 09 Jul 2012 21:45:30 +0400
changeset 7379 aa29a2f16cc7
parent 7376 48b79b3ca592
child 7383 8f675ab05802
fix bug with desynced camera positions
hedgewars/hwengine.pas
hedgewars/uVideoRec.pas
--- a/hedgewars/hwengine.pas	Mon Jul 09 17:03:57 2012 +0400
+++ b/hedgewars/hwengine.pas	Mon Jul 09 21:45:30 2012 +0400
@@ -82,15 +82,15 @@
             end;
         gsConfirm, gsGame:
             begin
-            DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible
             DoGameTick(Lag);
             ProcessVisualGears(Lag);
+            DrawWorld(Lag);
             end;
         gsChat:
             begin
-            DrawWorld(Lag);
             DoGameTick(Lag);
             ProcessVisualGears(Lag);
+            DrawWorld(Lag);
             end;
         gsExit:
             begin
--- a/hedgewars/uVideoRec.pas	Mon Jul 09 17:03:57 2012 +0400
+++ b/hedgewars/uVideoRec.pas	Mon Jul 09 21:45:30 2012 +0400
@@ -213,7 +213,7 @@
 begin
     LoadNextCameraPosition:= GameTicks;
     // we need to skip or duplicate frames to match target framerate
-    while Int64(curTime)*cVideoFramerateNum < Int64(numFrames)*cVideoFramerateDen*1000 do
+    while Int64(curTime)*cVideoFramerateNum <= Int64(numFrames)*cVideoFramerateDen*1000 do
     begin
     {$IOCHECKS OFF}
         if eof(cameraFile) then