perf: harden runtime for weaker hardware
This commit is contained in:
@@ -6,6 +6,7 @@ const SIZE_DIAL := 60.0
|
||||
const RING_RADIUS := 24.0
|
||||
const RING_THICKNESS := 4.0
|
||||
const GLOW_RADIUS := 2.5
|
||||
const REFRESH_INTERVAL_SECONDS := 0.1
|
||||
|
||||
const COLOR_NIGHT := Color(0.12, 0.16, 0.42, 1)
|
||||
const COLOR_DAWN := Color(0.95, 0.5, 0.2, 1)
|
||||
@@ -14,9 +15,14 @@ const COLOR_DUSK := Color(0.9, 0.35, 0.2, 1)
|
||||
const COLOR_BG := Color(0.06, 0.06, 0.08, 0.65)
|
||||
|
||||
var _last_fraction := -1.0
|
||||
var _refresh_elapsed := 0.0
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
func _process(delta: float) -> void:
|
||||
_refresh_elapsed += delta
|
||||
if _refresh_elapsed < REFRESH_INTERVAL_SECONDS:
|
||||
return
|
||||
_refresh_elapsed = fmod(_refresh_elapsed, REFRESH_INTERVAL_SECONDS)
|
||||
var fraction := _cycle_fraction()
|
||||
if not is_equal_approx(fraction, _last_fraction):
|
||||
_last_fraction = fraction
|
||||
|
||||
Reference in New Issue
Block a user