fix: remove broken coroutine pattern that caused parse error
GDScript coroutines cannot be stored without await like JS Promises. Removed _pending_gif_requests and _do_fetch_gif_as_texture — the race condition is not a practical issue since Godot is single-threaded and the cache check prevents duplicate work after the first request completes. Bump to v0.1.15
This commit is contained in:
parent
75a6244fd4
commit
cff3d994a3
1 changed files with 0 additions and 16 deletions
|
|
@ -29,7 +29,6 @@ var _meta_cache_dir := "itch_art"
|
||||||
var _enriched_meta: Dictionary = {}
|
var _enriched_meta: Dictionary = {}
|
||||||
var settings_manager := load("res://core/global/settings_manager.tres") as SettingsManager
|
var settings_manager := load("res://core/global/settings_manager.tres") as SettingsManager
|
||||||
var _animated_texture_cache: Dictionary = {}
|
var _animated_texture_cache: Dictionary = {}
|
||||||
var _pending_gif_requests: Dictionary = {}
|
|
||||||
var _last_animated_setting: bool = false
|
var _last_animated_setting: bool = false
|
||||||
var _focused_animated_texture: AnimatedTexture = null
|
var _focused_animated_texture: AnimatedTexture = null
|
||||||
|
|
||||||
|
|
@ -387,21 +386,6 @@ func _fetch_gif_as_texture(url: String, cache_flags: int) -> Texture2D:
|
||||||
if _animated_texture_cache.has(url):
|
if _animated_texture_cache.has(url):
|
||||||
return _animated_texture_cache[url]
|
return _animated_texture_cache[url]
|
||||||
|
|
||||||
# If another request for the same URL is in progress, wait for it.
|
|
||||||
if _pending_gif_requests.has(url):
|
|
||||||
return await _pending_gif_requests[url]
|
|
||||||
|
|
||||||
# Track this request to prevent duplicates.
|
|
||||||
_pending_gif_requests[url] = _do_fetch_gif_as_texture(url, cache_flags)
|
|
||||||
var result: Texture2D = await _pending_gif_requests[url]
|
|
||||||
_pending_gif_requests.erase(url)
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
## Internal implementation of GIF fetching. Wrapped by _fetch_gif_as_texture
|
|
||||||
## to prevent concurrent downloads for the same URL.
|
|
||||||
func _do_fetch_gif_as_texture(url: String, cache_flags: int) -> Texture2D:
|
|
||||||
|
|
||||||
var animated: bool = _is_animated_gifs_enabled()
|
var animated: bool = _is_animated_gifs_enabled()
|
||||||
var ffmpeg_bin := await _ensure_ffmpeg()
|
var ffmpeg_bin := await _ensure_ffmpeg()
|
||||||
if ffmpeg_bin.is_empty():
|
if ffmpeg_bin.is_empty():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue