实体
贴图字典 CTxdStore
贴图字典槽加载与引用
CTxdStore.h
贴图字典槽。加载自定义 UI 贴图常用:AddTxdSlot → LoadTxd → AddRef → SetCurrentTxd。
分配槽
AddTxdSlot / FindTxdSlot / RemoveTxdSlot
static int AddTxdSlot(char const* name);
static int FindTxdSlot(char const* name);
static int FindTxdSlot(unsigned int hash);
static void RemoveTxdSlot(int index);从文件加载
LoadTxd / Create
static bool LoadTxd(int index, char const* filename);
static bool LoadTxd(int index, RwStream* stream);
static void Create(int index);引用计数
AddRef / RemoveRef / GetNumRefs
引用到 0 会删。
static TxdDef* AddRef(int index);
static void RemoveRef(int index);
static TxdDef* RemoveRefWithoutDelete(int index);
static unsigned int GetNumRefs(int index);设当前 TXD
SetCurrentTxd / PushCurrentTxd / PopCurrentTxd
SetTexture 前要先设当前。
static void SetCurrentTxd(int index);
static void PushCurrentTxd();
static void PopCurrentTxd();移除 TXD 数据
RemoveTxd
static void RemoveTxd(int index);设备丢失时配合 d3dLost / d3dReset 重载,或用 SpriteLoader / DynamicResource。