mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 11:00:06 +00:00 
			
		
		
		
	Populate cached images into the texture atlas
This commit is contained in:
		
							parent
							
								
									0f9fbdbf63
								
							
						
					
					
						commit
						4c093d65f6
					
				
					 5 changed files with 104 additions and 18 deletions
				
			
		|  | @ -459,14 +459,23 @@ void PlacefileManager::Impl::LoadResources( | |||
|    const QUrl baseUrl = | ||||
|       QUrl::fromUserInput(QString::fromStdString(placefile->name())); | ||||
| 
 | ||||
|    // TODO: Parallelize
 | ||||
|    for (auto& iconFile : iconFiles) | ||||
|    { | ||||
|       QUrl fileUrl     = QUrl(QString::fromStdString(iconFile->filename_)); | ||||
|       QUrl resolvedUrl = baseUrl.resolved(fileUrl); | ||||
|    std::vector<std::string> urlStrings; | ||||
|    urlStrings.reserve(iconFiles.size()); | ||||
| 
 | ||||
|       ResourceManager::LoadImageResource(resolvedUrl.toString().toStdString()); | ||||
|    } | ||||
|    std::transform(iconFiles.cbegin(), | ||||
|                   iconFiles.cend(), | ||||
|                   std::back_inserter(urlStrings), | ||||
|                   [&baseUrl](auto& iconFile) | ||||
|                   { | ||||
|                      // Resolve target URL relative to base URL
 | ||||
|                      QUrl fileUrl = | ||||
|                         QUrl(QString::fromStdString(iconFile->filename_)); | ||||
|                      QUrl resolvedUrl = baseUrl.resolved(fileUrl); | ||||
| 
 | ||||
|                      return resolvedUrl.toString().toStdString(); | ||||
|                   }); | ||||
| 
 | ||||
|    ResourceManager::LoadImageResources(urlStrings); | ||||
| } | ||||
| 
 | ||||
| } // namespace manager
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat