hedgewars/uMobile.pas
changeset 5167 7b515d0945b1
parent 4976 088d40d8aba2
child 5168 8a074a255af0
equal deleted inserted replaced
5166:d1eb1560b4d5 5167:7b515d0945b1
    33 function  isApplePhone: Boolean; cdecl; external;
    33 function  isApplePhone: Boolean; cdecl; external;
    34 procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
    34 procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
    35 {$ENDIF}
    35 {$ENDIF}
    36 function  isPhone: Boolean; inline;
    36 function  isPhone: Boolean; inline;
    37 procedure performRumble; inline;
    37 procedure performRumble; inline;
    38 procedure perfExt_AddProgress; inline;
    38 
    39 procedure perfExt_FinishProgress; inline;
    39 procedure AddProgress; inline;
    40 procedure perfExt_AmmoUpdate; // don't inline
    40 procedure FinishProgress; inline;
    41 procedure perfExt_NewTurnBeginning; inline;
    41 procedure AmmoUpdate; // don't inline
    42 procedure perfExt_SaveBeganSynching; inline;
    42 procedure NewTurnBeginning; inline;
    43 procedure perfExt_SaveFinishedSynching; inline;
    43 procedure SaveBeganSynching; inline;
       
    44 procedure SaveFinishedSynching; inline;
    44 
    45 
    45 implementation
    46 implementation
    46 uses uVariables;
    47 uses uVariables;
    47 
    48 
    48 const kSystemSoundID_Vibrate = $00000FFF;
    49 const kSystemSoundID_Vibrate = $00000FFF;
    60 {$IFDEF IPHONEOS}
    61 {$IFDEF IPHONEOS}
    61     AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
    62     AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
    62 {$ENDIF}
    63 {$ENDIF}
    63 end;
    64 end;
    64 
    65 
    65 procedure perfExt_AddProgress; inline;
    66 procedure AddProgress; inline;
    66 begin
    67 begin
    67 {$IFDEF IPHONEOS}
    68 {$IFDEF IPHONEOS}
    68     startSpinning();
    69     startSpinning();
    69 {$ENDIF}
    70 {$ENDIF}
    70 end;
    71 end;
    71 
    72 
    72 procedure perfExt_FinishProgress; inline;
    73 procedure FinishProgress; inline;
    73 begin
    74 begin
    74 {$IFDEF IPHONEOS}
    75 {$IFDEF IPHONEOS}
    75     stopSpinning();
    76     stopSpinning();
    76 {$ENDIF}
    77 {$ENDIF}
    77 end;
    78 end;
    78 
    79 
    79 procedure perfExt_AmmoUpdate; // don't inline
    80 procedure AmmoUpdate; // don't inline
    80 begin
    81 begin
    81 {$IFDEF IPHONEOS}
    82 {$IFDEF IPHONEOS}
    82     if (CurrentTeam = nil) or
    83     if (CurrentTeam = nil) or
    83        (CurrentTeam^.ExtDriven) or
    84        (CurrentTeam^.ExtDriven) or
    84        (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
    85        (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
    85         exit(); // the other way around throws a compiler error
    86         exit(); // the other way around throws a compiler error
    86     updateVisualsNewTurn();
    87     updateVisualsNewTurn();
    87 {$ENDIF}
    88 {$ENDIF}
    88 end;
    89 end;
    89 
    90 
    90 procedure perfExt_NewTurnBeginning; inline;
    91 procedure NewTurnBeginning; inline;
    91 begin
    92 begin
    92 {$IFDEF IPHONEOS}
    93 {$IFDEF IPHONEOS}
    93     clearView();
    94     clearView();
    94     perfExt_AmmoUpdate();
       
    95 {$ENDIF}
    95 {$ENDIF}
       
    96     AmmoUpdate();
    96 end;
    97 end;
    97 
    98 
    98 procedure perfExt_SaveBeganSynching; inline;
    99 procedure SaveBeganSynching; inline;
    99 begin
   100 begin
   100 {$IFDEF IPHONEOS}
   101 {$IFDEF IPHONEOS}
   101     replayBegan();
   102     replayBegan();
   102 {$ENDIF}
   103 {$ENDIF}
   103 end;
   104 end;
   104 
   105 
   105 procedure perfExt_SaveFinishedSynching; inline;
   106 procedure SaveFinishedSynching; inline;
   106 begin
   107 begin
   107 {$IFDEF IPHONEOS}
   108 {$IFDEF IPHONEOS}
   108     replayFinished();
   109     replayFinished();
   109 {$ENDIF}
   110 {$ENDIF}
   110 end;
   111 end;