MCPcopy Create free account
hub / github.com/BobbyAnguelov/Esoterica / GetModuleResourceLoadingState

Method GetModuleResourceLoadingState

Code/Base/Application/Module.cpp:26–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 Module::LoadingState Module::GetModuleResourceLoadingState()
27 {
28 for ( int32_t i = int32_t( m_currentlyLoadingResources.size() ) - 1; i >= 0; i-- )
29 {
30 LoadingStatus const resourceStatus = m_currentlyLoadingResources[i]->GetLoadingStatus();
31 if ( resourceStatus == LoadingStatus::Unloaded || resourceStatus == LoadingStatus::Loading || resourceStatus == LoadingStatus::Unloading )
32 {
33 continue;
34 }
35
36 if ( resourceStatus == LoadingStatus::Failed )
37 {
38 m_hasResourceLoadingFailed = true;
39 }
40 else if ( resourceStatus == LoadingStatus::Loaded )
41 {
42 OnModuleResourceLoaded( m_currentlyLoadingResources[i] );
43 }
44
45 m_currentlyLoadingResources.erase_unsorted( m_currentlyLoadingResources.begin() + i );
46 }
47
48 // Return overall state
49 //-------------------------------------------------------------------------
50
51 if ( m_currentlyLoadingResources.empty() )
52 {
53 return m_hasResourceLoadingFailed ? LoadingState::Failed : LoadingState::Succeeded;
54 }
55 else
56 {
57 return LoadingState::Busy;
58 }
59 }
60
61 void Module::UnloadModuleResources( Resource::ResourceSystem& resourceSystem )
62 {

Callers 2

InitializeMethod · 0.80
UpdateMethod · 0.80

Calls 5

GetLoadingStatusMethod · 0.80
sizeMethod · 0.45
erase_unsortedMethod · 0.45
beginMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected