- if(placing_train && placing_block)
- {
- GL::push_matrix();
-
- const Marklin::Block::Endpoint &bep = placing_block->get_endpoints()[placing_entry];
- float rot = bep.track->get_endpoint_direction(bep.track_ep);
- Point pos = bep.track->get_endpoint_position(bep.track_ep);
-
- GL::translate(pos.x, pos.y, pos.z+0.03);
- GL::rotate(rot*180/M_PI+180, 0, 0, 1);
- GL::Texture::unbind();
-
- GL::Immediate imm((GL::COLOR4_UBYTE, GL::VERTEX2));
- imm.color(1.0f, 1.0f, 1.0f);
- imm.begin(GL::TRIANGLE_FAN);
- imm.vertex(0.08, 0);
- imm.vertex(0.05, 0.03);
- imm.vertex(0.05, 0.01);
- imm.vertex(0, 0.01);
- imm.vertex(0, -0.01);
- imm.vertex(0.05, -0.01);
- imm.vertex(0.05, -0.03);
- imm.end();
-
- 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);
- GL::matrix_mode(GL::MODELVIEW);
- GL::load_identity();