mirror of
https://codeberg.org/sunder/sunder.git
synced 2026-03-28 13:19:15 +00:00
31 lines
1.3 KiB
GDScript
31 lines
1.3 KiB
GDScript
# This file is part of sunder.
|
||
#
|
||
# This program is free software: you can redistribute it and/or modify
|
||
# it under the terms of the GNU Affero General Public License as
|
||
# published by the Free Software Foundation, either version 3 of the
|
||
# License, or (at your option) any later version.
|
||
#
|
||
# This program is distributed in the hope that it will be useful,
|
||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
# GNU Affero General Public License for more details.
|
||
#
|
||
# You should have received a copy of the GNU Affero General Public License
|
||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||
extends OptionButton
|
||
|
||
func _ready() -> void:
|
||
select(Settings.get_value("video", "msaa"))
|
||
|
||
func _on_item_selected(index: int) -> void:
|
||
Settings.set_value("video", "msaa", index)
|
||
# Multi-sample anti-aliasing. High quality, but slow. It also does not smooth out the edges of
|
||
# transparent (alpha scissor) textures.
|
||
if index == 0: # Disabled (default)
|
||
get_viewport().msaa_3d = Viewport.MSAA_DISABLED
|
||
elif index == 1: # 2×
|
||
get_viewport().msaa_3d = Viewport.MSAA_2X
|
||
elif index == 2: # 4×
|
||
get_viewport().msaa_3d = Viewport.MSAA_4X
|
||
elif index == 3: # 8×
|
||
get_viewport().msaa_3d = Viewport.MSAA_8X
|