X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Fengineer.cpp;h=9a3b930a01da1b55137c9a45b9279672f3d44565;hb=ab64a17394440c3cb18d0b30d75fb4ed6297a6b4;hp=b3c1f5f69960d970b2533dad00adc41f2c10b6de;hpb=e214fd389b9819eac0379cfb78e0f446e267b839;p=r2c2.git diff --git a/source/engineer/engineer.cpp b/source/engineer/engineer.cpp index b3c1f5f..9a3b930 100644 --- a/source/engineer/engineer.cpp +++ b/source/engineer/engineer.cpp @@ -73,7 +73,7 @@ Engineer::Engineer(int argc, char **argv): layout.signal_train_added.connect(sigc::mem_fun(this, &Engineer::train_added)); layout.signal_block_reserved.connect(sigc::hide<1>(sigc::mem_fun(this, &Engineer::reset_block_color))); layout.signal_emergency.connect(sigc::mem_fun(this, &Engineer::set_status)); - const set &blocks = layout.get_blocks(); + const set &blocks = layout.get_all(); for(set::const_iterator i=blocks.begin(); i!=blocks.end(); ++i) (*i)->get_sensor().signal_state_changed.connect(sigc::hide(sigc::bind(sigc::mem_fun(this, &Engineer::reset_block_color), sigc::ref(**i)))); @@ -271,7 +271,7 @@ void Engineer::button_press(unsigned btn) if(track->get_turnout_id()) { Block &block = track->get_block(); - if(block.get_train() && !block.get_train()->free_block(block)) + if(block.get_train() && block.get_train()->is_block_critical(block)) set_status("Turnout is busy"); else { @@ -312,7 +312,7 @@ void Engineer::view_all() const Layout3D::TrackMap &tracks = layout_3d.get_tracks(); float view_aspect = float(window.get_width()-200)/window.get_height(); - float view_height = tan(camera.get_field_of_view()/2)*2; + float view_height = tan(camera.get_field_of_view()/2.0f)*2.0f; float best_score = 0; GL::Vector3 pos; GL::Vector3 up;