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
3.0
kim..ng 14 years ago
parent 09b475d893
commit ab9a2635a2
  1. 22
      engine/src/android/com/jme3/system/android/AndroidConfigChooser.java

@ -258,17 +258,17 @@ public class AndroidConfigChooser implements EGLConfigChooser
int[] value = new int[1]; int[] value = new int[1];
// Choose 565 color size // Choose 565 color size
egl.eglGetConfigAttrib(display, a, EGL10.EGL_RED_SIZE, value); egl.eglGetConfigAttrib(display, a, EGL10.EGL_GREEN_SIZE, value);
int redA = value[0]; int greenA = value[0];
egl.eglGetConfigAttrib(display, b, EGL10.EGL_RED_SIZE, value); egl.eglGetConfigAttrib(display, b, EGL10.EGL_GREEN_SIZE, value);
int redB = value[0]; int greenB = value[0];
if ((redA == 5) && (redB != 5)) if ((greenA == 6) && (greenB != 6))
result = a; result = a;
else if ((redA != 5) && (redB == 5)) else if ((greenA != 6) && (greenB == 6))
result = b; result = b;
else // red size is equal else // green size is equal
{ {
// Choose lowest depth size // Choose lowest depth size
egl.eglGetConfigAttrib(display, a, EGL10.EGL_DEPTH_SIZE, value); 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); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_RED_SIZE, value);
if (value[0] == 8) if (value[0] == 8)
{ {
result = PixelFormat.RGBA_8888;
/*
egl.eglGetConfigAttrib(display, conf, EGL10.EGL_ALPHA_SIZE, value); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_ALPHA_SIZE, value);
if (value[0] == 8) if (value[0] == 8)
{ {
@ -329,8 +331,14 @@ public class AndroidConfigChooser implements EGLConfigChooser
else else
{ {
result = PixelFormat.RGB_888; result = PixelFormat.RGB_888;
}*/
} }
if (verbose)
{
logger.info("Using PixelFormat " + result);
} }
return result; return result;
} }

Loading…
Cancel
Save