| 52 | Vector4 ColorToVec4( uint32_t color ); |
| 53 | |
| 54 | TriStepResult TriStepRenderDebug::Execute( Be::Time realTime, Be::Time simTime, Tr2RenderContext& renderContext ) |
| 55 | { |
| 56 | // Render point clouds |
| 57 | renderContext.m_esm.ApplyVertexDeclaration( g_debugResourceHelper.GetVertexPosColorDecl() ); |
| 58 | g_debugResourceHelper.GetEffect()->Render( this, renderContext ); |
| 59 | |
| 60 | // Render lines |
| 61 | m_lineSet->Render( renderContext ); |
| 62 | |
| 63 | Tr2Viewport viewport; |
| 64 | renderContext.GetViewport( viewport ); |
| 65 | |
| 66 | for( TrackableStdList<ProjectedTextEntry>::iterator it = m_projectedText.begin(); it != m_projectedText.end(); ++it ) |
| 67 | { |
| 68 | ProjectedTextEntry e = *it; |
| 69 | |
| 70 | Tr2Rect rect; |
| 71 | Vector3 screenPos = Tr2Renderer::ProjectWorldToScreen( e.pos, viewport ); |
| 72 | |
| 73 | if( ( screenPos.z > 0.0f ) && ( screenPos.z < 1.0f ) ) |
| 74 | { |
| 75 | rect.top = (int32_t)screenPos.y; |
| 76 | rect.left = (int32_t)screenPos.x; |
| 77 | rect.bottom = rect.top + 512; |
| 78 | rect.right = rect.left + 1024; |
| 79 | |
| 80 | m_projectedTextRenderer->PrintfImmediate( renderContext, TRI_DBG_FONT_SMALL, rect, TRI_DFS_LEFT, ColorToVec4( e.color ), e.msg.c_str() ); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // Render text |
| 85 | m_textRenderer->Render( renderContext ); |
| 86 | |
| 87 | if( m_autoClear ) |
| 88 | { |
| 89 | Clear(); |
| 90 | } |
| 91 | return RS_OK; |
| 92 | } |
| 93 | |
| 94 | void TriStepRenderDebug::DrawPointCloud( int numPoints, float* points, int stride ) |
| 95 | { |
nothing calls this directly
no test coverage detected