Skip to content

Commit e302246

Browse files
committed
Remove frame limit on web due to engine bug
1 parent be6012c commit e302246

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

ui/UICore.gd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ var _user_profile := UserProfiles.get_profile()
2424

2525

2626
func _init() -> void:
27-
OS.low_processor_usage_mode = true
28-
# TODO: Update whenever https://github.com/godotengine/godot/issues/117875 is fixed
27+
# TODO: Remove feature guard whenever https://github.com/godotengine/godot/issues/117875 is fixed
2928
# also consider using Engine.max_fps instead when it's fixed
30-
OS.low_processor_usage_mode_sleep_usec = 1
31-
_update_framerate(_user_profile.framerate_limit)
32-
_user_profile.framerate_limit_changed.connect(_update_framerate)
29+
if not OS.has_feature("Web"):
30+
OS.low_processor_usage_mode = true
31+
OS.low_processor_usage_mode_sleep_usec = 20000
32+
_update_framerate(_user_profile.framerate_limit)
33+
_user_profile.framerate_limit_changed.connect(_update_framerate)
3334

3435

3536
func _ready() -> void:
@@ -161,6 +162,5 @@ func _update_welcome_button() -> void:
161162
func _update_framerate(new_framerate: int) -> void:
162163
if new_framerate == 0:
163164
new_framerate = 1000
164-
# TODO: Update whenever https://github.com/godotengine/godot/issues/117875 is fixed
165-
# also consider using Engine.max_fps instead when it's fixed
166-
#OS.low_processor_usage_mode_sleep_usec = 1_000_000 / new_framerate
165+
# TODO: Consider using Engine.max_fps instead
166+
OS.low_processor_usage_mode_sleep_usec = 1_000_000 / new_framerate

ui/components/GameView.tscn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
[sub_resource type="StyleBoxEmpty" id="1"]
88

99
[node name="GameView" type="PanelContainer" unique_id=911031022 node_paths=PackedStringArray("_viewport_container", "_pause_rect")]
10-
visible = false
1110
offset_left = 12.0
1211
offset_top = 12.0
1312
offset_right = 585.0
@@ -20,11 +19,12 @@ _pause_rect = NodePath("PauseRect")
2019

2120
[node name="SubViewportContainer" type="SubViewportContainer" parent="." unique_id=324934379]
2221
process_mode = 1
23-
custom_minimum_size = Vector2(100, 0)
22+
custom_minimum_size = Vector2(100, 100)
2423
layout_mode = 2
2524
stretch = true
2625

2726
[node name="PauseRect" type="ColorRect" parent="." unique_id=11987188]
27+
visible = false
2828
layout_mode = 2
2929
color = Color(0.0352941, 0.0392157, 0.129412, 0.309804)
3030

0 commit comments

Comments
 (0)