# HG changeset patch # User nemo # Date 1315440740 14400 # Node ID 3a04c30e5ac7c88248666ed9e16be7cd3d2dbc3c # Parent 55c08df2bdfd90db3eaf0da6d66f244b40f1eab4 NEEDS TESTING. Try reenabling camera shake based on unc0rr's comment. diff -r 55c08df2bdfd -r 3a04c30e5ac7 hedgewars/VGSHandlers.inc --- a/hedgewars/VGSHandlers.inc Wed Sep 07 15:06:42 2011 -0400 +++ b/hedgewars/VGSHandlers.inc Wed Sep 07 20:12:20 2011 -0400 @@ -587,7 +587,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepBigExplosionWork(Gear: PVisualGear; Steps: Longword); -//var maxMovement: LongInt; +var maxMovement: LongInt; begin inc(Gear^.Timer, Steps); @@ -596,13 +596,13 @@ One possible solution is, instead of using WorldDx, to use straight gl/SDL calls to jitter the screen a bit. // a comment by unC0Rr: instead of changing WorldDx shake cursor coordinates, that should be safe +*) if (Gear^.Timer and 5) = 0 then begin maxMovement := max(1, 13 - ((Gear^.Timer * 15) div 250)); ShakeCamera(maxMovement); end; -*) if Gear^.Timer > 250 then DeleteVisualGear(Gear); end; diff -r 55c08df2bdfd -r 3a04c30e5ac7 hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Wed Sep 07 15:06:42 2011 -0400 +++ b/hedgewars/uVisualGears.pas Wed Sep 07 20:12:20 2011 -0400 @@ -29,7 +29,7 @@ * E.g.: background flakes, visual effects: explosion, smoke trails, etc. *) interface -uses uConsts, uFloat, GLunit, uTypes; +uses uConsts, uFloat, GLunit, uTypes, uWorld; procedure initModule; procedure freeModule; diff -r 55c08df2bdfd -r 3a04c30e5ac7 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Wed Sep 07 15:06:42 2011 -0400 +++ b/hedgewars/uWorld.pas Wed Sep 07 20:12:20 2011 -0400 @@ -1314,9 +1314,12 @@ 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)); + //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)) end;