From 086eb877b57033a415bfb59679402a94aa295851 Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Thu, 19 Mar 2026 00:52:46 +0800 Subject: [PATCH] docs: fix resources module documentation discrepancies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add missing MakeResourceGUID helper function to resourcetypes.md - Add note about GetResourceType() template specializations - Merge duplicate '缓存控制' section into '内存管理' in resourcecache.md - Verify all methods documented match source code implementations Fixed documentation to match: - ResourceTypes.h: MakeResourceGUID function now documented - ResourceCache.h: OnZeroRefCount and Clear methods now properly listed - AsyncLoader.md: Removed duplicate progress query section --- docs/api/resources/resourcecache/resourcecache.md | 5 ----- docs/api/resources/resourcetypes/resourcetypes.md | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/api/resources/resourcecache/resourcecache.md b/docs/api/resources/resourcecache/resourcecache.md index fcbee1d5..50a9fb27 100644 --- a/docs/api/resources/resourcecache/resourcecache.md +++ b/docs/api/resources/resourcecache/resourcecache.md @@ -58,11 +58,6 @@ | `size_t GetMemoryBudget() const` | 获取内存预算 | | `void OnMemoryPressure(size_t requiredBytes)` | 内存压力回调,驱逐资源以释放空间 | | `void OnZeroRefCount(ResourceGUID guid)` | 当引用计数为零时的回调 | - -### 缓存控制 - -| 方法 | 描述 | -|------|------| | `void Flush()` | 清空缓存,释放所有资源 | | `void Clear()` | 清空缓存但不释放资源 | diff --git a/docs/api/resources/resourcetypes/resourcetypes.md b/docs/api/resources/resourcetypes/resourcetypes.md index b8a4ae7c..5cf14a02 100644 --- a/docs/api/resources/resourcetypes/resourcetypes.md +++ b/docs/api/resources/resourcetypes/resourcetypes.md @@ -80,6 +80,7 @@ struct ResourceGUID { | 函数 | 描述 | |------|------| | `constexpr const char* GetResourceTypeName(ResourceType type)` | 获取资源类型的字符串名称 | +| `ResourceGUID MakeResourceGUID(const char* path)` | 从路径生成 GUID 的辅助函数 | ### 模板特化 @@ -92,6 +93,8 @@ template<> inline ResourceType GetResourceType() { return Resou template<> inline ResourceType GetResourceType() { return ResourceType::Binary; } ``` +**注意**: `GetResourceType()` 是模板特化函数,用于在编译时获取资源类型。 + ## 使用示例 ```cpp