# HG changeset patch # User koda # Date 1374872545 -7200 # Node ID 48ab6dea8d2fcf994fdaec36d16265abed812eb5 # Parent 0405f5f4e7e0482879e6021369dd8054ef989491 remove old and unused getScreenDPI code diff -r 0405f5f4e7e0 -r 48ab6dea8d2f hedgewars/uTouch.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; diff -r 0405f5f4e7e0 -r 48ab6dea8d2f hedgewars/uTypes.pas --- 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; diff -r 0405f5f4e7e0 -r 48ab6dea8d2f hedgewars/uUtils.pas --- 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; diff -r 0405f5f4e7e0 -r 48ab6dea8d2f hedgewars/uWorld.pas --- 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