forked from Mirrorlandia_minetest/irrlicht
Android: import touchedCount patch
This commit is contained in:
parent
10a188e967
commit
dfe077134d
@ -425,6 +425,9 @@ struct SEvent
|
|||||||
// Y position of simple touch.
|
// Y position of simple touch.
|
||||||
s32 Y;
|
s32 Y;
|
||||||
|
|
||||||
|
// number of current touches
|
||||||
|
s32 touchedCount;
|
||||||
|
|
||||||
//! Type of touch event.
|
//! Type of touch event.
|
||||||
ETOUCH_INPUT_EVENT Event;
|
ETOUCH_INPUT_EVENT Event;
|
||||||
};
|
};
|
||||||
|
@ -393,6 +393,7 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
|
|||||||
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, i);
|
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, i);
|
||||||
event.TouchInput.X = AMotionEvent_getX(androidEvent, i);
|
event.TouchInput.X = AMotionEvent_getX(androidEvent, i);
|
||||||
event.TouchInput.Y = AMotionEvent_getY(androidEvent, i);
|
event.TouchInput.Y = AMotionEvent_getY(androidEvent, i);
|
||||||
|
event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
|
||||||
|
|
||||||
device->postEventFromUser(event);
|
device->postEventFromUser(event);
|
||||||
}
|
}
|
||||||
@ -404,6 +405,7 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
|
|||||||
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, pointerIndex);
|
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, pointerIndex);
|
||||||
event.TouchInput.X = AMotionEvent_getX(androidEvent, pointerIndex);
|
event.TouchInput.X = AMotionEvent_getX(androidEvent, pointerIndex);
|
||||||
event.TouchInput.Y = AMotionEvent_getY(androidEvent, pointerIndex);
|
event.TouchInput.Y = AMotionEvent_getY(androidEvent, pointerIndex);
|
||||||
|
event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
|
||||||
|
|
||||||
device->postEventFromUser(event);
|
device->postEventFromUser(event);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user