From ab9a2635a27dfb1b77ef715a2a4a5c6ef8aa638b Mon Sep 17 00:00:00 2001 From: "kim..ng" Date: Mon, 27 Jun 2011 09:42:39 +0000 Subject: [PATCH] Android: Bugfix Using PixelFormat.RGBA_8888 instead of PixelFormat.RGB_888 git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7755 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../system/android/AndroidConfigChooser.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/engine/src/android/com/jme3/system/android/AndroidConfigChooser.java b/engine/src/android/com/jme3/system/android/AndroidConfigChooser.java index 8853547d7..e4249a1ad 100644 --- a/engine/src/android/com/jme3/system/android/AndroidConfigChooser.java +++ b/engine/src/android/com/jme3/system/android/AndroidConfigChooser.java @@ -258,17 +258,17 @@ public class AndroidConfigChooser implements EGLConfigChooser int[] value = new int[1]; // Choose 565 color size - egl.eglGetConfigAttrib(display, a, EGL10.EGL_RED_SIZE, value); - int redA = value[0]; + egl.eglGetConfigAttrib(display, a, EGL10.EGL_GREEN_SIZE, value); + int greenA = value[0]; - egl.eglGetConfigAttrib(display, b, EGL10.EGL_RED_SIZE, value); - int redB = value[0]; + egl.eglGetConfigAttrib(display, b, EGL10.EGL_GREEN_SIZE, value); + int greenB = value[0]; - if ((redA == 5) && (redB != 5)) + if ((greenA == 6) && (greenB != 6)) result = a; - else if ((redA != 5) && (redB == 5)) + else if ((greenA != 6) && (greenB == 6)) result = b; - else // red size is equal + else // green size is equal { // Choose lowest depth size egl.eglGetConfigAttrib(display, a, EGL10.EGL_DEPTH_SIZE, value); @@ -321,6 +321,8 @@ public class AndroidConfigChooser implements EGLConfigChooser egl.eglGetConfigAttrib(display, conf, EGL10.EGL_RED_SIZE, value); if (value[0] == 8) { + result = PixelFormat.RGBA_8888; + /* egl.eglGetConfigAttrib(display, conf, EGL10.EGL_ALPHA_SIZE, value); if (value[0] == 8) { @@ -329,8 +331,14 @@ public class AndroidConfigChooser implements EGLConfigChooser else { result = PixelFormat.RGB_888; - } + }*/ } + + if (verbose) + { + logger.info("Using PixelFormat " + result); + } + return result; }