| 408 | } |
| 409 | |
| 410 | void Arrow3d::Render(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, ScreenBase const & screen, |
| 411 | bool routingMode) |
| 412 | { |
| 413 | // Render shadow. |
| 414 | if (m_shadowMesh && m_enableShadow && screen.isPerspective()) |
| 415 | { |
| 416 | RenderArrow(context, mng, *m_shadowMesh, screen, gpu::Program::Arrow3dShadow, |
| 417 | df::GetColorConstant(df::kArrow3DShadowColor), 0.05f /* dz */, |
| 418 | routingMode ? kOutlineScale : 1.0f /* scaleFactor */); |
| 419 | } |
| 420 | |
| 421 | // Render outline. |
| 422 | if (m_shadowMesh && m_enableOutline && routingMode) |
| 423 | { |
| 424 | dp::Color const outlineColor = df::GetColorConstant(df::kArrow3DOutlineColor); |
| 425 | RenderArrow(context, mng, *m_shadowMesh, screen, gpu::Program::Arrow3dOutline, outlineColor, 0.0f /* dz */, |
| 426 | kOutlineScale /* scaleFactor */); |
| 427 | } |
| 428 | |
| 429 | // Render arrow. |
| 430 | if (m_arrowMeshTexturingEnabled) |
| 431 | { |
| 432 | // Use only alpha channel from arrow color for textured meshes. |
| 433 | auto const color = dp::Color(255, 255, 255, |
| 434 | m_obsoletePosition ? df::GetColorConstant(df::kArrow3DObsoleteColor).GetAlpha() |
| 435 | : df::GetColorConstant(df::kArrow3DColor).GetAlpha()); |
| 436 | |
| 437 | RenderArrow(context, mng, m_arrowMesh, screen, gpu::Program::Arrow3dTextured, color, 0.0f /* dz */, |
| 438 | 1.0f /* scaleFactor */); |
| 439 | } |
| 440 | else |
| 441 | { |
| 442 | dp::Color const color = df::GetColorConstant(m_obsoletePosition ? df::kArrow3DObsoleteColor : df::kArrow3DColor); |
| 443 | RenderArrow(context, mng, m_arrowMesh, screen, gpu::Program::Arrow3d, color, 0.0f /* dz */, 1.0f /* scaleFactor */); |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | void Arrow3d::RenderArrow(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, dp::MeshObject & mesh, |
| 448 | ScreenBase const & screen, gpu::Program program, dp::Color const & color, float dz, |
no test coverage detected