From 19388ba00336cd759a49088920d3fd461f1832c2 Mon Sep 17 00:00:00 2001 From: OusmBlueNinja <89956790+OusmBlueNinja@users.noreply.github.com> Date: Thu, 22 May 2025 20:48:17 -0500 Subject: [PATCH] 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. --- src/core/systems/AssetManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/systems/AssetManager.cpp b/src/core/systems/AssetManager.cpp index ff63263..3010f0e 100644 --- a/src/core/systems/AssetManager.cpp +++ b/src/core/systems/AssetManager.cpp @@ -28,7 +28,7 @@ namespace OX std::shared_ptr AssetManager::s_FileTree = std::make_shared(); std::filesystem::path AssetManager::s_ProjectRoot; - std::atomic AssetManager::s_Scanning{false}; + std::atomic AssetManager::s_Scanning{true}; std::thread AssetManager::s_ScanThread; std::queue AssetManager::s_TextureQueue; @@ -98,6 +98,7 @@ namespace OX std::vector > 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; }