The simulation still has some problems with detriggering sensors if a
train advances too much during a step. This should alleviate the issue.
dt = t-last_tick;
last_tick = t;
+ unsigned count = dt/(10*Time::msec)+1;
+ dt /= count;
+ while(count--)
+ step(dt);
+}
+
+void Layout::step(const Time::TimeDelta &dt)
+{
if(!driver || !driver->is_halted())
clock.tick(dt);
#include <set>
#include <sigc++/sigc++.h>
#include <msp/datafile/objectloader.h>
+#include <msp/time/timedelta.h>
#include <msp/time/timestamp.h>
#include "geometry.h"
#include "sensor.h"
void remove_train(Train &);
void tick();
+private:
+ void step(const Msp::Time::TimeDelta &);
+public:
void emergency(Block *, const std::string &);
void save(const std::string &) const;