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

Method GetGrannyMesh

trinity/Resources/TriGrannyRes.cpp:277–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275
276#if WITH_GRANNY
277const granny_mesh* TriGrannyRes::GetGrannyMesh( int meshIx ) const
278{
279 // helper function to safely access a granny_mesh struct
280 if( !m_grannyFile )
281 {
282 CCP_LOGERR( "TriGrannyRes::GetGrannyMesh: Object has no Granny file" );
283 return NULL;
284 }
285
286 granny_file_info* fi = GrannyGetFileInfo( m_grannyFile );
287 if( !fi )
288 {
289 CCP_LOGERR( "TriGrannyRes::GetGrannyMesh: Granny file has no file info" );
290 return NULL;
291 }
292
293 if( fi->MeshCount <= (granny_int32)meshIx )
294 {
295 CCP_LOGERR( "TriGrannyRes::GetGrannyMesh: meshindex too high" );
296 return NULL;
297 }
298
299 return fi->Meshes[meshIx];
300}
301#endif
302
303#if WITH_GRANNY

Callers 2

DoSpawnMethod · 0.80
InitializeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected