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

Method LoadOverlay

trinity/Controllers/Actions/Tr2ActionOverlay.cpp:123–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void Tr2ActionOverlay::LoadOverlay( EveSpaceObject2* owner )
124{
125 m_overlay = nullptr;
126
127 // check if it exists on the owner
128 if( !m_overlayName.empty() )
129 {
130 m_overlay = owner->GetOverlayEffectByName( m_overlayName.c_str() );
131 }
132 if( m_addOnStart && !m_overlay && !m_path.empty() )
133 {
134 auto path = m_path;
135 std::transform( path.begin(), path.end(), path.begin(), ::tolower );
136
137 if( owner->IsAnimated() && !StringFind( path.c_str(), "_skinned" ) )
138 {
139 StringInsertStubBefore( path, ".red", "_skinned" );
140 }
141 else if( !owner->IsAnimated() && StringFind( path.c_str(), "_skinned" ) )
142 {
143 StringRemove( path, "_skinned" );
144 }
145
146 bool urgent = BeResMan->IsUrgentResourceLoads();
147 BeResMan->SetUrgentResourceLoads( true );
148 m_overlay = BeResMan->LoadObject<EveMeshOverlayEffect>( path.c_str() );
149 BeResMan->SetUrgentResourceLoads( urgent );
150 if( m_overlay )
151 {
152 if( !m_overlayName.empty() )
153 {
154 m_overlay->m_name = m_overlayName;
155 }
156 if( m_addOnStart )
157 {
158 owner->AddOverlayEffect( m_overlay );
159 m_overlay->StartControllers();
160 }
161 }
162 }
163}

Callers

nothing calls this directly

Calls 10

StringFindFunction · 0.85
StringInsertStubBeforeFunction · 0.85
StringRemoveFunction · 0.85
emptyMethod · 0.80
IsAnimatedMethod · 0.80
AddOverlayEffectMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
StartControllersMethod · 0.45

Tested by

no test coverage detected