Implement playable Mac client and rendering validation
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
extends RefCounted
|
||||
|
||||
static var _cache := {}
|
||||
static var _dds_helper: Object = null
|
||||
|
||||
# DDS 运行时解码:走 Metin2World.load_dds(C++ 里的 dxt.cpp,DXT1/3/5 + BGRA8)。
|
||||
# Godot 无原生运行时 DDS 解码,UI 里的 select.dds / 职业名图都得走这条路。
|
||||
@@ -17,9 +16,12 @@ static func load_dds_image(path: String) -> Image:
|
||||
return null
|
||||
if not ClassDB.class_exists("Metin2World"):
|
||||
return null
|
||||
if _dds_helper == null or not is_instance_valid(_dds_helper):
|
||||
_dds_helper = ClassDB.instantiate("Metin2World")
|
||||
var img = _dds_helper.call("load_dds", path)
|
||||
# Metin2World is a Node, not RefCounted; a static reference never frees it.
|
||||
# The decoder returns an independently owned Image, so release the helper
|
||||
# after each decode (textures themselves remain cached by load_tex).
|
||||
var helper: Object = ClassDB.instantiate("Metin2World")
|
||||
var img = helper.call("load_dds", path)
|
||||
helper.free()
|
||||
return img if img is Image else null
|
||||
|
||||
static func load_tex(assets_root: String, vpath: String) -> Texture2D:
|
||||
|
||||
Reference in New Issue
Block a user