mirror of https://github.com/axmolengine/axmol.git
commit
c64ee1b4b8
|
@ -33,11 +33,13 @@ using namespace cocos2d;
|
|||
|
||||
extern "C" {
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesBegin(JNIEnv * env, jobject thiz, jint id, jfloat x, jfloat y) {
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &id, &x, &y);
|
||||
intptr_t idlong = id;
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &idlong, &x, &y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesEnd(JNIEnv * env, jobject thiz, jint id, jfloat x, jfloat y) {
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &id, &x, &y);
|
||||
intptr_t idlong = id;
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &idlong, &x, &y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesMove(JNIEnv * env, jobject thiz, jintArray ids, jfloatArray xs, jfloatArray ys) {
|
||||
|
@ -50,7 +52,11 @@ extern "C" {
|
|||
env->GetFloatArrayRegion(xs, 0, size, x);
|
||||
env->GetFloatArrayRegion(ys, 0, size, y);
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(size, id, x, y);
|
||||
intptr_t idlong[size];
|
||||
for(int i = 0; i < size; i++)
|
||||
idlong[i] = id[i];
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(size, idlong, x, y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesCancel(JNIEnv * env, jobject thiz, jintArray ids, jfloatArray xs, jfloatArray ys) {
|
||||
|
@ -63,7 +69,11 @@ extern "C" {
|
|||
env->GetFloatArrayRegion(xs, 0, size, x);
|
||||
env->GetFloatArrayRegion(ys, 0, size, y);
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesCancel(size, id, x, y);
|
||||
intptr_t idlong[size];
|
||||
for(int i = 0; i < size; i++)
|
||||
idlong[i] = id[i];
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesCancel(size, idlong, x, y);
|
||||
}
|
||||
|
||||
#define KEYCODE_BACK 0x04
|
||||
|
|
Loading…
Reference in New Issue