@@ -341,6 +341,9 @@ private void printConfig(EGL10 egl, EGLDisplay display,
341
341
// The resource manager we use.
342
342
ResourceManager mResourceManager ;
343
343
344
+ // Access to our meta-data
345
+ private ApplicationInfo ai ;
346
+
344
347
// Our own view
345
348
static SDLSurfaceView instance = null ;
346
349
@@ -362,7 +365,7 @@ public SDLSurfaceView(PythonActivity act, String argument) {
362
365
363
366
wakeLock = null ;
364
367
try {
365
- ApplicationInfo ai = act .getPackageManager ().getApplicationInfo (
368
+ ai = act .getPackageManager ().getApplicationInfo (
366
369
act .getPackageName (), PackageManager .GET_META_DATA );
367
370
if ( (Integer )ai .metaData .get ("wakelock" ) == 1 ) {
368
371
wakeLock = pm .newWakeLock (PowerManager .SCREEN_BRIGHT_WAKE_LOCK , "Screen On" );
@@ -596,22 +599,22 @@ public void run() {
596
599
if (configToTest == 0 ) {
597
600
Log .i (TAG , "Try to use graphics config R8G8B8A8S8" );
598
601
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 ));
605
608
mEglConfig = chooser .chooseConfig (mEgl , mEglDisplay );
606
609
} else if (configToTest == 1 ) {
607
610
Log .i (TAG , "Try to use graphics config R5G6B5S8" );
608
611
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 ));
615
618
mEglConfig = chooser .chooseConfig (mEgl , mEglDisplay );
616
619
} else {
617
620
Log .e (TAG , "Unable to find a correct surface for this device !" );
@@ -650,8 +653,12 @@ public void run() {
650
653
Log .w (TAG , "Done" );
651
654
waitForStart ();
652
655
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
+ }
655
662
656
663
nativeResize (mWidth , mHeight );
657
664
nativeInitJavaCallbacks ();
0 commit comments