Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Upscale option in Settings menu #7443

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions Source/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ namespace devilution {

namespace {

#if defined(__ANDROID__) || defined(__APPLE__)
constexpr OptionEntryFlags OnlyIfNoImplicitRenderer = OptionEntryFlags::Invisible;
#else
constexpr OptionEntryFlags OnlyIfNoImplicitRenderer = OptionEntryFlags::None;
#endif

#if defined(__ANDROID__) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1)
constexpr OptionEntryFlags OnlyIfSupportsWindowed = OptionEntryFlags::Invisible;
#else
Expand Down Expand Up @@ -953,7 +947,7 @@ GraphicsOptions::GraphicsOptions()
, fitToScreen("Fit to Screen", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::RecreateUI, N_("Fit to Screen"), N_("Automatically adjust the game window to your current desktop screen aspect ratio and resolution."), true)
#endif
#ifndef USE_SDL1
, upscale("Upscale", OnlyIfNoImplicitRenderer | OptionEntryFlags::CantChangeInGame | OptionEntryFlags::RecreateUI, N_("Upscale"), N_("Enables image scaling from the game resolution to your monitor resolution. Prevents changing the monitor resolution and allows window resizing."),
, upscale("Upscale", OptionEntryFlags::Invisible | OptionEntryFlags::CantChangeInGame | OptionEntryFlags::RecreateUI, N_("Upscale"), N_("Enables image scaling from the game resolution to your monitor resolution. Prevents changing the monitor resolution and allows window resizing."),
#ifdef NXDK
false
#else
Expand Down Expand Up @@ -1000,7 +994,6 @@ GraphicsOptions::GraphicsOptions()
fitToScreen.SetValueChangedCallback(ResizeWindowAndUpdateResolutionOptions);
#endif
#ifndef USE_SDL1
upscale.SetValueChangedCallback(ResizeWindowAndUpdateResolutionOptions);
scaleQuality.SetValueChangedCallback(ReinitializeTexture);
integerScaling.SetValueChangedCallback(ReinitializeIntegerScale);
vSync.SetValueChangedCallback(ReinitializeRenderer);
Expand Down
5 changes: 1 addition & 4 deletions Source/utils/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ void FreeRenderer()
{
#if defined(_WIN32) && !defined(NXDK)
bool wasD3D9 = false;
bool wasD3D11 = false;
if (renderer != nullptr) {
SDL_RendererInfo previousRendererInfo;
SDL_GetRendererInfo(renderer, &previousRendererInfo);
wasD3D9 = (std::string_view(previousRendererInfo.name) == "direct3d");
wasD3D11 = (std::string_view(previousRendererInfo.name) == "direct3d11");
}
#endif

Expand All @@ -126,8 +124,7 @@ void FreeRenderer()

#if defined(_WIN32) && !defined(NXDK)
// On Windows 11 the directx9 VSYNC timer doesn't get recreated properly, see https://github.com/libsdl-org/SDL/issues/5099
// Furthermore, the direct3d11 driver "poisons" the window so it can't be used by another renderer
if ((wasD3D9 && *sgOptions.Graphics.upscale && *sgOptions.Graphics.vSync) || (wasD3D11 && !*sgOptions.Graphics.upscale)) {
if (wasD3D9 && *sgOptions.Graphics.upscale && *sgOptions.Graphics.vSync) {
std::string title = SDL_GetWindowTitle(ghMainWnd);
Uint32 flags = SDL_GetWindowFlags(ghMainWnd);
Rectangle dimensions;
Expand Down
Loading