From eef94cf07e8a4d374364ccabb2601d61d4873e0f Mon Sep 17 00:00:00 2001 From: nadro Date: Wed, 23 Oct 2013 16:30:40 +0000 Subject: [PATCH] - Fixed issues with randomly crash at resume on Android platform. - Fixed issues with Multi Touch events on Android platform. Missing log to rev4591: - Restored OGLES2 support for Android platform. - Improved log system on Android Platform. git-svn-id: http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@4592 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/Android/CIrrDeviceAndroid.cpp | 7 +++++-- source/Irrlicht/CEGLManager.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/Irrlicht/Android/CIrrDeviceAndroid.cpp b/source/Irrlicht/Android/CIrrDeviceAndroid.cpp index 932cf692..5e664f79 100644 --- a/source/Irrlicht/Android/CIrrDeviceAndroid.cpp +++ b/source/Irrlicht/Android/CIrrDeviceAndroid.cpp @@ -252,14 +252,17 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent) s32 EventAction = AMotionEvent_getAction(androidEvent); bool MultiTouchEvent = true; + bool Touched = false; switch (EventAction) { case AMOTION_EVENT_ACTION_DOWN: Event.MultiTouchInput.Event = EMTIE_PRESSED_DOWN; + Touched = true; break; case AMOTION_EVENT_ACTION_MOVE: Event.MultiTouchInput.Event = EMTIE_MOVED; + Touched = true; break; case AMOTION_EVENT_ACTION_UP: Event.MultiTouchInput.Event = EMTIE_LEFT_UP; @@ -282,9 +285,9 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent) Event.MultiTouchInput.PrevX[i] = 0; // TODO Event.MultiTouchInput.PrevY[i] = 0; // TODO Event.MultiTouchInput.X[i] = AMotionEvent_getX(androidEvent, i); - Event.MultiTouchInput.Y[i] = AMotionEvent_getX(androidEvent, i); + Event.MultiTouchInput.Y[i] = AMotionEvent_getY(androidEvent, i); - Event.MultiTouchInput.Touched[i] = true; + Event.MultiTouchInput.Touched[i] = Touched; } Device->postEventFromUser(Event); diff --git a/source/Irrlicht/CEGLManager.cpp b/source/Irrlicht/CEGLManager.cpp index d591e67b..5845139c 100755 --- a/source/Irrlicht/CEGLManager.cpp +++ b/source/Irrlicht/CEGLManager.cpp @@ -111,6 +111,10 @@ bool CEGLManager::createSurface() if (EglSurface != EGL_NO_SURFACE) return true; +#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) + EglWindow = (ANativeWindow*)Data->OGLESAndroid.window; +#endif + EGLint EglOpenGLBIT = 0; switch (Params.DriverType) @@ -229,10 +233,6 @@ bool CEGLManager::createSurface() os::Printer::log("No full color buffer."); #if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) - /* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is - * guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). - * As soon as we picked a EGLConfig, we can safely reconfigure the - * ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */ EGLint Format = 0; eglGetConfigAttrib(EglDisplay, EglConfig, EGL_NATIVE_VISUAL_ID, &Format);