changeset 8204 | 9a6030d96273 |
parent 7850 | fcbb024090a4 |
child 8330 | aaefa587e277 |
child 9377 | 48ab6dea8d2f |
8203:2c98ec41697a | 8204:9a6030d96273 |
---|---|
20 |
20 |
21 unit uTouch; |
21 unit uTouch; |
22 |
22 |
23 interface |
23 interface |
24 |
24 |
25 uses SysUtils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, GLUnit, uTypes, uCaptions, uAmmos, uWorld, uMobile; |
25 uses SysUtils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, GLUnit, uTypes, uCaptions, uAmmos, uWorld; |
26 |
26 |
27 |
27 |
28 procedure initModule; |
28 procedure initModule; |
29 procedure freeModule; |
29 procedure freeModule; |
30 |
30 |
556 y := 0; |
556 y := 0; |
557 convertToFingerCoord(x, y, CrosshairX, CrosshairY); |
557 convertToFingerCoord(x, y, CrosshairX, CrosshairY); |
558 isOnCrosshair:= isOnRect((x-HalfRectSize), (y-HalfRectSize), RectSize, RectSize, finger); |
558 isOnCrosshair:= isOnRect((x-HalfRectSize), (y-HalfRectSize), RectSize, RectSize, finger); |
559 printFinger(finger); |
559 printFinger(finger); |
560 WriteLnToConsole(inttostr(finger.x) + ' ' + inttostr(x)); |
560 WriteLnToConsole(inttostr(finger.x) + ' ' + inttostr(x)); |
561 WriteLnToConsole(inttostr(x) + ' ' + inttostr(y) + ' ' + inttostr(round(uMobile.getScreenDPI * 10))); |
561 WriteLnToConsole(inttostr(x) + ' ' + inttostr(y) + ' ' + inttostr(round(mobileRecord.getScreenDPI() * 10))); |
562 end; |
562 end; |
563 |
563 |
564 function isOnCurrentHog(finger: TTouch_Data): boolean; |
564 function isOnCurrentHog(finger: TTouch_Data): boolean; |
565 var |
565 var |
566 x,y : LongInt; |
566 x,y : LongInt; |
638 |
638 |
639 setLength(fingers, 4); |
639 setLength(fingers, 4); |
640 for index := 0 to High(fingers) do |
640 for index := 0 to High(fingers) do |
641 fingers[index].id := nilFingerId; |
641 fingers[index].id := nilFingerId; |
642 |
642 |
643 rectSize:= round(baseRectSize * uMobile.getScreenDPI); |
643 rectSize:= round(baseRectSize * mobileRecord.getScreenDPI()); |
644 halfRectSize:= rectSize shl 1; |
644 halfRectSize:= rectSize shl 1; |
645 end; |
645 end; |
646 |
646 |
647 procedure freeModule; |
647 procedure freeModule; |
648 begin |
648 begin |