Skip to content

Commit 8664494

Browse files
committed
Further fixes
1 parent b669613 commit 8664494

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Source/RunActivity/Viewer3D/UserInputRailDriver.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ public RailDriverState(Game game)
133133
Commands[UserCommand.ControlBailOff] = new ExternalDeviceButton();
134134
Commands[UserCommand.ControlWiper] = new ExternalDeviceButton();
135135

136-
//Activation = new RailDriverButton(1, 0x40);
137-
138136
CabControls[(new CabViewControlType(CABViewControlTypes.DIRECTION), -1)] = Direction;
139137
CabControls[(new CabViewControlType(CABViewControlTypes.THROTTLE), -1)] = Throttle;
140138
CabControls[(new CabViewControlType(CABViewControlTypes.TRAIN_BRAKE), -1)] = TrainBrake;
@@ -296,8 +294,8 @@ public class RailDriverButton : ExternalDeviceButton
296294
byte Mask;
297295
public RailDriverButton(byte command)
298296
{
299-
Index = command / 8;
300-
Mask = (byte)(command % 8);
297+
Index = 8 + command / 8;
298+
Mask = (byte)(1 << (command % 8));
301299
}
302300
public void Update(byte[] data)
303301
{

Source/RunActivity/Viewer3D/Viewer.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// COPYRIGHT 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 by the Open Rails project.
1+
// COPYRIGHT 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 by the Open Rails project.
22
//
33
// This file is part of Open Rails.
44
//
@@ -759,6 +759,8 @@ public void Update(RenderFrame frame, float elapsedRealTime)
759759
MPManager.Instance().Update(Simulator.GameTime);
760760
}
761761

762+
UserInput.RDState.ShowSpeed(MpS.FromMpS(PlayerLocomotive.SpeedMpS, PlayerLocomotive.IsMetric));
763+
762764
// This has to be done also for stopped trains
763765
var cars = World.Trains.Cars;
764766
foreach (var car in cars)
@@ -1577,8 +1579,7 @@ void HandleUserInput(ElapsedTime elapsedTime)
15771579
}
15781580
}
15791581

1580-
if (UserInput.RDState != null)
1581-
UserInput.RDState.Handled();
1582+
UserInput.Handled();
15821583

15831584
MouseState currentMouseState = Mouse.GetState();
15841585

0 commit comments

Comments
 (0)