--- a/hedgewars/uMobile.pas Wed Jun 13 11:18:30 2012 -0400
+++ b/hedgewars/uMobile.pas Wed Jun 13 23:25:15 2012 +0200
@@ -28,6 +28,7 @@
interface
function isPhone: Boolean; inline;
+function getScreenDPI: Single; inline;
procedure performRumble; inline;
procedure GameLoading; inline;
@@ -47,6 +48,10 @@
procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
{$ENDIF}
+{$IFDEF ANDROID}
+function Android_JNI_getDensity(): Single; cdecl; external;
+{$ENDIF}
+
// this function is just to determine whether we are running on a limited screen device
function isPhone: Boolean; inline;
begin
@@ -61,6 +66,15 @@
{$ENDIF}
end;
+function getScreenDPI: Single; inline;
+begin
+{$IFDEF ANDROID}
+ getScreenDPI:= Android_JNI_getDensity();
+{$ELSE}
+ getScreenDPI:= 1;
+{$ENDIF}
+end;
+
// this function should make the device vibrate in some way
procedure PerformRumble; inline;
{$IFDEF IPHONEOS}const kSystemSoundID_Vibrate = $00000FFF;{$ENDIF}