hedgewars/uMobile.pas
changeset 7557 5a28d3cfbf62
parent 7237 1bbe31e0d707
child 8026 4a4f21070479
equal deleted inserted replaced
7555:acadabfb2dd1 7557:5a28d3cfbf62
    26 
    26 
    27 unit uMobile;
    27 unit uMobile;
    28 interface
    28 interface
    29 
    29 
    30 function  isPhone: Boolean; inline;
    30 function  isPhone: Boolean; inline;
    31 function  getScreenDPI: Single; inline;
    31 function  getScreenDPI: Double; inline;
    32 procedure performRumble; inline;
    32 procedure performRumble; inline;
    33 
    33 
    34 procedure GameLoading; inline;
    34 procedure GameLoading; inline;
    35 procedure GameLoaded; inline;
    35 procedure GameLoaded; inline;
    36 procedure SaveLoadingEnded; inline;
    36 procedure SaveLoadingEnded; inline;
    37 
    37 
    38 implementation
    38 implementation
    39 uses uVariables, uConsole;
    39 uses uVariables, uConsole, SDLh;
    40 
    40 
    41 // add here any external call that you need
    41 // add here any external call that you need
    42 {$IFDEF IPHONEOS}
    42 {$IFDEF IPHONEOS}
    43 (*  iOS calls written in ObjcExports.m  *)
    43 (*  iOS calls written in ObjcExports.m  *)
    44 procedure startLoadingIndicator; cdecl; external;
    44 procedure startLoadingIndicator; cdecl; external;
    45 procedure stopLoadingIndicator; cdecl; external;
    45 procedure stopLoadingIndicator; cdecl; external;
    46 procedure saveFinishedSynching; cdecl; external;
    46 procedure saveFinishedSynching; cdecl; external;
    47 function  isApplePhone: Boolean; cdecl; external;
    47 function  isApplePhone: Boolean; cdecl; external;
    48 procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
    48 procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
    49 {$ENDIF}
       
    50 
       
    51 {$IFDEF ANDROID}
       
    52 function Android_JNI_getDensity(): Single; cdecl; external;
       
    53 {$ENDIF}
    49 {$ENDIF}
    54 
    50 
    55 // this function is just to determine whether we are running on a limited screen device
    51 // this function is just to determine whether we are running on a limited screen device
    56 function isPhone: Boolean; inline;
    52 function isPhone: Boolean; inline;
    57 begin
    53 begin
    64     if (cScreenWidth < 1000) and (cScreenHeight < 500) then
    60     if (cScreenWidth < 1000) and (cScreenHeight < 500) then
    65         isPhone:= true;
    61         isPhone:= true;
    66 {$ENDIF}
    62 {$ENDIF}
    67 end;
    63 end;
    68 
    64 
    69 function getScreenDPI: Single; inline;
    65 function getScreenDPI: Double; inline;
    70 begin
    66 begin
    71 {$IFDEF ANDROID}
    67 {$IFDEF ANDROID}
    72     getScreenDPI:= Android_JNI_getDensity();
    68 //    getScreenDPI:= Android_JNI_getDensity();
       
    69     getScreenDPI:= 1;
    73 {$ELSE}
    70 {$ELSE}
    74     getScreenDPI:= 1;
    71     getScreenDPI:= 1;
    75 {$ENDIF}
    72 {$ENDIF}
    76 end;
    73 end;
    77 
    74