| 286 | } |
| 287 | |
| 288 | const ManagedTexture* TextureManager::LoadTGAFromFile( const std::wstring& fileName, bool sRGB ) |
| 289 | { |
| 290 | auto ManagedTex = FindOrLoadTexture(fileName); |
| 291 | |
| 292 | ManagedTexture* ManTex = ManagedTex.first; |
| 293 | const bool RequestsLoad = ManagedTex.second; |
| 294 | |
| 295 | if (!RequestsLoad) |
| 296 | { |
| 297 | ManTex->WaitForLoad(); |
| 298 | return ManTex; |
| 299 | } |
| 300 | |
| 301 | Utility::ByteArray ba = Utility::ReadFileSync( s_RootPath + fileName ); |
| 302 | if (ba->size() > 0) |
| 303 | { |
| 304 | ManTex->CreateTGAFromMemory( ba->data(), ba->size(), sRGB ); |
| 305 | ManTex->GetResource()->SetName(fileName.c_str()); |
| 306 | } |
| 307 | else |
| 308 | ManTex->SetToInvalidTexture(); |
| 309 | |
| 310 | return ManTex; |
| 311 | } |
| 312 | |
| 313 | |
| 314 | const ManagedTexture* TextureManager::LoadPIXImageFromFile( const std::wstring& fileName ) |
nothing calls this directly
no test coverage detected