]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/engineer.cpp
Rename Point to Vector
[r2c2.git] / source / engineer / engineer.cpp
index 8db0be6c2465433f23cef8ea3610fb3fb9da0aaf..fad61693aef66161e1822dc18f7e8a209f7d33af 100644 (file)
@@ -12,6 +12,7 @@ Distributed under the GPL
 #include <signal.h>
 #include <msp/core/except.h>
 #include <msp/fs/stat.h>
+#include <msp/fs/utils.h>
 #include <msp/gbase/display.h>
 #include <msp/gbase/window.h>
 #include <msp/gl/blend.h>
@@ -131,7 +132,10 @@ Engineer::~Engineer()
        layout.get_driver().flush();
 
        if(!options.simulate)
-               layout.save_dynamic(options.state_fn);
+       {
+               layout.save_dynamic(options.state_fn+".tmp");
+               FS::rename(options.state_fn+".tmp", options.state_fn);
+       }
 
        delete overlay;
        delete root;
@@ -233,7 +237,7 @@ void Engineer::tick()
                GL::PushMatrix push_mat;
 
                float rot = picking_track->get_endpoint_direction(picking_entry);
-               Point pos = picking_track->get_endpoint_position(picking_entry);
+               Vector pos = picking_track->get_endpoint_position(picking_entry);
 
                GL::translate(pos.x, pos.y, pos.z+0.03);
                GL::rotate(rot*180/M_PI+180, 0, 0, 1);
@@ -334,7 +338,7 @@ void Engineer::view_all()
                float max_y = 0;
                for(Layout3D::TrackMap::const_iterator i=tracks.begin(); i!=tracks.end(); ++i)
                {
-                       Point minp, maxp;
+                       Vector minp, maxp;
                        i->second->get_bounds(angle, minp, maxp);
                        min_x = min(min_x, minp.x);
                        max_x = max(max_x, maxp.x);