diff --git a/Source/options.cpp b/Source/options.cpp index 42fed56c5..16eb4c884 100644 --- a/Source/options.cpp +++ b/Source/options.cpp @@ -227,15 +227,19 @@ void SaveIni() } #if SDL_VERSION_ATLEAST(2, 0, 0) +bool HardwareCursorSupported() +{ + SDL_version v; + SDL_GetVersion(&v); + return SDL_VERSIONNUM(v.major, v.minor, v.patch) >= SDL_VERSIONNUM(2, 0, 12); +} bool HardwareCursorDefault() { #if defined(__ANDROID__) || defined(TARGET_OS_IPHONE) // See https://github.com/diasurgical/devilutionX/issues/2502 return false; #else - SDL_version v; - SDL_GetVersion(&v); - return SDL_VERSIONNUM(v.major, v.minor, v.patch) >= SDL_VERSIONNUM(2, 0, 12); + return HardwareCursorSupported(); #endif } #endif @@ -780,9 +784,9 @@ GraphicsOptions::GraphicsOptions() , blendedTransparancy("Blended Transparency", OptionEntryFlags::CantChangeInGame, N_("Blended Transparency"), N_("Enables uniform transparency mode. This setting affects the transparency on walls, game text menus, and boxes. If disabled will default to old checkerboard transparency."), true) , colorCycling("Color Cycling", OptionEntryFlags::None, N_("Color Cycling"), N_("Color cycling effect used for water, lava, and acid animation."), true) #if SDL_VERSION_ATLEAST(2, 0, 0) - , hardwareCursor("Hardware Cursor", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::RecreateUI, N_("Hardware Cursor"), N_("Use a hardware cursor"), HardwareCursorDefault()) - , hardwareCursorForItems("Hardware Cursor For Items", OptionEntryFlags::CantChangeInGame, N_("Hardware Cursor For Items"), N_("Use a hardware cursor for items."), false) - , hardwareCursorMaxSize("Hardware Cursor Maximum Size", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::RecreateUI, N_("Hardware Cursor Maximum Size"), N_("Maximum width / height for the hardware cursor. Larger cursors fall back to software."), 128, { 0, 64, 128, 256, 512 }) + , hardwareCursor("Hardware Cursor", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::RecreateUI | (HardwareCursorSupported() ? OptionEntryFlags::None : OptionEntryFlags::Invisible), N_("Hardware Cursor"), N_("Use a hardware cursor"), HardwareCursorDefault()) + , hardwareCursorForItems("Hardware Cursor For Items", OptionEntryFlags::CantChangeInGame | (HardwareCursorSupported() ? OptionEntryFlags::None : OptionEntryFlags::Invisible), N_("Hardware Cursor For Items"), N_("Use a hardware cursor for items."), false) + , hardwareCursorMaxSize("Hardware Cursor Maximum Size", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::RecreateUI | (HardwareCursorSupported() ? OptionEntryFlags::None : OptionEntryFlags::Invisible), N_("Hardware Cursor Maximum Size"), N_("Maximum width / height for the hardware cursor. Larger cursors fall back to software."), 128, { 0, 64, 128, 256, 512 }) #endif , limitFPS("FPS Limiter", OptionEntryFlags::None, N_("FPS Limiter"), N_("FPS is limited to avoid high CPU load. Limit considers refresh rate."), true) , showFPS("Show FPS", OptionEntryFlags::None, N_("Show FPS"), N_("Displays the FPS in the upper left corner of the screen."), true)