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

Method GetPatternProjectionData

trinity/Eve/SpaceObjectFactory/EveSOFDNA.cpp:1598–1620  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Return pattern data, but needs to exist for provided hull! (if available) --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1596// Return pattern data, but needs to exist for provided hull! (if available)
1597// --------------------------------------------------------------------------------
1598const EveSOFDataMgr::PatternProjectionData* EveSOFDNA::GetPatternProjectionData( const EveSOFDataMgr::PatternApplicationData* patternApplicationData, size_t layer ) const
1599{
1600 if( nullptr == patternApplicationData )
1601 {
1602 return nullptr;
1603 }
1604 if( !HasDnaCommand( CMD_PATTERN ) && !UsingSof6() )
1605 {
1606 if( layer > 0 )
1607 {
1608 // only 1 layer for default patterns, might be increased to 2
1609 return nullptr;
1610 }
1611 // ok no DNA command for a pattern, so we use the default from the hull
1612 return &patternApplicationData->layerAndProjection[0].second;
1613 }
1614
1615 if( patternApplicationData->layerAndProjection.size() < layer )
1616 {
1617 return nullptr;
1618 }
1619 return &patternApplicationData->layerAndProjection[layer].second;
1620}
1621
1622
1623// --------------------------------------------------------------------------------

Callers 1

SetupCustomMaskMethod · 0.80

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected