| 264 | } |
| 265 | |
| 266 | const ManagedTexture* TextureManager::LoadDDSFromFile( const std::wstring& fileName, bool sRGB ) |
| 267 | { |
| 268 | auto ManagedTex = FindOrLoadTexture(fileName); |
| 269 | |
| 270 | ManagedTexture* ManTex = ManagedTex.first; |
| 271 | const bool RequestsLoad = ManagedTex.second; |
| 272 | |
| 273 | if (!RequestsLoad) |
| 274 | { |
| 275 | ManTex->WaitForLoad(); |
| 276 | return ManTex; |
| 277 | } |
| 278 | |
| 279 | Utility::ByteArray ba = Utility::ReadFileSync( s_RootPath + fileName ); |
| 280 | if (ba->size() == 0 || !ManTex->CreateDDSFromMemory( ba->data(), ba->size(), sRGB )) |
| 281 | ManTex->SetToInvalidTexture(); |
| 282 | else |
| 283 | ManTex->GetResource()->SetName(fileName.c_str()); |
| 284 | |
| 285 | return ManTex; |
| 286 | } |
| 287 | |
| 288 | const ManagedTexture* TextureManager::LoadTGAFromFile( const std::wstring& fileName, bool sRGB ) |
| 289 | { |
nothing calls this directly
no test coverage detected