]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/engineer.cpp
Attempt to estimate the exact positions of trains from measured speed data
[r2c2.git] / source / engineer / engineer.cpp
index fc6d75df5e1261c17d9cc23b60a060cf8d324f5c..5466302ca7cfbbc60955deb1b36c57ce39e85e5e 100644 (file)
@@ -263,6 +263,28 @@ void Engineer::tick()
                GL::pop_matrix();
        }
 
+       const list<Train *> &trains=trfc_mgr->get_trains();
+       for(list<Train *>::const_iterator i=trains.begin(); i!=trains.end(); ++i)
+       {
+               GL::PushMatrix _push;
+
+               const Point &tp=(*i)->get_position();
+               GL::translate(tp.x, tp.y, 0.02);
+               GL::Immediate imm((GL::COLOR4_UBYTE, GL::VERTEX2));
+               imm.color(0.8f, 0.8f, 1.0f);
+               imm.begin(GL::TRIANGLE_FAN);
+               imm.vertex(0, 0);
+               for(unsigned j=0; j<=12; ++j)
+                       imm.vertex(0.02*cos(j*M_PI/6), 0.02*sin(j*M_PI/6));
+               imm.end();
+
+               GL::rotate(cam_rot*180/M_PI, 0, 0, 1);
+               GL::translate(0.03, -0.02, 0);
+               GL::scale_uniform(0.04);
+               ui_res.get_default_font().draw_string((*i)->get_name());
+               GL::Texture::unbind();
+       }
+
        GL::matrix_mode(GL::PROJECTION);
        GL::load_identity();
        GL::ortho_bottomleft(screen_w, screen_h);