Browse Source

vid_android: workaround small output buffer

pull/2/head
mittorn 4 years ago
parent
commit
f0c9aa1585
  1. 15
      engine/platform/android/vid_android.c

15
engine/platform/android/vid_android.c

@ -642,11 +642,24 @@ qboolean SW_CreateBuffer( int width, int height, uint *stride, uint *bpp, uint * @@ -642,11 +642,24 @@ qboolean SW_CreateBuffer( int width, int height, uint *stride, uint *bpp, uint *
return false;
}
nw.unlockAndPost( vid_android.window );
Con_Printf("SW_CreateBuffer: buffer %d %d %x %d\n", buffer.width, buffer.height, buffer.format, buffer.stride );
Con_Printf( "SW_CreateBuffer: buffer %d %d %x %d %p\n", buffer.width, buffer.height, buffer.format, buffer.stride, buffer.bits );
if( width > buffer.width || height > buffer.height )
{
Con_Printf( "SW_CreateBuffer: buffer too small %d %d\n", width, height );
// resize event missed?
if( jni.width < buffer.width )
jni.width = buffer.width;
if( jni.height < buffer.height )
jni.width = buffer.height;
VID_SetMode();
Android_UpdateSurface( 1 );
return false;
}
if( buffer.format != WINDOW_FORMAT_RGB_565 )
{
Con_Printf( "SW_CreateBuffer: wrong format %d\n", buffer.format );
return false;
}
Con_Printf( "SW_CreateBuffer: ok\n" );
*stride = buffer.stride;

Loading…
Cancel
Save