| 68 | } |
| 69 | |
| 70 | bool Tr2SkinnedObjectLod::UnloadLodIfNeeded( const Be::Time time, const Be::Time deltaTime ) |
| 71 | { |
| 72 | // only unload LODs during normal operations, ie. _not_ when the engine is stalling due to |
| 73 | // heavy loads; else unload-but-oops-we're-still-using-it will trigger a reload and trash even |
| 74 | // worse. |
| 75 | if( !m_allowLodSelection || TimeAsFloat( deltaTime ) > g_unloadLODMaxFrametime ) |
| 76 | { |
| 77 | return false; |
| 78 | } |
| 79 | |
| 80 | Be::Time timeout = TimeFromDouble( AVATAR_RESOURCE_UNLOADING_TIME_THRESHOLD ); |
| 81 | |
| 82 | // Never unload the currently used proxy |
| 83 | if( m_highDetailProxy ) |
| 84 | { |
| 85 | m_highDetailProxy->Update( time, ( m_currentLod == 0 ) ? 0 : timeout ); |
| 86 | } |
| 87 | if( m_mediumDetailProxy ) |
| 88 | { |
| 89 | m_mediumDetailProxy->Update( time, ( m_currentLod == 1 ) ? 0 : timeout ); |
| 90 | } |
| 91 | if( m_lowDetailProxy ) |
| 92 | { |
| 93 | m_lowDetailProxy->Update( time, ( m_currentLod == 2 ) ? 0 : timeout ); |
| 94 | } |
| 95 | |
| 96 | return false; |
| 97 | } |
| 98 | |
| 99 | Tr2SkinnedModel* Tr2SkinnedObjectLod::GetHighDetailModel() |
| 100 | { |
no test coverage detected