+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
#include <algorithm>
-#include <fstream>
+#include <limits>
#include <msp/gl/rendermode.h>
#include <msp/gl/select.h>
#include <msp/gl/texture.h>
void Layout3D::set_quality(unsigned q)
{
- quality=q;
+ quality = q;
for(list<Track3D *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
(*i)->set_quality(quality);
}
glLoadIdentity();
double clip[4];
- clip[0]=1;
- clip[1]=0;
- clip[2]=x-size;
- clip[3]=0;
+ clip[0] = 1;
+ clip[1] = 0;
+ clip[2] = x-size;
+ clip[3] = 0;
glClipPlane(GL_CLIP_PLANE0, clip);
glEnable(GL_CLIP_PLANE0);
- clip[0]=-1;
- clip[2]=-(x+size);
+ clip[0] = -1;
+ clip[2] = -(x+size);
glClipPlane(GL_CLIP_PLANE1, clip);
glEnable(GL_CLIP_PLANE1);
- clip[0]=0;
- clip[1]=1;
- clip[2]=y-size;
+ clip[0] = 0;
+ clip[1] = 1;
+ clip[2] = y-size;
glClipPlane(GL_CLIP_PLANE2, clip);
glEnable(GL_CLIP_PLANE2);
- clip[1]=-1;
- clip[2]=-(y+size);
+ clip[1] = -1;
+ clip[2] = -(y+size);
glClipPlane(GL_CLIP_PLANE3, clip);
glEnable(GL_CLIP_PLANE3);
glDisable(GL_CLIP_PLANE3);
GL::render_mode(GL::RENDER);
- Track3D *track=0;
- unsigned track_depth=numeric_limits<unsigned>::max();
+ Track3D *track = 0;
+ unsigned track_depth = numeric_limits<unsigned>::max();
for(vector<GL::SelectRecord>::iterator i=select_buf.begin(); i!=select_buf.end(); ++i)
if(i->min_depth<track_depth)
{
- track=reinterpret_cast<Track3D *>(i->names.back());
- track_depth=i->min_depth;
+ track = reinterpret_cast<Track3D *>(i->names.back());
+ track_depth = i->min_depth;
}
return track;