Skip to content

Commit 364aede

Browse files
committed
with the new metadata surface.transluent, correctly set the transluency before starting the thread.
1 parent 78392de commit 364aede

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/src/org/renpy/android/SDLSurfaceView.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -529,22 +529,23 @@ static void ackStop() {
529529
* not normally called or subclassed by clients of GLSurfaceView.
530530
*/
531531
public void surfaceCreated(SurfaceHolder holder) {
532-
Log.i(TAG, "surfaceCreated() is not handled :|");
532+
//Log.i(TAG, "surfaceCreated() is not handled :|");
533533
}
534534

535535
/**
536536
* This method is part of the SurfaceHolder.Callback interface, and is
537537
* not normally called or subclassed by clients of GLSurfaceView.
538538
*/
539539
public void surfaceDestroyed(SurfaceHolder holder) {
540-
Log.i(TAG, "surfaceDestroyed() is not handled :|");
540+
//Log.i(TAG, "surfaceDestroyed() is not handled :|");
541541
}
542542

543543
/**
544544
* This method is part of the SurfaceHolder.Callback interface, and is
545545
* not normally called or subclassed by clients of GLSurfaceView.
546546
*/
547547
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
548+
//Log.i(TAG, "surfaceChanged() :|");
548549
mWidth = w;
549550
mHeight = h;
550551

@@ -563,7 +564,9 @@ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
563564
new Thread(this).start();
564565
} else {
565566
mChanged = true;
566-
nativeExpose();
567+
if (mStarted) {
568+
nativeExpose();
569+
}
567570
}
568571
}
569572

@@ -650,16 +653,16 @@ public void run() {
650653
return;
651654
}
652655

653-
Log.w(TAG, "Done");
654-
waitForStart();
655-
656656
if ( ai.metaData.getInt("surface.transluent") != 0 ) {
657657
Log.i(TAG, "Surface will be transluent");
658658
getHolder().setFormat(PixelFormat.TRANSLUCENT);
659659
} else {
660660
Log.i(TAG, "Surface will NOT be transluent");
661661
}
662662

663+
Log.w(TAG, "Done");
664+
waitForStart();
665+
663666
nativeResize(mWidth, mHeight);
664667
nativeInitJavaCallbacks();
665668
nativeSetEnv("ANDROID_PRIVATE", mFilesDirectory);
@@ -814,15 +817,15 @@ private void waitForStart() {
814817
GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
815818
GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 6);
816819
checkGlError("glDrawArrays");
817-
mEgl.eglSwapBuffers(mEglDisplay, mEglSurface);
820+
swapBuffers();
818821

819822
// Wait to be notified it's okay to start Python.
820823
synchronized (this) {
821824
while (!mStarted) {
822825
// Draw & Flip.
823826
GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
824827
GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 6);
825-
mEgl.eglSwapBuffers(mEglDisplay, mEglSurface);
828+
swapBuffers();
826829

827830
try {
828831
this.wait(250);

0 commit comments

Comments
 (0)