forked from Mirrorlandia_minetest/minetest
Disable shaders GUI on unsupported drivers (#7563)
* Disable shaders GUI on unsupported drivers (#2060) * Disable shaders if unavailable
This commit is contained in:
parent
78a801e42d
commit
c022ddce4b
@ -203,9 +203,22 @@ local function formspec(tabview, name, tabdata)
|
|||||||
"label[4.25,3.45;" .. fgettext("Screen:") .. "]" ..
|
"label[4.25,3.45;" .. fgettext("Screen:") .. "]" ..
|
||||||
"checkbox[4.25,3.6;cb_autosave_screensize;" .. fgettext("Autosave Screen Size") .. ";"
|
"checkbox[4.25,3.6;cb_autosave_screensize;" .. fgettext("Autosave Screen Size") .. ";"
|
||||||
.. dump(core.settings:get_bool("autosave_screensize")) .. "]" ..
|
.. dump(core.settings:get_bool("autosave_screensize")) .. "]" ..
|
||||||
"box[8,0;3.75,4.5;#999999]" ..
|
"box[8,0;3.75,4.5;#999999]"
|
||||||
"checkbox[8.25,0;cb_shaders;" .. fgettext("Shaders") .. ";"
|
|
||||||
.. dump(core.settings:get_bool("enable_shaders")) .. "]"
|
local video_driver = core.settings:get("video_driver")
|
||||||
|
local shaders_supported = video_driver == "opengl"
|
||||||
|
local shaders_enabled = false
|
||||||
|
if shaders_supported then
|
||||||
|
shaders_enabled = core.settings:get_bool("enable_shaders")
|
||||||
|
tab_string = tab_string ..
|
||||||
|
"checkbox[8.25,0;cb_shaders;" .. fgettext("Shaders") .. ";"
|
||||||
|
.. tostring(shaders_enabled) .. "]"
|
||||||
|
else
|
||||||
|
core.settings:set_bool("enable_shaders", false)
|
||||||
|
tab_string = tab_string ..
|
||||||
|
"label[8.38,0.2;" .. core.colorize("#888888",
|
||||||
|
fgettext("Shaders (unavailable)")) .. "]"
|
||||||
|
end
|
||||||
|
|
||||||
if PLATFORM == "Android" then
|
if PLATFORM == "Android" then
|
||||||
tab_string = tab_string ..
|
tab_string = tab_string ..
|
||||||
@ -229,7 +242,7 @@ local function formspec(tabview, name, tabdata)
|
|||||||
((tonumber(core.settings:get("touchscreen_threshold")) / 10) + 1) .. "]"
|
((tonumber(core.settings:get("touchscreen_threshold")) / 10) + 1) .. "]"
|
||||||
end
|
end
|
||||||
|
|
||||||
if core.settings:get_bool("enable_shaders") then
|
if shaders_enabled then
|
||||||
tab_string = tab_string ..
|
tab_string = tab_string ..
|
||||||
"checkbox[8.25,0.5;cb_bumpmapping;" .. fgettext("Bump Mapping") .. ";"
|
"checkbox[8.25,0.5;cb_bumpmapping;" .. fgettext("Bump Mapping") .. ";"
|
||||||
.. dump(core.settings:get_bool("enable_bumpmapping")) .. "]" ..
|
.. dump(core.settings:get_bool("enable_bumpmapping")) .. "]" ..
|
||||||
|
@ -608,6 +608,10 @@ lighting_boost_spread (Light curve mid boost spread) float 0.2 0.0 1.0
|
|||||||
texture_path (Texture path) path
|
texture_path (Texture path) path
|
||||||
|
|
||||||
# The rendering back-end for Irrlicht.
|
# The rendering back-end for Irrlicht.
|
||||||
|
# A restart is required after changing this.
|
||||||
|
# Note: on Android, stick with OGLES1 if unsure! App may fail to start otherwise.
|
||||||
|
# On other platforms, OpenGL is recommended, and it’s the only driver with
|
||||||
|
# shader support currently.
|
||||||
video_driver (Video driver) enum opengl null,software,burningsvideo,direct3d8,direct3d9,opengl,ogles1,ogles2
|
video_driver (Video driver) enum opengl null,software,burningsvideo,direct3d8,direct3d9,opengl,ogles1,ogles2
|
||||||
|
|
||||||
# Radius of cloud area stated in number of 64 node cloud squares.
|
# Radius of cloud area stated in number of 64 node cloud squares.
|
||||||
|
Loading…
Reference in New Issue
Block a user