# HG changeset patch # User sheepluva # Date 1314288524 -7200 # Node ID 06d5f561f772bc6bb8e219ad5a2f47f305b821ea # Parent 5fc750c7f2b4b002ba40dc257ba8c5c9f529e715 some camera adjustments (should also fix cam flickering on lowerst res) diff -r 5fc750c7f2b4 -r 06d5f561f772 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Thu Aug 25 14:56:51 2011 +0200 +++ b/hedgewars/hwengine.pas Thu Aug 25 18:08:44 2011 +0200 @@ -183,6 +183,7 @@ else cScreenHeight:= cMinScreenHeight; ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true); WriteLnToConsole('window resize'); + InitCameraBorders(); end; {$ENDIF} SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); diff -r 5fc750c7f2b4 -r 06d5f561f772 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Thu Aug 25 14:56:51 2011 +0200 +++ b/hedgewars/uWorld.pas Thu Aug 25 18:08:44 2011 +0200 @@ -32,6 +32,7 @@ procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt); procedure HideMission; procedure ShakeCamera(amount: LongWord); +procedure InitCameraBorders; procedure MoveCamera; procedure onFocusStateChanged; @@ -175,7 +176,7 @@ //cWaveHeight:= SpritesData[sprWater].Height; cWaveHeight:= 32; -cGearScrEdgesDist:= Min(cScreenWidth div 2 - 100, cScreenHeight div 2 - 50); +InitCameraBorders(); uCursor.init(); prevPoint.X:= 0; prevPoint.Y:= cScreenHeight div 2; @@ -196,6 +197,10 @@ HorizontOffset:= 0; end; +procedure InitCameraBorders; +begin +cGearScrEdgesDist:= min(2 * cScreenHeight div 5, 2 * cScreenWidth div 5); +end; procedure ShowAmmoMenu; const MENUSPEED = 15; @@ -1190,8 +1195,8 @@ end else begin - CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * 100 + WorldDx) div 8; - CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + WorldDy)) div 8; + CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * (FollowGear^.dX.QWordValue div _0_01.QWordValue) * 3 + WorldDx) div 8; + CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + hwSign(FollowGear^.dY) * (FollowGear^.dY.QWordValue div _0_01.QWordValue) * 3 + WorldDy)) div 8; end; wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - cVisibleWater;