diff --git a/Common/Log.h b/Common/Log.h index 1e463acadce7..c53da51cb2fb 100644 --- a/Common/Log.h +++ b/Common/Log.h @@ -122,6 +122,8 @@ void AndroidAssertLog(const char *func, const char *file, int line, const char * #if MAX_LOGLEVEL >= DEBUG_LEVEL #define _dbg_assert_(_t_, _a_) \ if (!(_a_)) {\ + printf(#_a_ "\n\nError...\n\n Line: %d\n File: %s\n\n", \ + __LINE__, __FILE__); \ ERROR_LOG(_t_, #_a_ "\n\nError...\n\n Line: %d\n File: %s\n\nIgnore and continue?", \ __LINE__, __FILE__); \ if (!PanicYesNo("*** Assertion ***\n")) { Crash(); } \ diff --git a/Core/Core.cpp b/Core/Core.cpp index 3f6679457695..6a89148be251 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -187,7 +187,7 @@ bool UpdateScreenScale(int width, int height) { dp_yres = new_dp_yres; pixel_xres = width; pixel_yres = height; - DEBUG_LOG(SYSTEM, "pixel_res: %dx%d. Calling NativeResized()", pixel_xres, pixel_yres); + ILOG("pixel_res: %dx%d. Calling NativeResized()", pixel_xres, pixel_yres); NativeResized(); return true; } diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 7dff718c3543..27deb1b77bf7 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -340,7 +340,7 @@ class GPUCommon : public GPUInterface, public GPUDebugInterface { bool dumpThisFrame_; bool debugRecording_; bool interruptsEnabled_; - bool resized_; + bool resized_ = false; DrawType lastDraw_ = DRAW_UNKNOWN; GEPrimitiveType lastPrim_ = GE_PRIM_INVALID; diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 43de4d1078b2..8678876de67c 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -292,8 +292,8 @@ void GPU_Vulkan::BeginHostFrame() { if (vulkan_->GetDeviceFeatures().enabled.wideLines) { drawEngine_.SetLineWidth(PSP_CoreParameter().renderWidth / 480.0f); } + resized_ = false; } - resized_ = false; textureCacheVulkan_->StartFrame(); diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 52028d0879ed..a5928d45bac9 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -776,19 +776,18 @@ int main(int argc, char *argv[]) { case SDL_WINDOWEVENT: switch (event.window.event) { case SDL_WINDOWEVENT_SIZE_CHANGED: // better than RESIZED, more general - case SDL_WINDOWEVENT_MAXIMIZED: - case SDL_WINDOWEVENT_RESTORED: { + int new_width = event.window.data1; + int new_height = event.window.data2; + windowHidden = false; Core_NotifyWindowHidden(windowHidden); Uint32 window_flags = SDL_GetWindowFlags(window); bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN); - if (event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { - UpdateScreenScale(event.window.data1, event.window.data2); - } - NativeMessageReceived("gpu_resized", ""); + // This one calls NativeResized if the size changed. + UpdateScreenScale(new_width, new_height); // Set variable here in case fullscreen was toggled by hotkey g_Config.bFullScreen = fullscreen; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index f2cd00a812fe..4420a5a04df2 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1087,13 +1087,11 @@ void NativeRender(GraphicsContext *graphicsContext) { graphicsContext->Resize(); screenManager->resized(); - // TODO: Move this to new GraphicsContext objects for each backend. -#ifndef _WIN32 - if (GetGPUBackend() == GPUBackend::OPENGL) { - PSP_CoreParameter().pixelWidth = pixel_xres; - PSP_CoreParameter().pixelHeight = pixel_yres; - NativeMessageReceived("gpu_resized", ""); - } + // TODO: Move this to the GraphicsContext objects for each backend. +#if !defined(_WIN32) && !defined(ANDROID) + PSP_CoreParameter().pixelWidth = pixel_xres; + PSP_CoreParameter().pixelHeight = pixel_yres; + NativeMessageReceived("gpu_resized", ""); #endif } else { // ILOG("Polling graphics context");