mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 12:55:37 +00:00
Fixed rare null pointer dereference
This commit is contained in:
parent
ef34704875
commit
da89b81c3c
|
@ -583,7 +583,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
|
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
|
||||||
window.getDecorView().setSystemUiVisibility(flags);
|
window.getDecorView().setSystemUiVisibility(flags);
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||||
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||||
|
@ -1512,6 +1512,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
int format, int width, int height) {
|
int format, int width, int height) {
|
||||||
Log.v("SDL", "surfaceChanged()");
|
Log.v("SDL", "surfaceChanged()");
|
||||||
|
|
||||||
|
if (SDLActivity.mSingleton == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
|
int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case PixelFormat.A_8:
|
case PixelFormat.A_8:
|
||||||
|
@ -1559,25 +1563,24 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
|
|
||||||
mWidth = width;
|
mWidth = width;
|
||||||
mHeight = height;
|
mHeight = height;
|
||||||
int nDeviceWidth = width;
|
int nDeviceWidth = width;
|
||||||
int nDeviceHeight = height;
|
int nDeviceHeight = height;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( android.os.Build.VERSION.SDK_INT >= 17 )
|
if ( android.os.Build.VERSION.SDK_INT >= 17 )
|
||||||
{
|
{
|
||||||
android.util.DisplayMetrics realMetrics = new android.util.DisplayMetrics();
|
android.util.DisplayMetrics realMetrics = new android.util.DisplayMetrics();
|
||||||
mDisplay.getRealMetrics( realMetrics );
|
mDisplay.getRealMetrics( realMetrics );
|
||||||
nDeviceWidth = realMetrics.widthPixels;
|
nDeviceWidth = realMetrics.widthPixels;
|
||||||
nDeviceHeight = realMetrics.heightPixels;
|
nDeviceHeight = realMetrics.heightPixels;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( java.lang.Throwable throwable ) {}
|
catch ( java.lang.Throwable throwable ) {}
|
||||||
|
|
||||||
Log.v("SDL", "Window size: " + width + "x" + height);
|
Log.v("SDL", "Window size: " + width + "x" + height);
|
||||||
Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
|
Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
|
||||||
SDLActivity.onNativeResize(width, height, nDeviceWidth, nDeviceHeight, sdlFormat, mDisplay.getRefreshRate());
|
SDLActivity.onNativeResize(width, height, nDeviceWidth, nDeviceHeight, sdlFormat, mDisplay.getRefreshRate());
|
||||||
|
|
||||||
|
|
||||||
boolean skip = false;
|
boolean skip = false;
|
||||||
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
|
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue