Skip to content

Commit 4e464b5

Browse files
committed
Added manual max luminance for mac os
1 parent 4d895b2 commit 4e464b5

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

hdr_output/in_game_hdr_settings/in_game_hdr_settings.gd

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ func _ready() -> void:
2121
var hdr_settings: ConfigFile = ConfigFile.new()
2222
if hdr_settings.load(HDR_SETTINGS_FILE) == OK:
2323
window.hdr_output_requested = hdr_settings.get_value(HDR_SETTINGS_SECTION, "hdr_output_requested", window.hdr_output_requested)
24-
if supports_manual_reference_luminance():
24+
if overriding_reference_luminance_supported():
2525
DisplayServer.window_set_hdr_output_reference_luminance(hdr_settings.get_value(HDR_SETTINGS_SECTION, "hdr_output_reference_luminance", DisplayServer.window_get_hdr_output_reference_luminance(window_id)), window_id)
26-
if supports_manual_max_luminance():
26+
if overriding_max_luminance_supported():
2727
DisplayServer.window_set_hdr_output_max_luminance(hdr_settings.get_value(HDR_SETTINGS_SECTION, "hdr_output_max_luminance", DisplayServer.window_get_hdr_output_max_luminance(window_id)), window_id)
2828

2929
_auto_adjust_reference = DisplayServer.window_get_hdr_output_reference_luminance(window_id) < 0
3030
_auto_adjust_max = DisplayServer.window_get_hdr_output_max_luminance(window_id) < 0
3131

32-
%BrightnessDisplay.visible = supports_manual_reference_luminance()
33-
%BrightnessAdjustment.visible = supports_manual_reference_luminance()
34-
%MaxLumDisplay.visible = supports_manual_max_luminance()
35-
%MaxLumAdjustment.visible = supports_manual_max_luminance()
32+
%BrightnessDisplay.visible = overriding_reference_luminance_supported()
33+
%BrightnessAdjustment.visible = overriding_reference_luminance_supported()
34+
%MaxLumDisplay.visible = overriding_max_luminance_supported()
35+
%MaxLumAdjustment.visible = overriding_max_luminance_supported()
3636

3737

3838
func save_settings() -> void:
@@ -53,15 +53,16 @@ func erase_settings() -> void:
5353
hdr_settings.save(HDR_SETTINGS_FILE)
5454

5555

56-
func supports_manual_reference_luminance() -> bool:
56+
func overriding_reference_luminance_supported() -> bool:
5757
if DisplayServer.get_name() == &"Windows":
5858
return true
5959
else:
6060
return false
6161

6262

63-
func supports_manual_max_luminance() -> bool:
64-
if DisplayServer.get_name() == &"Windows":
63+
func overriding_max_luminance_supported() -> bool:
64+
var display_server_name = DisplayServer.get_name()
65+
if display_server_name == &"Windows" || display_server_name == &"macOS":
6566
return true
6667
else:
6768
return false

hdr_output/main.tscn

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ offset_right = 1152.0
372372
offset_bottom = 648.0
373373
color = Color(0.21568628, 0.21568628, 0.21568628, 1)
374374
script = ExtResource("6_272bh")
375-
scenes = [NodePath("output_max_linear_value"), NodePath("EnvironmentScene"), NodePath("ColorSweep"), NodePath("SetupInstructions")]
375+
scenes = [NodePath("output max linear value"), NodePath("EnvironmentScene"), NodePath("ColorSweep"), NodePath("SetupInstructions")]
376376

377377
[node name="Tab" type="ColorRect" parent="DemoScenes" unique_id=261230258]
378378
layout_mode = 0
@@ -389,7 +389,7 @@ offset_right = 234.0
389389
offset_bottom = 59.0
390390
selected = 0
391391
item_count = 4
392-
popup/item_0/text = "output_max_linear_value"
392+
popup/item_0/text = "output max linear value"
393393
popup/item_0/id = 0
394394
popup/item_1/text = "Environment"
395395
popup/item_1/id = 1
@@ -406,15 +406,15 @@ offset_right = 111.0
406406
offset_bottom = 26.0
407407
text = "Demo scene:"
408408

409-
[node name="output_max_linear_value" type="Control" parent="DemoScenes" unique_id=1640634166]
409+
[node name="output max linear value" type="Control" parent="DemoScenes" unique_id=1640634166]
410410
anchors_preset = 0
411411
offset_right = 828.0
412412
offset_bottom = 570.0
413413

414-
[node name="Mountain" type="Node2D" parent="DemoScenes/output_max_linear_value" unique_id=1183547058]
414+
[node name="Mountain" type="Node2D" parent="DemoScenes/output max linear value" unique_id=1183547058]
415415
position = Vector2(29, 27)
416416

417-
[node name="Sun" type="ColorRect" parent="DemoScenes/output_max_linear_value/Mountain" unique_id=347517105]
417+
[node name="Sun" type="ColorRect" parent="DemoScenes/output max linear value/Mountain" unique_id=347517105]
418418
offset_left = 73.0
419419
offset_top = 8.0
420420
offset_right = 239.0
@@ -424,21 +424,21 @@ script = ExtResource("13_ycdy4")
424424
sdr_color = Color(0.99215686, 0.7058824, 0.41568628, 1)
425425
linear_limit = 2.8
426426

427-
[node name="Mountain" type="Sprite2D" parent="DemoScenes/output_max_linear_value/Mountain" unique_id=1827667879]
427+
[node name="Mountain" type="Sprite2D" parent="DemoScenes/output max linear value/Mountain" unique_id=1827667879]
428428
texture_filter = 1
429429
texture_repeat = 1
430430
position = Vector2(160, 120)
431431
texture = ExtResource("7_5vw27")
432432

433-
[node name="Sparkles" type="GPUParticles2D" parent="DemoScenes/output_max_linear_value" unique_id=817018124]
433+
[node name="Sparkles" type="GPUParticles2D" parent="DemoScenes/output max linear value" unique_id=817018124]
434434
texture_filter = 1
435435
position = Vector2(534, 165)
436436
amount = 42
437437
texture = ExtResource("8_kek77")
438438
process_material = SubResource("ParticleProcessMaterial_dg77c")
439439
script = ExtResource("9_4c57u")
440440

441-
[node name="Label" type="Label" parent="DemoScenes/output_max_linear_value" unique_id=558150534]
441+
[node name="Label" type="Label" parent="DemoScenes/output max linear value" unique_id=558150534]
442442
layout_mode = 0
443443
offset_left = 95.0
444444
offset_top = 458.0
@@ -449,7 +449,7 @@ HELP WANTED
449449
Please let @allenwp know if you have a high quality demo for use in this scene."
450450
horizontal_alignment = 1
451451

452-
[node name="Label2" type="Label" parent="DemoScenes/output_max_linear_value" unique_id=2086992899]
452+
[node name="Label2" type="Label" parent="DemoScenes/output max linear value" unique_id=2086992899]
453453
layout_mode = 0
454454
offset_left = 315.0
455455
offset_top = 360.0

0 commit comments

Comments
 (0)