Permalink
Browse files

Only draw navtunnel corners at full brightness so it's less distracting

  • Loading branch information...
1 parent 33ee7eb commit e2942a9f1dcb0a02a3c4d84dd084953f9c4cbd7e @Luomu Luomu committed Mar 31, 2012
Showing with 29 additions and 12 deletions.
  1. +29 −12 src/WorldView.cpp
View
@@ -1619,6 +1619,7 @@ Widget(), m_worldview(worldview)
void NavTunnelWidget::Draw() {
Body *navtarget = Pi::player->GetNavTarget();
if (navtarget != NULL) {
+ m_worldview->m_renderer->SetBlendMode(Graphics::BLEND_ALPHA);
const Color green = Color(0.f, 1.f, 0.f, 0.8f);
vector2f indvec = vector2f(m_worldview->m_navTargetIndicator.pos[0], m_worldview->m_navTargetIndicator.pos[1]);
@@ -1705,23 +1706,39 @@ void NavTunnelWidget::Draw() {
i++;
}
}
+ m_worldview->m_renderer->SetBlendMode(Graphics::BLEND_SOLID);
}
}
void NavTunnelWidget::DrawTargetGuideSquare(const float pos[2], const float size, const Color &c)
{
- const float x1 = float(pos[0] - size);
- const float x2 = float(pos[0] + size);
- const float y1 = float(pos[1] - size);
- const float y2 = float(pos[1] + size);
-
- const vector2f vts[] = {
- vector2f(x1, y1),
- vector2f(x2, y1),
- vector2f(x2, y2),
- vector2f(x1, y2)
- };
- m_worldview->m_renderer->DrawLines2D(4, vts, c, Graphics::LINE_LOOP);
+ const float x1 = float(pos[0] - size);
+ const float x2 = float(pos[0] + size);
+ const float y1 = float(pos[1] - size);
+ const float y2 = float(pos[1] + size);
+
+ const vector3f vts[] = {
+ vector3f(x1, y1, 0.f),
+ vector3f(pos[0], y1, 0.f),
+ vector3f(x2, y1, 0.f),
+ vector3f(x2, pos[1], 0.f),
+ vector3f(x2, y2, 0.f),
+ vector3f(pos[0], y2, 0.f),
+ vector3f(x1, y2, 0.f),
+ vector3f(x1, pos[1], 0.f)
+ };
+ const Color black(0.f);
+ const Color col[] = {
+ c,
+ black,
+ c,
+ black,
+ c,
+ black,
+ c,
+ black
+ };
+ m_worldview->m_renderer->DrawLines(8, vts, col, Graphics::LINE_LOOP);
}
void NavTunnelWidget::GetSizeRequested(float size[2]) {

0 comments on commit e2942a9

Please sign in to comment.