| 312 | |
| 313 | |
| 314 | const ManagedTexture* TextureManager::LoadPIXImageFromFile( const std::wstring& fileName ) |
| 315 | { |
| 316 | auto ManagedTex = FindOrLoadTexture(fileName); |
| 317 | |
| 318 | ManagedTexture* ManTex = ManagedTex.first; |
| 319 | const bool RequestsLoad = ManagedTex.second; |
| 320 | |
| 321 | if (!RequestsLoad) |
| 322 | { |
| 323 | ManTex->WaitForLoad(); |
| 324 | return ManTex; |
| 325 | } |
| 326 | |
| 327 | Utility::ByteArray ba = Utility::ReadFileSync( s_RootPath + fileName ); |
| 328 | if (ba->size() > 0) |
| 329 | { |
| 330 | ManTex->CreatePIXImageFromMemory(ba->data(), ba->size()); |
| 331 | ManTex->GetResource()->SetName(fileName.c_str()); |
| 332 | } |
| 333 | else |
| 334 | ManTex->SetToInvalidTexture(); |
| 335 | |
| 336 | return ManTex; |
| 337 | } |
nothing calls this directly
no test coverage detected