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

Method InitializeGeometryResource

trinity/Tr2Mesh.cpp:115–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void Tr2Mesh::InitializeGeometryResource()
116{
117 TriGeometryResPtr lowRes;
118 TriGeometryResPtr res;
119
120 bool loadingLowRes = false;
121
122 if( !m_meshResPath.empty() && !BePaths->FileExistsLocally( CA2W( m_meshResPath.c_str() ) ) )
123 {
124 auto dot = m_meshResPath.rfind( '.' );
125 if( dot != std::string::npos )
126 {
127 auto lowResPath = m_meshResPath.substr( 0, dot ) + "_lowdetail" + m_meshResPath.substr( dot );
128 if( BePaths->FileExistsLocally( CA2W( lowResPath.c_str() ) ) )
129 {
130 BeResMan->GetResource( lowResPath.c_str(), m_geomResourceEx.c_str(), lowRes );
131 m_loadFence.Put();
132 BeResMan->GetResource( m_meshResPath.c_str(), m_geomResourceEx.c_str(), res );
133 loadingLowRes = true;
134 }
135 }
136 }
137
138 if( !loadingLowRes )
139 {
140 BeResMan->GetResource( m_meshResPath.c_str(), m_geomResourceEx.c_str(), res );
141 m_loadFence.Put();
142 }
143
144 SetLowResGeometryRes( lowRes );
145 SetGeometryRes( res );
146}
147
148void Tr2Mesh::InitializeMorphTargets()
149{

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
GetResourceMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected