hedgewars/uMobile.pas
changeset 5994 3c578f531cc1
parent 5180 a881cd3d3163
child 6247 6dfad55fd71c
equal deleted inserted replaced
5993:412ada3d2041 5994:3c578f531cc1
    36 function  isPhone: Boolean; inline;
    36 function  isPhone: Boolean; inline;
    37 procedure performRumble; inline;
    37 procedure performRumble; inline;
    38 
    38 
    39 procedure GameLoading; inline;
    39 procedure GameLoading; inline;
    40 procedure GameLoaded; inline;
    40 procedure GameLoaded; inline;
    41 procedure AmmoUpdate; // don't inline
    41 procedure AmmoUpdate; // do not inline
    42 procedure NewTurnBeginning; inline;
    42 procedure NewTurnBeginning; inline;
    43 procedure SaveBegan; inline;
    43 procedure SaveBegan; inline;
    44 procedure SaveFinished; inline;
    44 procedure SaveFinished; inline;
    45 
    45 
    46 implementation
    46 implementation
    47 uses uVariables;
    47 uses uVariables;
    48 
    48 
       
    49 // this function is just to determine whether we are running on a limited screen device
    49 function isPhone: Boolean; inline;
    50 function isPhone: Boolean; inline;
    50 begin
    51 begin
    51 {$IFDEF IPHONEOS}
    52 {$IFDEF IPHONEOS}
    52     exit(isApplePhone());
    53     exit(isApplePhone());
    53 {$ENDIF}
    54 {$ENDIF}
    54     exit(false);
    55     exit(false);
    55 end;
    56 end;
    56 
    57 
       
    58 // this function should make the device vibrate in some way
    57 procedure performRumble; inline;
    59 procedure performRumble; inline;
    58 const kSystemSoundID_Vibrate = $00000FFF;
    60 const kSystemSoundID_Vibrate = $00000FFF;
    59 begin
    61 begin
       
    62     // do not vibrate while synchronising a demo/save
       
    63     if not fastUntilLag then
       
    64         begin
    60 {$IFDEF IPHONEOS}
    65 {$IFDEF IPHONEOS}
    61     AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
    66         AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
    62 {$ENDIF}
    67 {$ENDIF}
       
    68         end;
    63 end;
    69 end;
    64 
    70 
    65 procedure GameLoading; inline;
    71 procedure GameLoading; inline;
    66 begin
    72 begin
    67 {$IFDEF IPHONEOS}
    73 {$IFDEF IPHONEOS}
    74 {$IFDEF IPHONEOS}
    80 {$IFDEF IPHONEOS}
    75     stopSpinningProgress();
    81     stopSpinningProgress();
    76 {$ENDIF}
    82 {$ENDIF}
    77 end;
    83 end;
    78 
    84 
    79 procedure AmmoUpdate; // don't inline
    85 procedure AmmoUpdate; // do not inline
    80 begin
    86 begin
    81 {$IFDEF IPHONEOS}
    87 {$IFDEF IPHONEOS}
    82     if (CurrentTeam = nil) or
    88     if (CurrentTeam = nil) or
    83        (CurrentTeam^.ExtDriven) or
    89        (CurrentTeam^.ExtDriven) or
    84        (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
    90        (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then