hedgewars/uMobile.pas
changeset 6624 e049b5bb0ad1
parent 6601 5965e2927b3d
child 6700 e04da46ee43c
equal deleted inserted replaced
6623:6bf169f1e97c 6624:e049b5bb0ad1
    25 (*  iOS calls written in ObjcExports.m  *)
    25 (*  iOS calls written in ObjcExports.m  *)
    26 procedure clearView; cdecl; external;
    26 procedure clearView; cdecl; external;
    27 procedure startLoadingIndicator; cdecl; external;
    27 procedure startLoadingIndicator; cdecl; external;
    28 procedure stopLoadingIndicator; cdecl; external;
    28 procedure stopLoadingIndicator; cdecl; external;
    29 procedure saveFinishedSynching; cdecl; external;
    29 procedure saveFinishedSynching; cdecl; external;
    30 procedure updateVisualsNewTurn; cdecl; external;
       
    31 function  isApplePhone: Boolean; cdecl; external;
    30 function  isApplePhone: Boolean; cdecl; external;
    32 procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
    31 procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
    33 {$ENDIF}
    32 {$ENDIF}
    34 function  isPhone: Boolean; inline;
    33 function  isPhone: Boolean; inline;
    35 procedure performRumble; inline;
    34 procedure performRumble; inline;
    36 
    35 
    37 procedure GameLoading; inline;
    36 procedure GameLoading; inline;
    38 procedure GameLoaded; inline;
    37 procedure GameLoaded; inline;
    39 procedure AmmoUpdate; // do not inline
       
    40 procedure NewTurnBeginning; inline;
    38 procedure NewTurnBeginning; inline;
    41 procedure SaveLoadingEnded; inline;
    39 procedure SaveLoadingEnded; inline;
    42 
    40 
    43 implementation
    41 implementation
    44 uses uVariables, uConsole;
    42 uses uVariables, uConsole;
    86 {$IFDEF IPHONEOS}
    84 {$IFDEF IPHONEOS}
    87     stopLoadingIndicator();
    85     stopLoadingIndicator();
    88 {$ENDIF}
    86 {$ENDIF}
    89 end;
    87 end;
    90 
    88 
    91 procedure AmmoUpdate; // do not inline
       
    92 begin
       
    93 {$IFDEF IPHONEOS}
       
    94     if (CurrentTeam = nil) or (CurrentTeam^.ExtDriven) or (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
       
    95         exit(); // the other way around throws a compiler error
       
    96     updateVisualsNewTurn();
       
    97 {$ENDIF}
       
    98 end;
       
    99 
       
   100 procedure NewTurnBeginning; inline;
    89 procedure NewTurnBeginning; inline;
   101 begin
    90 begin
   102 {$IFDEF IPHONEOS}
    91 {$IFDEF IPHONEOS}
   103     clearView();
    92     clearView();
   104 {$ENDIF}
    93 {$ENDIF}
   105     AmmoUpdate();
       
   106 end;
    94 end;
   107 
    95 
   108 procedure SaveLoadingEnded; inline;
    96 procedure SaveLoadingEnded; inline;
   109 begin
    97 begin
   110 {$IFDEF IPHONEOS}
    98 {$IFDEF IPHONEOS}