]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/engineer.cpp
Simulate commands if no serial device is set to make turnouts work
[r2c2.git] / source / engineer / engineer.cpp
index a2e13f10f3474f590c4e02f97ec5b117ed9d6bde..777758700a4a857bf81df07c42d4a8cb7975ae50 100644 (file)
@@ -229,10 +229,10 @@ void Engineer::tick()
                if(track.get_turnout_id())
                {
                        Turnout &trnt = control.get_turnout(track.get_turnout_id());
-                       (*i)->render_route(trnt.get_route());
+                       (*i)->render_path(trnt.get_path());
                }
                else
-                       (*i)->render_route(-1);
+                       (*i)->render_path(-1);
        }
 
        if(placing_train && placing_block)
@@ -268,7 +268,7 @@ void Engineer::tick()
                GL::PushMatrix _push;
 
                const Point &tp = (*i)->get_position();
-               GL::translate(tp.x, tp.y, 0.02);
+               GL::translate(tp.x, tp.y, tp.z+0.02);
                GL::Immediate imm((GL::COLOR4_UBYTE, GL::VERTEX2));
                imm.color(0.8f, 0.8f, 1.0f);
                imm.begin(GL::TRIANGLE_FAN);
@@ -327,7 +327,7 @@ void Engineer::button_press(int x, int y, unsigned btn, unsigned)
                                Turnout &turnout = control.get_turnout(tid);
                                try
                                {
-                                       turnout.set_route((turnout.get_route()+1)%track->get_track().get_type().get_n_routes());
+                                       turnout.set_path((turnout.get_path()+1)%track->get_track().get_type().get_n_paths());
                                        main_panel->set_status_text(format("Turnout %d switched", turnout.get_address()));
                                }
                                catch(const TurnoutBusy &e)