| 872 | |
| 873 | |
| 874 | bool createMouseDownEvent( S32 touchNumber, S32 x, S32 y, U32 numTouches ) |
| 875 | { |
| 876 | S32 vacantSlot = -1; |
| 877 | |
| 878 | if (Canvas == NULL) |
| 879 | return false; |
| 880 | |
| 881 | for( int i = 0 ; (i < MAX_TOUCH_EVENTS) && (vacantSlot == -1) ; i++ ) |
| 882 | { |
| 883 | if( lastTouches[i].lastX == -1 ) |
| 884 | { |
| 885 | vacantSlot = i; |
| 886 | } |
| 887 | } |
| 888 | |
| 889 | if( vacantSlot == -1 ) |
| 890 | return false; |
| 891 | |
| 892 | ScreenTouchEvent event; |
| 893 | event.xPos = x; |
| 894 | event.yPos = y; |
| 895 | event.touchID = vacantSlot; |
| 896 | event.action = SI_MAKE; |
| 897 | event.numTouches = numTouches; |
| 898 | |
| 899 | //Luma: Update position |
| 900 | Canvas->setCursorPos( Point2I( x, y ) ); |
| 901 | |
| 902 | if( vacantSlot != -1 ) |
| 903 | { |
| 904 | lastTouches[vacantSlot].lastX = x; |
| 905 | lastTouches[vacantSlot].lastY = y; |
| 906 | } |
| 907 | |
| 908 | TouchDownEvents.push_back( touchEvent( vacantSlot, x, y ) ); |
| 909 | Game->postEvent(event); |
| 910 | |
| 911 | return true;//return false if we get bad values or something |
| 912 | } |
| 913 | |
| 914 | bool createMouseUpEvent( S32 touchNumber, S32 x, S32 y, S32 lastX, S32 lastY, U32 numTouches ) //EFM |
| 915 | { |
no test coverage detected