--------------------------------------------------------------------------------------------------------------
| 483 | |
| 484 | //-------------------------------------------------------------------------------------------------------------- |
| 485 | CTexture* CResourceManager::_CreateTexture(LPCSTR _Name) |
| 486 | { |
| 487 | // DBG_VerifyTextures (); |
| 488 | if (0 == xr_strcmp(_Name, "null")) |
| 489 | return 0; |
| 490 | R_ASSERT(_Name && _Name[0]); |
| 491 | string_path Name; |
| 492 | xr_strcpy(Name, _Name); //. andy if (strext(Name)) *strext(Name)=0; |
| 493 | fix_texture_name(Name); |
| 494 | |
| 495 | #ifdef DEBUG |
| 496 | simplify_texture(Name); |
| 497 | #endif // DEBUG |
| 498 | |
| 499 | // ***** first pass - search already loaded texture |
| 500 | LPSTR N = LPSTR(Name); |
| 501 | map_TextureIt I = m_textures.find(N); |
| 502 | if (I != m_textures.end()) |
| 503 | return I->second; |
| 504 | else |
| 505 | { |
| 506 | CTexture* T = xr_new<CTexture>(); |
| 507 | T->dwFlags |= xr_resource_flagged::RF_REGISTERED; |
| 508 | m_textures.insert(mk_pair(T->set_name(Name), T)); |
| 509 | T->Preload(); |
| 510 | if (RDEVICE.b_is_Ready && !bDeferredLoad) |
| 511 | T->Load(); |
| 512 | return T; |
| 513 | } |
| 514 | } |
| 515 | void CResourceManager::_DeleteTexture(const CTexture* T) |
| 516 | { |
| 517 | // DBG_VerifyTextures (); |
no test coverage detected