hedgewars/uWorld.pas
changeset 5855 74c621e12baa
parent 5852 fe010d3a4330
child 5856 ed97138dc414
--- a/hedgewars/uWorld.pas	Sun Sep 11 16:18:49 2011 +0200
+++ b/hedgewars/uWorld.pas	Sun Sep 11 10:22:09 2011 -0400
@@ -1315,11 +1315,11 @@
 procedure ShakeCamera(amount: LongWord);
 begin
     if isCursorVisible then exit;
-    amount:= Max(1, amount);
-    //WorldDx:= WorldDx - amount + LongInt(getRandom(1 + amount * 2));
-    //WorldDy:= WorldDy - amount + LongInt(getRandom(1 + amount * 2));
-    CursorPoint.X:= CursorPoint.X - amount + LongInt(getRandom(1 + amount * 2));
-    CursorPoint.Y:= CursorPoint.Y - amount + LongInt(getRandom(1 + amount * 2))
+    amount:= Max(1, round(amount*zoom/2));
+    WorldDx:= WorldDx - amount + LongInt(random(1 + amount * 2));
+    WorldDy:= WorldDy - amount + LongInt(random(1 + amount * 2));
+    //CursorPoint.X:= CursorPoint.X - amount + LongInt(random(1 + amount * 2));
+    //CursorPoint.Y:= CursorPoint.Y - amount + LongInt(random(1 + amount * 2))
 end;