| 138 | } |
| 139 | |
| 140 | void Tr2LineSet::GetBatchesImpl( ITriRenderBatchAccumulator* accumulator, const Tr2PerObjectData* perObjectData, Tr2Material* effect, GetBatchesReason reason ) |
| 141 | { |
| 142 | if( !m_vertexBuffer.IsValid() ) |
| 143 | { |
| 144 | return; |
| 145 | } |
| 146 | |
| 147 | if( ( m_currentSubmittedTriangleCount > 0 ) && reason == GetBatchesReason::Picking ) |
| 148 | { |
| 149 | if( m_pickingVertexDeclHandle == Tr2EffectStateManager::UNINITIALIZED_DECLARATION ) |
| 150 | { |
| 151 | return; |
| 152 | } |
| 153 | |
| 154 | Tr2RenderBatch batch; |
| 155 | batch.SetMaterial( effect ); |
| 156 | batch.SetPerObjectData( perObjectData ); |
| 157 | batch.SetVertexDeclaration( m_pickingVertexDeclHandle ); |
| 158 | batch.SetStreamSource( 0, m_pickingVertexBuffer, sizeof( Triangle ) / 3 ); |
| 159 | batch.SetDrawInstanced( m_currentSubmittedTriangleCount * 3, 1, 0, 0 ); |
| 160 | accumulator->Commit( batch ); |
| 161 | } |
| 162 | else |
| 163 | { |
| 164 | if( m_vertexDeclHandle == Tr2EffectStateManager::UNINITIALIZED_DECLARATION ) |
| 165 | { |
| 166 | return; |
| 167 | } |
| 168 | |
| 169 | Tr2RenderBatch batch; |
| 170 | batch.SetMaterial( effect ); |
| 171 | batch.SetPerObjectData( perObjectData ); |
| 172 | batch.SetTopology( TOP_LINES ); |
| 173 | batch.SetVertexDeclaration( m_vertexDeclHandle ); |
| 174 | batch.SetStreamSource( 0, m_vertexBuffer, sizeof( LineData ) / 2 ); |
| 175 | batch.SetDrawInstanced( m_currentSubmittedLineCount * 2, 1, 0, 0 ); |
| 176 | accumulator->Commit( batch ); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | void Tr2LineSet::AddLine( const Vector3& position1, const Vector4& color1, const Vector3& position2, const Vector4& color2 ) |
| 181 | { |
nothing calls this directly
no test coverage detected