@@ -341,6 +341,9 @@ private void printConfig(EGL10 egl, EGLDisplay display,
341341 // The resource manager we use.
342342 ResourceManager mResourceManager ;
343343
344+ // Access to our meta-data
345+ private ApplicationInfo ai ;
346+
344347 // Our own view
345348 static SDLSurfaceView instance = null ;
346349
@@ -362,7 +365,7 @@ public SDLSurfaceView(PythonActivity act, String argument) {
362365
363366 wakeLock = null ;
364367 try {
365- ApplicationInfo ai = act .getPackageManager ().getApplicationInfo (
368+ ai = act .getPackageManager ().getApplicationInfo (
366369 act .getPackageName (), PackageManager .GET_META_DATA );
367370 if ( (Integer )ai .metaData .get ("wakelock" ) == 1 ) {
368371 wakeLock = pm .newWakeLock (PowerManager .SCREEN_BRIGHT_WAKE_LOCK , "Screen On" );
@@ -596,22 +599,22 @@ public void run() {
596599 if (configToTest == 0 ) {
597600 Log .i (TAG , "Try to use graphics config R8G8B8A8S8" );
598601 ConfigChooser chooser = new ConfigChooser (
599- // rgba
600- 8 , 8 , 8 , 8 ,
601- // depth
602- mActivity . mInfo . metaData .getInt ("surface: depth" , 0 ),
603- // stencil
604- mActivity . mInfo . metaData .getInt ("surface: stencil" , 8 ));
602+ // rgba
603+ 8 , 8 , 8 , 8 ,
604+ // depth
605+ ai . metaData .getInt ("surface. depth" , 0 ),
606+ // stencil
607+ ai . metaData .getInt ("surface. stencil" , 8 ));
605608 mEglConfig = chooser .chooseConfig (mEgl , mEglDisplay );
606609 } else if (configToTest == 1 ) {
607610 Log .i (TAG , "Try to use graphics config R5G6B5S8" );
608611 ConfigChooser chooser = new ConfigChooser (
609- // rgba
610- 5 , 6 , 5 , 0 ,
611- // depth
612- mActivity . mInfo . metaData .getInt ("surface: depth" , 0 ),
613- // stencil
614- mActivity . mInfo . metaData .getInt ("surface: stencil" , 8 ));
612+ // rgba
613+ 5 , 6 , 5 , 0 ,
614+ // depth
615+ ai . metaData .getInt ("surface. depth" , 0 ),
616+ // stencil
617+ ai . metaData .getInt ("surface. stencil" , 8 ));
615618 mEglConfig = chooser .chooseConfig (mEgl , mEglDisplay );
616619 } else {
617620 Log .e (TAG , "Unable to find a correct surface for this device !" );
@@ -650,8 +653,12 @@ public void run() {
650653 Log .w (TAG , "Done" );
651654 waitForStart ();
652655
653- if ( mActivity .mInfo .metaData .getBoolean ("surface:transluent" ) )
654- getHolder ().setFormat (PixelFormat .TRANSLUCENT );
656+ if ( ai .metaData .getInt ("surface.transluent" ) != 0 ) {
657+ Log .i (TAG , "Surface will be transluent" );
658+ getHolder ().setFormat (PixelFormat .TRANSLUCENT );
659+ } else {
660+ Log .i (TAG , "Surface will NOT be transluent" );
661+ }
655662
656663 nativeResize (mWidth , mHeight );
657664 nativeInitJavaCallbacks ();
0 commit comments