| 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 | { |
no test coverage detected