Implement playable Mac client and rendering validation

This commit is contained in:
shen
2026-09-11 14:58:22 +08:00
parent 1ab68bd06e
commit 374d4165d8
233 changed files with 6546 additions and 284 deletions
+6 -4
View File
@@ -8,7 +8,6 @@
extends RefCounted
static var _cache := {}
static var _dds_helper: Object = null
# DDS 运行时解码:走 Metin2World.load_ddsC++ 里的 dxt.cppDXT1/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: