hedgewars/uWorld.pas
changeset 7288 5d0704f23a2a
parent 7188 580cd247511e
parent 7237 1bbe31e0d707
child 7291 ad4b6c2b09e8
equal deleted inserted replaced
7188:580cd247511e 7288:5d0704f23a2a
   213 procedure InitTouchInterface;
   213 procedure InitTouchInterface;
   214 begin
   214 begin
   215 {$IFDEF USE_TOUCH_INTERFACE}
   215 {$IFDEF USE_TOUCH_INTERFACE}
   216 
   216 
   217 //positioning of the buttons
   217 //positioning of the buttons
   218 {$IFDEF ANDROID}
   218 buttonScale:= uMobile.getScreenDPI/cDefaultZoomLevel;
   219 buttonScale:= Android_JNI_getDensity()/cDefaultZoomLevel;
       
   220 {$ELSE}
       
   221 buttonScale:= 1.5/cDefaultZoomLevel;
       
   222 {$ENDIF}
       
   223 
   219 
   224 
   220 
   225 with JumpWidget do
   221 with JumpWidget do
   226     begin
   222     begin
   227     show:= true;
   223     show:= true;
  1488             end;
  1484             end;
  1489         if fpsTexture <> nil then
  1485         if fpsTexture <> nil then
  1490             DrawTexture((cScreenWidth shr 1) - 60 - offsetY, offsetX, fpsTexture);
  1486             DrawTexture((cScreenWidth shr 1) - 60 - offsetY, offsetX, fpsTexture);
  1491         end;
  1487         end;
  1492 
  1488 
  1493     if CountTicks >= 1000 then
       
  1494         CountTicks:= 0;
       
  1495 
       
  1496     // lag warning (?)
  1489     // lag warning (?)
  1497     inc(SoundTimerTicks, Lag);
  1490     inc(SoundTimerTicks, Lag);
  1498 end;
  1491 end;
  1499 
  1492 
  1500 if SoundTimerTicks >= 50 then
  1493 if SoundTimerTicks >= 50 then
  1582 if (not (CurrentTeam^.ExtDriven and isCursorVisible and (not bShowAmmoMenu))) and cHasFocus and (GameState <> gsConfirm) then
  1575 if (not (CurrentTeam^.ExtDriven and isCursorVisible and (not bShowAmmoMenu))) and cHasFocus and (GameState <> gsConfirm) then
  1583     uCursor.updatePosition();
  1576     uCursor.updatePosition();
  1584 {$ENDIF}
  1577 {$ENDIF}
  1585 z:= round(200/zoom);
  1578 z:= round(200/zoom);
  1586 if not PlacingHogs and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) then
  1579 if not PlacingHogs and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) then
  1587     if (not autoCameraOn) or ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then
  1580     if (not autoCameraOn) then
       
  1581         FollowGear:= nil
       
  1582     else        
       
  1583     if ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then
  1588         begin
  1584         begin
  1589         FollowGear:= nil;
  1585         FollowGear:= nil;
  1590         prevPoint:= CursorPoint;
  1586         prevPoint:= CursorPoint;
  1591         exit
  1587         exit
  1592         end
  1588         end
  1632     end
  1628     end
  1633 else
  1629 else
  1634     EdgesDist:= cGearScrEdgesDist;
  1630     EdgesDist:= cGearScrEdgesDist;
  1635 
  1631 
  1636 // this generates the border around the screen that moves the camera when cursor is near it
  1632 // this generates the border around the screen that moves the camera when cursor is near it
  1637 if isCursorVisible or (FollowGear <> nil) then
  1633 if isCursorVisible or ((FollowGear <> nil) and autoCameraOn) then
  1638     begin
  1634     begin
  1639     if CursorPoint.X < - cScreenWidth div 2 + EdgesDist then
  1635     if CursorPoint.X < - cScreenWidth div 2 + EdgesDist then
  1640         begin
  1636         begin
  1641         WorldDx:= WorldDx - CursorPoint.X - cScreenWidth div 2 + EdgesDist;
  1637         WorldDx:= WorldDx - CursorPoint.X - cScreenWidth div 2 + EdgesDist;
  1642         CursorPoint.X:= - cScreenWidth div 2 + EdgesDist
  1638         CursorPoint.X:= - cScreenWidth div 2 + EdgesDist