Skip to content

Commit

Permalink
Hide Upscale option in Settings menu
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCWills committed Oct 19, 2024
1 parent d8fd03d commit 4e77eac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 1 addition & 8 deletions Source/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,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 @@ -954,7 +948,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 @@ -1001,7 +995,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 @@ -109,12 +109,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 @@ -125,8 +123,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

0 comments on commit 4e77eac

Please sign in to comment.