remove old and unused getScreenDPI code
authorkoda
Fri, 26 Jul 2013 23:02:25 +0200
changeset 9377 48ab6dea8d2f
parent 9376 0405f5f4e7e0
child 9378 2be457289e60
remove old and unused getScreenDPI code
hedgewars/uTouch.pas
hedgewars/uTypes.pas
hedgewars/uUtils.pas
hedgewars/uWorld.pas
--- a/hedgewars/uTouch.pas	Fri Jul 26 00:37:56 2013 +0200
+++ b/hedgewars/uTouch.pas	Fri Jul 26 23:02:25 2013 +0200
@@ -558,7 +558,7 @@
     isOnCrosshair:= isOnRect((x-HalfRectSize), (y-HalfRectSize), RectSize, RectSize, finger);
     printFinger(finger);
     WriteLnToConsole(inttostr(finger.x) + '   ' + inttostr(x));
-    WriteLnToConsole(inttostr(x) + '  ' + inttostr(y) + '   ' + inttostr(round(mobileRecord.getScreenDPI() * 10)));
+    WriteLnToConsole(inttostr(x) + '  ' + inttostr(y) + '   ' + inttostr(10));
 end;
 
 function isOnCurrentHog(finger: TTouch_Data): boolean;
@@ -640,8 +640,8 @@
     for index := 0 to High(fingers) do 
         fingers[index].id := nilFingerId;
 
-    rectSize:= round(baseRectSize * mobileRecord.getScreenDPI());
-    halfRectSize:= rectSize shl 1;
+    rectSize:= baseRectSize;
+    halfRectSize:= baseRectSize shl 1;
 end;
 
 procedure freeModule;
--- a/hedgewars/uTypes.pas	Fri Jul 26 00:37:56 2013 +0200
+++ b/hedgewars/uTypes.pas	Fri Jul 26 23:02:25 2013 +0200
@@ -413,10 +413,8 @@
 
      cdeclPtr = procedure; cdecl;
      cdeclIntPtr = procedure(num: LongInt); cdecl;
-     functionDoublePtr = function: Double;
 
      TMobileRecord = record
-                     getScreenDPI: functionDoublePtr;
                      PerformRumble: cdeclIntPtr;
                      GameLoading: cdeclPtr;
                      GameLoaded: cdeclPtr;
--- a/hedgewars/uUtils.pas	Fri Jul 26 00:37:56 2013 +0200
+++ b/hedgewars/uUtils.pas	Fri Jul 26 23:02:25 2013 +0200
@@ -70,7 +70,6 @@
 procedure WriteLn(var f: textfile; s: shortstring);
 
 function  isPhone: Boolean; inline;
-function  getScreenDPI: Double; inline; //cdecl; external;
 
 {$IFDEF IPHONEOS}
 procedure startLoadingIndicator; cdecl; external;
@@ -428,16 +427,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;
@@ -506,7 +495,6 @@
 {$ENDIF}
 
     //mobile stuff
-    mobileRecord.getScreenDPI:= @getScreenDPI; //TODO: define external function.
 {$IFDEF IPHONEOS}
     mobileRecord.PerformRumble:= @AudioServicesPlaySystemSound;
     mobileRecord.GameLoading:= @startLoadingIndicator;
--- a/hedgewars/uWorld.pas	Fri Jul 26 00:37:56 2013 +0200
+++ b/hedgewars/uWorld.pas	Fri Jul 26 23:02:25 2013 +0200
@@ -244,7 +244,7 @@
 {$IFDEF USE_TOUCH_INTERFACE}
 
 //positioning of the buttons
-buttonScale:= mobileRecord.getScreenDPI()/cDefaultZoomLevel;
+buttonScale:= 1 / cDefaultZoomLevel;
 
 
 with JumpWidget do