mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Partly clean up SDL resize code, should help #11974
This commit is contained in:
parent
af7995c554
commit
f9cef5b6b2
@ -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(); } \
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ protected:
|
||||
bool dumpThisFrame_;
|
||||
bool debugRecording_;
|
||||
bool interruptsEnabled_;
|
||||
bool resized_;
|
||||
bool resized_ = false;
|
||||
DrawType lastDraw_ = DRAW_UNKNOWN;
|
||||
GEPrimitiveType lastPrim_ = GE_PRIM_INVALID;
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user