[keel] Cleanup
This commit is contained in:
parent
95a69b72b5
commit
7d8a8e0e52
@ -247,10 +247,7 @@ class AssetManager {
|
||||
};
|
||||
|
||||
ox::HashMap<ox::String, ox::UPtr<AssetTypeManagerBase>> m_assetTypeManagers;
|
||||
struct FileTracker {
|
||||
ox::Signal<ox::Error(ox::StringView assetId)> updated;
|
||||
};
|
||||
ox::HashMap<ox::String, FileTracker> m_fileTrackers;
|
||||
ox::HashMap<ox::String, ox::Signal<ox::Error(ox::StringView assetId)>> m_fileUpdated;
|
||||
|
||||
template<typename T>
|
||||
ox::Result<AssetTypeManager<T>*> getTypeManager() noexcept {
|
||||
@ -282,7 +279,7 @@ class AssetManager {
|
||||
}
|
||||
|
||||
ox::Error reloadAsset(ox::StringView assetId) noexcept {
|
||||
m_fileTrackers[assetId].updated.emit(assetId);
|
||||
m_fileUpdated[assetId].emit(assetId);
|
||||
return {};
|
||||
}
|
||||
|
||||
@ -290,7 +287,7 @@ class AssetManager {
|
||||
ox::Result<AssetRef<T>> loadAsset(ox::StringView assetId) noexcept {
|
||||
oxRequire(m, getTypeManager<T>());
|
||||
oxRequire(out, m->loadAsset(assetId));
|
||||
m_fileTrackers[assetId].updated.connect(m, &AssetTypeManager<T>::reloadAsset);
|
||||
m_fileUpdated[assetId].connect(m, &AssetTypeManager<T>::reloadAsset);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user