hedgewars/uWorld.pas
changeset 5851 e6151aca2d7c
parent 5848 103e3a80daa6
child 5852 fe010d3a4330
equal deleted inserted replaced
5850:f07e2a5e6ad0 5851:e6151aca2d7c
  1176    end;
  1176    end;
  1177 isFirstFrame:= false
  1177 isFirstFrame:= false
  1178 end;
  1178 end;
  1179 
  1179 
  1180 procedure MoveCamera;
  1180 procedure MoveCamera;
  1181 var EdgesDist, wdy, shs: LongInt;
  1181 var EdgesDist, wdy, shs,z: LongInt;
  1182     PrevSentPointTime: LongWord = 0;
  1182     PrevSentPointTime: LongWord = 0;
  1183 begin
  1183 begin
  1184 {$IFNDEF IPHONEOS}
  1184 {$IFNDEF IPHONEOS}
  1185 if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus and (GameState <> gsConfirm) then
  1185 if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus and (GameState <> gsConfirm) then
  1186     uCursor.updatePosition();
  1186     uCursor.updatePosition();
  1187 {$ENDIF}
  1187 {$ENDIF}
  1188 
  1188 z:= round(2/zoom);
  1189 if (not PlacingHogs) and (FollowGear <> nil) and (not isCursorVisible) and (not fastUntilLag) then
  1189 if (not PlacingHogs) and (FollowGear <> nil) and (not isCursorVisible) and (not fastUntilLag) then
  1190     if (not autoCameraOn) or (abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4) then
  1190     if (not autoCameraOn) or ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then
  1191     begin
  1191     begin
  1192         FollowGear:= nil;
  1192         FollowGear:= nil;
  1193         prevPoint:= CursorPoint;
  1193         prevPoint:= CursorPoint;
  1194         exit
  1194         exit
  1195     end
  1195     end
  1196     else
  1196     else
  1197     begin
  1197     begin
  1198         CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * 100 + WorldDx) div 8;
  1198         CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * 100*z + WorldDx) div 8;
  1199         CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y)+ hwSign(FollowGear^.dX) * 100 + WorldDy)) div 8;
  1199         CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y)+ hwSign(FollowGear^.dY) * 100*z + WorldDy)) div 8;
  1200     end;
  1200     end;
  1201 
  1201 
  1202 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - cVisibleWater;
  1202 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - cVisibleWater;
  1203 if WorldDy < wdy then WorldDy:= wdy;
  1203 if WorldDy < wdy then WorldDy:= wdy;
  1204 
  1204