MCPcopy Create free account
hub / github.com/defold/defold / PreloaderUpdateOneItem

Function PreloaderUpdateOneItem

engine/resource/src/resource_preloader.cpp:763–789  ·  view source on GitHub ↗

Find the first request that has is RESULT_PENDING and try to load it Continue until all requests are checked or we have created a one resource

Source from the content-addressed store, hash-verified

761 // Find the first request that has is RESULT_PENDING and try to load it
762 // Continue until all requests are checked or we have created a one resource
763 static bool PreloaderUpdateOneItem(HPreloader preloader, TRequestIndex index)
764 {
765 DM_PROFILE("PreloaderUpdateOneItem");
766 while (index >= 0)
767 {
768 PreloadRequest* req = &preloader->m_Request[index];
769 switch (req->m_LoadResult)
770 {
771 case RESULT_PENDING:
772 if (DoPreloaderUpdateOneReq(preloader, index, req))
773 {
774 return true;
775 }
776 break;
777 case RESULT_RESOURCE_LOOP_ERROR:
778 if (PreloaderTryPruneParent(preloader, req))
779 {
780 return true;
781 }
782 break;
783 default:
784 break;
785 }
786 index = req->m_NextSibling;
787 }
788 return false;
789 }
790
791 // Returns true if the item or any of its children is found that has completed its loading from the load queue
792 static bool DoPreloaderUpdateOneReq(HPreloader preloader, TRequestIndex index, PreloadRequest* req)

Callers 2

DoPreloaderUpdateOneReqFunction · 0.85
UpdatePreloaderFunction · 0.85

Calls 2

DoPreloaderUpdateOneReqFunction · 0.85
PreloaderTryPruneParentFunction · 0.85

Tested by

no test coverage detected