Prevent enabling Shaders if Direct3D is used
authorSfan5 <sfan5@live.de>
Sat, 23 Nov 2013 07:55:48 +0000 (08:55 +0100)
committerSfan5 <sfan5@live.de>
Sat, 23 Nov 2013 14:41:47 +0000 (15:41 +0100)
builtin/mainmenu.lua

index 7ef5129c34e9c613c3cb1f19cbab8ae7797daee6..a8adca54f23df2e8a4b879205b498fd1fd633a91 100644 (file)
@@ -645,7 +645,12 @@ function tabbuilder.handle_settings_buttons(fields)
        end
                        
        if fields["cb_shaders"] then
-               engine.setting_set("enable_shaders", fields["cb_shaders"])
+               if (engine.setting_get("video_driver") == "direct3d8" or engine.setting_get("video_driver") == "direct3d9") then
+                       engine.setting_set("enable_shaders", "false")
+                       gamedata.errormessage = fgettext("To enable shaders the OpenGL driver needs to be used.")
+               else
+                       engine.setting_set("enable_shaders", fields["cb_shaders"])
+               end
        end
        if fields["cb_pre_ivis"] then
                engine.setting_set("preload_item_visuals", fields["cb_pre_ivis"])