Implement 40250 classic client port
This commit is contained in:
@@ -68,6 +68,10 @@ static func _load_uncached(assets_root: String, vpath: String) -> Texture2D:
|
||||
return _load_image_file(real)
|
||||
|
||||
static func _load_image_file(path: String) -> Texture2D:
|
||||
# .sub 文件可能引用了未随当前资源包发布的共享贴图(例如 Public.tga)。
|
||||
# 先做存在性检查,避免 headless/UI fallback 因缺失可选贴图刷错误日志。
|
||||
if not FileAccess.file_exists(path):
|
||||
return null
|
||||
var ext := path.get_extension().to_lower()
|
||||
if ext == "dds":
|
||||
var di := load_dds_image(path)
|
||||
@@ -99,6 +103,8 @@ static func _load_sub(path: String) -> Texture2D:
|
||||
var img_path := path.get_base_dir().path_join(image_name)
|
||||
if not FileAccess.file_exists(img_path):
|
||||
img_path = path.get_base_dir().path_join(image_name.get_basename() + ".tga")
|
||||
if not FileAccess.file_exists(img_path):
|
||||
return null
|
||||
var base := _load_image_file(img_path)
|
||||
if base == null:
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user