--- a/hedgewars/uTouch.pas Tue Jun 12 17:20:27 2012 +0400
+++ b/hedgewars/uTouch.pas Sun Jun 24 20:31:26 2012 +0400
@@ -22,7 +22,7 @@
interface
-uses SysUtils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, uIO, GLUnit, uTypes, uCaptions, uAmmos, uWorld;
+uses SysUtils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, uIO, GLUnit, uTypes, uCaptions, uAmmos, uWorld, uMobile;
procedure initModule;
@@ -557,7 +557,7 @@
isOnCrosshair:= isOnRect((x-HalfRectSize), (y-HalfRectSize), RectSize, RectSize, finger);
printFinger(finger);
WriteLnToConsole(inttostr(finger.x) + ' ' + inttostr(x));
- WriteLnToConsole(inttostr(x) + ' ' + inttostr(y) + ' ' + inttostr(round(Android_JNI_getDensity() * 10)));
+ WriteLnToConsole(inttostr(x) + ' ' + inttostr(y) + ' ' + inttostr(round(uMobile.getScreenDPI * 10)));
end;
function isOnCurrentHog(finger: TTouch_Data): boolean;
@@ -632,7 +632,6 @@
var
index: Longword;
//uRenderCoordScaleX, uRenderCoordScaleY: Longword;
- density: Single;
begin
buttonsDown:= 0;
@@ -640,13 +639,7 @@
for index := 0 to High(fingers) do
fingers[index].id := nilFingerId;
-{$IFDEF ANDROID}
- density:= Android_JNI_getDensity();
-{$ELSE}
- density:= 1.0;
-{$ENDIF}
-
- rectSize:= round(baseRectSize * density);
+ rectSize:= round(baseRectSize * uMobile.getScreenDPI);
halfRectSize:= rectSize shl 1;
end;