asyncResourceGatherer: add dma frames before starting the asyncLoopThread (#394)

This commit is contained in:
Maximilian Seidler 2024-07-03 19:31:16 +02:00 committed by GitHub
parent 88b9ce48ed
commit 9873ec58b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,12 +12,6 @@
#include "../helpers/Webp.hpp" #include "../helpers/Webp.hpp"
CAsyncResourceGatherer::CAsyncResourceGatherer() { CAsyncResourceGatherer::CAsyncResourceGatherer() {
asyncLoopThread = std::thread([this]() {
this->gather(); /* inital gather */
this->asyncAssetSpinLock();
});
asyncLoopThread.detach();
// some things can't be done async :( // some things can't be done async :(
// gather background textures when needed // gather background textures when needed
@ -54,6 +48,12 @@ CAsyncResourceGatherer::CAsyncResourceGatherer() {
dmas.emplace_back(std::make_unique<CDMAFrame>(PMONITOR)); dmas.emplace_back(std::make_unique<CDMAFrame>(PMONITOR));
} }
asyncLoopThread = std::thread([this]() {
this->gather(); /* inital gather */
this->asyncAssetSpinLock();
});
asyncLoopThread.detach();
} }
SPreloadedAsset* CAsyncResourceGatherer::getAssetByID(const std::string& id) { SPreloadedAsset* CAsyncResourceGatherer::getAssetByID(const std::string& id) {