MCPcopy Create free account
hub / github.com/carbonengine/trinity / UnloadLodIfNeeded

Method UnloadLodIfNeeded

trinity/Tr2SkinnedObjectLOD.cpp:70–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70bool 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
99Tr2SkinnedModel* Tr2SkinnedObjectLod::GetHighDetailModel()
100{

Callers 1

PostPhysicsUpdateMethod · 0.80

Calls 1

UpdateMethod · 0.45

Tested by

no test coverage detected