diff --git a/Core/Core.cpp b/Core/Core.cpp index 55783375a8..73696842f6 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -172,7 +172,7 @@ bool UpdateScreenScale(int width, int height) { dp_yres = new_dp_yres; pixel_xres = width; pixel_yres = height; - INFO_LOG(SYSTEM, "pixel_res: %dx%d", pixel_xres, pixel_yres); + INFO_LOG(SYSTEM, "pixel_res: %dx%d. Calling NativeResized()", pixel_xres, pixel_yres); NativeResized(); return true; } diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index b97edf440d..d4fa2c65ee 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -127,6 +127,8 @@ std::unique_ptr uiTexture; ScreenManager *screenManager; std::string config_filename; +bool g_graphicsInited; + #ifdef IOS bool iosCanUseJit; bool targetIsJailbroken; @@ -675,10 +677,13 @@ void NativeInitGraphics(GraphicsContext *graphicsContext) { #endif g_gameInfoCache = new GameInfoCache(); + + g_graphicsInited = true; ILOG("NativeInitGraphics completed"); } void NativeShutdownGraphics() { + g_graphicsInited = false; ILOG("NativeShutdownGraphics"); #ifdef _WIN32 @@ -817,6 +822,7 @@ void NativeRender(GraphicsContext *graphicsContext) { } if (resized) { + ILOG("resized was set to true - resizing"); resized = false; if (uiContext) { @@ -1072,7 +1078,11 @@ void NativeMessageReceived(const char *message, const char *value) { void NativeResized() { // NativeResized can come from any thread so we just set a flag, then process it later. - resized = true; + if (g_graphicsInited) { + resized = true; + } else { + ILOG("NativeResized ignored, not initialized"); + } } void NativeSetRestarting() { diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 15adb0a638..d1260fce3c 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -773,6 +773,8 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv if (new_size) { ILOG("Size change detected (previously %d,%d) - calling NativeResized()", old_w, old_h); NativeResized(); + } else { + ILOG("Size didn't change."); } }