Starts asset scanning on application start
Ensures that the asset scanner begins automatically when the application starts, so that the asset database is populated from the beginning.
This commit is contained in:
parent
9641de9b2c
commit
19388ba003
@ -28,7 +28,7 @@ namespace OX
|
||||
std::shared_ptr<ResourceTreeNode> AssetManager::s_FileTree = std::make_shared<ResourceTreeNode>();
|
||||
|
||||
std::filesystem::path AssetManager::s_ProjectRoot;
|
||||
std::atomic<bool> AssetManager::s_Scanning{false};
|
||||
std::atomic<bool> AssetManager::s_Scanning{true};
|
||||
std::thread AssetManager::s_ScanThread;
|
||||
|
||||
std::queue<AssetManager::PendingTexture> AssetManager::s_TextureQueue;
|
||||
@ -98,6 +98,7 @@ namespace OX
|
||||
std::vector<std::pair<std::string, AssetMetadata> > newMetadata;
|
||||
newMetadata.reserve(256);
|
||||
|
||||
|
||||
for (auto &entry: allEntries) {
|
||||
if (!s_Scanning) break;
|
||||
|
||||
@ -138,7 +139,6 @@ namespace OX
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
|
||||
s_Scanning = false;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user