fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
34
docs/api/resources/iloader/loadasync.md
Normal file
34
docs/api/resources/iloader/loadasync.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# IResourceLoader::LoadAsync
|
||||
|
||||
```cpp
|
||||
void LoadAsync(const Containers::String& path, const ImportSettings* settings,
|
||||
std::function<void(LoadResult)> callback)
|
||||
```
|
||||
|
||||
异步加载资源。默认实现直接调用同步 `Load` 方法并在当前线程执行回调。子类可重写以实现真正的多线程异步加载。
|
||||
|
||||
**参数:**
|
||||
- `path` - 资源路径
|
||||
- `settings` - 导入设置(可为 nullptr)
|
||||
- `callback` - 加载完成回调函数
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
void AsyncTextureLoader::LoadAsync(const Containers::String& path,
|
||||
const ImportSettings* settings,
|
||||
std::function<void(LoadResult)> callback) {
|
||||
std::thread([this, path, settings, callback]() {
|
||||
LoadResult result = Load(path, settings);
|
||||
callback(result); // 回调可在工作线程执行
|
||||
}).detach();
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [IResourceLoader 总览](iloader.md) - 返回类总览
|
||||
Reference in New Issue
Block a user