| 121 | } |
| 122 | |
| 123 | void 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 | } |
nothing calls this directly
no test coverage detected