# HG changeset patch # User koda # Date 1316764721 -7200 # Node ID 3c578f531cc15cf45d84420fcdcf31baaeb85270 # Parent 412ada3d2041b8c259f4bf23d13fa988ed32b740 don't rumble while synchronising a demo/save diff -r 412ada3d2041 -r 3c578f531cc1 hedgewars/uMobile.pas --- a/hedgewars/uMobile.pas Thu Sep 22 23:20:11 2011 +0200 +++ b/hedgewars/uMobile.pas Fri Sep 23 09:58:41 2011 +0200 @@ -38,7 +38,7 @@ procedure GameLoading; inline; procedure GameLoaded; inline; -procedure AmmoUpdate; // don't inline +procedure AmmoUpdate; // do not inline procedure NewTurnBeginning; inline; procedure SaveBegan; inline; procedure SaveFinished; inline; @@ -46,6 +46,7 @@ implementation uses uVariables; +// this function is just to determine whether we are running on a limited screen device function isPhone: Boolean; inline; begin {$IFDEF IPHONEOS} @@ -54,12 +55,17 @@ exit(false); end; +// this function should make the device vibrate in some way procedure performRumble; inline; const kSystemSoundID_Vibrate = $00000FFF; begin + // do not vibrate while synchronising a demo/save + if not fastUntilLag then + begin {$IFDEF IPHONEOS} - AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); + AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); {$ENDIF} + end; end; procedure GameLoading; inline; @@ -76,7 +82,7 @@ {$ENDIF} end; -procedure AmmoUpdate; // don't inline +procedure AmmoUpdate; // do not inline begin {$IFDEF IPHONEOS} if (CurrentTeam = nil) or diff -r 412ada3d2041 -r 3c578f531cc1 project_files/HedgewarsMobile/Classes/CommodityFunctions.h --- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Thu Sep 22 23:20:11 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Fri Sep 23 09:58:41 2011 +0200 @@ -65,7 +65,6 @@ void print_free_memory (void); void playSound (NSString *snd); -BOOL isApplePhone (void); NSInteger randomPort (void); NSString *getModelType (void); diff -r 412ada3d2041 -r 3c578f531cc1 project_files/HedgewarsMobile/Classes/CommodityFunctions.m --- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.m Thu Sep 22 23:20:11 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.m Fri Sep 23 09:58:41 2011 +0200 @@ -63,10 +63,6 @@ #endif } -BOOL inline isApplePhone () { - return (IS_IPAD() == NO); -} - NSString *getModelType () { size_t size; // set 'oldp' parameter to NULL to get the size of the data returned so we can allocate appropriate amount of space diff -r 412ada3d2041 -r 3c578f531cc1 project_files/HedgewarsMobile/Classes/ObjcExports.h --- a/project_files/HedgewarsMobile/Classes/ObjcExports.h Thu Sep 22 23:20:11 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/ObjcExports.h Fri Sep 23 09:58:41 2011 +0200 @@ -27,6 +27,7 @@ NSInteger cachedGrenadeTime(); void clearView(); void setGrenadeTime(NSInteger value); +BOOL isApplePhone(void); void startSpinningProgress(); void stopSpinningProgress(); diff -r 412ada3d2041 -r 3c578f531cc1 project_files/HedgewarsMobile/Classes/ObjcExports.m --- a/project_files/HedgewarsMobile/Classes/ObjcExports.m Thu Sep 22 23:20:11 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/ObjcExports.m Fri Sep 23 09:58:41 2011 +0200 @@ -62,6 +62,10 @@ #pragma mark - #pragma mark functions called by pascal code +BOOL inline isApplePhone() { + return (IS_IPAD() == NO); +} + void startSpinningProgress() { gameRunning = NO; overlay_instance.lowerIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];