hedgewars/uUtils.pas
changeset 8204 9a6030d96273
parent 8095 df61e150eb70
child 8330 aaefa587e277
child 8370 0c79946e96f8
equal deleted inserted replaced
8203:2c98ec41697a 8204:9a6030d96273
    69 function  GetLaunchY(at: TAmmoType; angle: LongInt): LongInt;
    69 function  GetLaunchY(at: TAmmoType; angle: LongInt): LongInt;
    70 
    70 
    71 {$IFNDEF PAS2C}
    71 {$IFNDEF PAS2C}
    72 procedure Write(var f: textfile; s: shortstring);
    72 procedure Write(var f: textfile; s: shortstring);
    73 procedure WriteLn(var f: textfile; s: shortstring);
    73 procedure WriteLn(var f: textfile; s: shortstring);
       
    74 {$ENDIF}
       
    75 
       
    76 function  isPhone: Boolean; inline;
       
    77 function  getScreenDPI: Double; inline; //cdecl; external;
       
    78 
       
    79 {$IFDEF IPHONEOS}
       
    80 procedure startLoadingIndicator; cdecl; external;
       
    81 procedure stopLoadingIndicator; cdecl; external;
       
    82 procedure saveFinishedSynching; cdecl; external;
       
    83 function  isApplePhone: Boolean; cdecl; external;
       
    84 procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
    74 {$ENDIF}
    85 {$ENDIF}
    75 
    86 
    76 procedure initModule(isNotPreview: boolean);
    87 procedure initModule(isNotPreview: boolean);
    77 procedure freeModule;
    88 procedure freeModule;
    78 
    89 
   399 begin
   410 begin
   400 system.writeln(f, s)
   411 system.writeln(f, s)
   401 end;
   412 end;
   402 {$ENDIF}
   413 {$ENDIF}
   403 
   414 
       
   415 // this function is just to determine whether we are running on a limited screen device
       
   416 function isPhone: Boolean; inline;
       
   417 begin
       
   418     isPhone:= false;
       
   419 {$IFDEF IPHONEOS}
       
   420     isPhone:= isApplePhone();
       
   421 {$ENDIF}
       
   422 {$IFDEF ANDROID}
       
   423     //nasty nasty hack. TODO: implement callback to java to have a unified way of determining if it is a tablet
       
   424     if (cScreenWidth < 1000) and (cScreenHeight < 500) then
       
   425         isPhone:= true;
       
   426 {$ENDIF}
       
   427 end;
       
   428 
       
   429 //This dummy function should be reimplemented (externally).
       
   430 function getScreenDPI: Double; inline;
       
   431 begin
       
   432 {$IFDEF ANDROID}
       
   433 //    getScreenDPI:= Android_JNI_getDensity();
       
   434     getScreenDPI:= 1;
       
   435 {$ELSE}
       
   436     getScreenDPI:= 1;
       
   437 {$ENDIF}
       
   438 end;
       
   439 
   404 procedure initModule(isNotPreview: boolean);
   440 procedure initModule(isNotPreview: boolean);
   405 {$IFDEF DEBUGFILE}
   441 {$IFDEF DEBUGFILE}
   406 var logfileBase: shortstring;
   442 var logfileBase: shortstring;
   407     i: LongInt;
   443     i: LongInt;
   408 {$ENDIF}
   444 {$ENDIF}