@@ -60,6 +60,19 @@ local function getLeavesStyleSettingIndex()
60
60
return 1
61
61
end
62
62
63
+ local dd_antialiasing_labels = {
64
+ fgettext (" None" ),
65
+ fgettext (" 2x" ),
66
+ fgettext (" 4x" ),
67
+ fgettext (" 8x" ),
68
+ }
69
+
70
+ local antialiasing = {
71
+ {dd_antialiasing_labels [1 ].. " ," .. dd_antialiasing_labels [2 ].. " ," ..
72
+ dd_antialiasing_labels [3 ].. " ," .. dd_antialiasing_labels [4 ]},
73
+ {" 0" , " 2" , " 4" , " 8" }
74
+ }
75
+
63
76
local function getFilterSettingIndex ()
64
77
if (core .setting_get (filters [2 ][3 ]) == " true" ) then
65
78
return 3
@@ -80,6 +93,26 @@ local function getMipmapSettingIndex()
80
93
return 1
81
94
end
82
95
96
+ local function getAntialiasingSettingIndex ()
97
+ local antialiasing_setting = core .setting_get (" fsaa" )
98
+ for i = 1 , # (antialiasing [2 ]) do
99
+ if antialiasing_setting == antialiasing [2 ][i ] then
100
+ return i
101
+ end
102
+ end
103
+ return 1
104
+ end
105
+
106
+ local function antialiasing_fname_to_name (fname )
107
+ for i = 1 , # (dd_antialiasing_labels ) do
108
+ if fname == dd_antialiasing_labels [i ] then
109
+ return antialiasing [2 ][i ]
110
+ end
111
+ end
112
+
113
+ return " 0"
114
+ end
115
+
83
116
local function video_driver_fname_to_name (selected_driver )
84
117
local video_drivers = core .get_video_drivers ()
85
118
@@ -214,13 +247,17 @@ local function formspec(tabview, name, tabdata)
214
247
" dropdown[0.25,3.2;3.3;dd_leaves_style;" .. leaves_style [1 ][1 ] .. " ;"
215
248
.. getLeavesStyleSettingIndex () .. " ]" ..
216
249
" box[3.75,0;3.75,3.45;#999999]" ..
250
+ " box[3.75,0;3.75,4.7;#999999]" ..
217
251
" label[3.85,0.1;" .. fgettext (" Texturing:" ) .. " ]" ..
218
252
" dropdown[3.85,0.55;3.85;dd_filters;" .. filters [1 ][1 ] .. " ;"
219
253
.. getFilterSettingIndex () .. " ]" ..
220
254
" dropdown[3.85,1.35;3.85;dd_mipmap;" .. mipmap [1 ][1 ] .. " ;"
221
255
.. getMipmapSettingIndex () .. " ]" ..
222
- " label[3.85,2.15;" .. fgettext (" Rendering:" ) .. " ]" ..
223
- " dropdown[3.85,2.6;3.85;dd_video_driver;"
256
+ " label[3.85,2.15;" .. fgettext (" Antialiasing:" ) .. " ]" ..
257
+ " dropdown[3.85,2.6;3.85;dd_antialiasing;" .. antialiasing [1 ][1 ] .. " ;"
258
+ .. getAntialiasingSettingIndex () .. " ]" ..
259
+ " label[3.85,3.4;" .. fgettext (" Rendering:" ) .. " ]" ..
260
+ " dropdown[3.85,3.85;3.85;dd_video_driver;"
224
261
.. driver_formspec_string .. " ;" .. driver_current_idx .. " ]" ..
225
262
" tooltip[dd_video_driver;" ..
226
263
fgettext (" Restart minetest for driver change to take effect" ) .. " ]" ..
@@ -421,6 +458,8 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
421
458
core .setting_set (" anisotropic_filter" , " true" )
422
459
ddhandled = true
423
460
end
461
+ core .setting_set (" fsaa" ,
462
+ antialiasing_fname_to_name (fields [" dd_antialiasing" ]))
424
463
425
464
return ddhandled
426
465
end
0 commit comments