- const Icon &icon = *i->second;
-
- const Point &pos = i->first->get_track().get_position();
- Point minp;
- Point maxp;
- i->first->get_type().get_bounds(0, minp, maxp);
- float rot = i->first->get_track().get_rotation();
- float c = cos(rot);
- float s = sin(rot);
-
- GL::Vector3 p((minp.x+maxp.x)/2, (minp.y+maxp.y)/2, 0);
- p = GL::Vector3(pos.x+c*p.x-s*p.y, pos.y+s*p.x+c*p.y, pos.z+0.02);
- p = camera.project(p);
-
- GL::PushMatrix push_mat;
- p.x = int(p.x*0.5*window.get_width()-icon.width*size/2);
- p.y = int(p.y*0.5*window.get_height());
- GL::translate(p.x, p.y, p.z);
- GL::scale_uniform(size);
-
- icon.background.draw();
-
- glColor3f(0.0, 1.0, 0.0);
- for(vector<const GL::Mesh *>::const_iterator j=icon.graphics.begin(); j!=icon.graphics.end(); ++j)
- {
- (*j)->draw();
- GL::translate(spacing, 0, 0);
- }
-
- GL::translate(0, baseline, 0);
- font.draw_string(icon.label);
- GL::Texture::unbind();