| 48 | } |
| 49 | |
| 50 | TriStepResult TriStepRenderLineGraph::Execute( Be::Time realTime, Be::Time simTime, Tr2RenderContext& renderContext ) |
| 51 | { |
| 52 | if( m_autoScale ) |
| 53 | { |
| 54 | float maxValue = 0.0f; |
| 55 | for( Tr2LineGraphVector::iterator it = m_lineGraphs.begin(); it != m_lineGraphs.end(); ++it ) |
| 56 | { |
| 57 | Tr2LineGraph* lg = *it; |
| 58 | float x = lg->GetMaxValue(); |
| 59 | if( x > maxValue ) |
| 60 | { |
| 61 | maxValue = x; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | if( maxValue == 0.0f ) |
| 66 | { |
| 67 | maxValue = 1.0f; |
| 68 | } |
| 69 | |
| 70 | maxValue *= 1.1f; |
| 71 | |
| 72 | if( maxValue > 1.0f ) |
| 73 | { |
| 74 | maxValue /= 10.0f; |
| 75 | maxValue = ceil( maxValue ); |
| 76 | maxValue *= 10.0f; |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | maxValue = 1.0f / maxValue; |
| 81 | maxValue /= 10.0f; |
| 82 | if( maxValue > 1.0f ) |
| 83 | { |
| 84 | maxValue = floor( maxValue ); |
| 85 | } |
| 86 | maxValue *= 10.0f; |
| 87 | maxValue = 1.0f / maxValue; |
| 88 | } |
| 89 | |
| 90 | if( maxValue * m_legendScale > m_maxLegend ) |
| 91 | { |
| 92 | maxValue = m_maxLegend / m_legendScale; |
| 93 | } |
| 94 | |
| 95 | float newScale = 1.0f / maxValue; |
| 96 | if( newScale != m_scale ) |
| 97 | { |
| 98 | m_scale = newScale; |
| 99 | |
| 100 | if( m_scaleChangeCallback ) |
| 101 | { |
| 102 | m_scaleChangeCallback.CallVoid(); |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | int y = 0; |
nothing calls this directly
no test coverage detected