From d48ed3749d8a2c528f3a8ca892524f68e1575564 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 12 Jun 2025 14:02:20 -0700 Subject: [PATCH] Different default full screen behavior for Emscripten --- ISLE/isleapp.cpp | 4 ++++ miniwin/src/ddraw/ddraw.cpp | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index a5edd95b..591b1e2e 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -94,7 +94,11 @@ IsleApp::IsleApp() m_cdPath = NULL; m_deviceId = NULL; m_savePath = NULL; +#ifdef __EMSCRIPTEN__ + m_fullScreen = FALSE; +#else m_fullScreen = TRUE; +#endif m_flipSurfaces = FALSE; m_backBuffersInVram = TRUE; m_using8bit = FALSE; diff --git a/miniwin/src/ddraw/ddraw.cpp b/miniwin/src/ddraw/ddraw.cpp index 6842c7ac..fc81ddd3 100644 --- a/miniwin/src/ddraw/ddraw.cpp +++ b/miniwin/src/ddraw/ddraw.cpp @@ -284,11 +284,6 @@ HRESULT DirectDrawImpl::SetCooperativeLevel(HWND hWnd, DDSCLFlags dwFlags) { SDL_Window* sdlWindow = reinterpret_cast(hWnd); -#ifdef __EMSCRIPTEN__ - DDWindow = sdlWindow; - return DD_OK; -#endif - if (sdlWindow) { bool fullscreen; if ((dwFlags & DDSCL_NORMAL) == DDSCL_NORMAL) { @@ -302,7 +297,9 @@ HRESULT DirectDrawImpl::SetCooperativeLevel(HWND hWnd, DDSCLFlags dwFlags) } if (!SDL_SetWindowFullscreen(sdlWindow, fullscreen)) { +#ifndef __EMSCRIPTEN__ return DDERR_GENERIC; +#endif } DDWindow = sdlWindow; DDRenderer = SDL_CreateRenderer(DDWindow, NULL);