hedgewars/uUtils.pas
branchwebgl
changeset 9521 8054d9d775fd
parent 9127 e350500c4edb
parent 9377 48ab6dea8d2f
child 9950 2759212a27de
--- a/hedgewars/uUtils.pas	Fri Oct 11 11:55:31 2013 +0200
+++ b/hedgewars/uUtils.pas	Fri Oct 11 17:43:13 2013 +0200
@@ -21,7 +21,7 @@
 unit uUtils;
 
 interface
-uses uTypes, uFloat, GLunit;
+uses uTypes, uFloat;
 
 procedure SplitBySpace(var a, b: shortstring);
 procedure SplitByChar(var a, b: shortstring; c: char);
@@ -44,7 +44,7 @@
 function  StrToInt(s: shortstring): LongInt;
 function  FloatToStr(n: hwFloat): shortstring;
 
-function  DxDy2Angle(const _dY, _dX: hwFloat): GLfloat; inline;
+function  DxDy2Angle(const _dY, _dX: hwFloat): real; inline;
 function  DxDy2Angle32(const _dY, _dX: hwFloat): LongInt;
 function  DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt;
 function  DxDy2AttackAnglef(const _dY, _dX: extended): LongInt;
@@ -75,7 +75,6 @@
 {$ENDIF}
 
 function  isPhone: Boolean; inline;
-function  getScreenDPI: Double; inline; //cdecl; external;
 
 {$IFDEF IPHONEOS}
 procedure startLoadingIndicator; cdecl; external;
@@ -214,7 +213,7 @@
 end;
 
 
-function DxDy2Angle(const _dY, _dX: hwFloat): GLfloat; inline;
+function DxDy2Angle(const _dY, _dX: hwFloat): real; inline;
 var dY, dX: Extended;
 begin
 dY:= hwFloat2Float(_dY);
@@ -452,16 +451,6 @@
 {$ENDIF}
 end;
 
-//This dummy function should be reimplemented (externally).
-function getScreenDPI: Double; inline;
-begin
-{$IFDEF ANDROID}
-//    getScreenDPI:= Android_JNI_getDensity();
-    getScreenDPI:= 1;
-{$ELSE}
-    getScreenDPI:= 1;
-{$ENDIF}
-end;
 
 function  sanitizeForLog(s: shortstring): shortstring;
 var i: byte;
@@ -533,6 +522,19 @@
 {$I+}
 {$ENDIF}
 
+    //mobile stuff
+{$IFDEF IPHONEOS}
+    mobileRecord.PerformRumble:= @AudioServicesPlaySystemSound;
+    mobileRecord.GameLoading:= @startLoadingIndicator;
+    mobileRecord.GameLoaded:= @stopLoadingIndicator;
+    mobileRecord.SaveLoadingEnded:= @saveFinishedSynching;
+{$ELSE}
+    mobileRecord.PerformRumble:= nil;
+    mobileRecord.GameLoading:= nil;
+    mobileRecord.GameLoaded:= nil;
+    mobileRecord.SaveLoadingEnded:= nil;
+{$ENDIF}
+
 end;
 
 procedure freeModule;