* no zooming when game is paused
authorsheepluva
Fri, 07 May 2010 09:57:12 +0000
changeset 3444 9d501dc22f71
parent 3443 14d12df0d363
child 3445 1ce844170014
* no zooming when game is paused * don't do visual gear steps while paused
hedgewars/hwengine.pas
hedgewars/uWorld.pas
--- a/hedgewars/hwengine.pas	Fri May 07 06:29:46 2010 +0000
+++ b/hedgewars/hwengine.pas	Fri May 07 09:57:12 2010 +0000
@@ -122,7 +122,7 @@
                 DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible
                 ProcessKbd;
                 DoGameTick(Lag);
-                ProcessVisualGears(Lag);
+                if not isPaused then ProcessVisualGears(Lag);
                 end;
         gsChat: begin
                 DrawWorld(Lag);
--- a/hedgewars/uWorld.pas	Fri May 07 06:29:46 2010 +0000
+++ b/hedgewars/uWorld.pas	Fri May 07 09:57:12 2010 +0000
@@ -540,16 +540,21 @@
     scale: GLfloat;
     VertexBuffer: array [0..3] of TVertex2f;
 begin
-if ZoomValue < zoom then
+if not isPaused then
     begin
-    zoom:= zoom - 0.002 * Lag;
-    if ZoomValue > zoom then zoom:= ZoomValue
-    end else
-if ZoomValue > zoom then
-    begin
-    zoom:= zoom + 0.002 * Lag;
-    if ZoomValue < zoom then zoom:= ZoomValue
-    end;
+    if ZoomValue < zoom then
+        begin
+        zoom:= zoom - 0.002 * Lag;
+        if ZoomValue > zoom then zoom:= ZoomValue
+        end else
+    if ZoomValue > zoom then
+        begin
+        zoom:= zoom + 0.002 * Lag;
+        if ZoomValue < zoom then zoom:= ZoomValue
+        end
+    end
+else
+    ZoomValue:= zoom;
 
 // Sky
 glClear(GL_COLOR_BUFFER_BIT);