Skip to content

Commit

Permalink
Automatic merge of T1.5.1-316-g54f6282b7 and 18 pull requests
Browse files Browse the repository at this point in the history
- Pull request #570 at 8be57e8: Experimental glTF 2.0 support with PBR lighting
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #732 at 1edb2e5: Improvements for air brakes
- Pull request #751 at 00981a2: Web interface to control cab controls with external hardware
- Pull request #767 at 4cb5c77: Refine sunrise and sunset
- Pull request #784 at 1c37be3: Incorrect distance along track
- Pull request #785 at fd121be: Incorrect calculation of distance to train ahead
- Pull request #786 at f2c5d2d: Improve syntax check on timetable files
- Pull request #787 at e0ad658: Improve debug output for turntable pools
- Pull request #788 at 94a73d5: Improve Debug Outputs for TTTrain.cs
- Pull request #789 at 81b11f7: Avoid error on inserting train without start time
- Pull request #790 at 36a9921: Correct crash in TrainCar.cs
- Pull request #791 at 5bc890b: Correct update for Switchstand signalscript function
- Pull request #792 at f6c16fb: Correct required actions
- Pull request #793 at 8897021: Correct errors in Turntables.cs
- Pull request #794 at 6d2bf04: Use reverse path in TT Pool
- Pull request #795 at 79979e2: Accept SpeedMPS as dimension for Approach Control Speed definition
- Pull request #803 at 7157e08: Various adjustments to steam adhesion
  • Loading branch information
openrails-bot committed Feb 27, 2023
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 41 deletions.
12 changes: 6 additions & 6 deletions Source/Orts.Simulation/Simulation/Physics/Train.cs
Expand Up @@ -11228,13 +11228,13 @@ public void RemoveFromTrack()

List<DistanceTravelledItem> activeActions = requiredActions.GetActions(99999999f, typeof(ClearSectionItem));
foreach (DistanceTravelledItem thisAction in activeActions)
{
ClearSectionItem thisItem = thisAction as ClearSectionItem;
TrackCircuitSection thisSection = signalRef.TrackCircuitList[thisItem.TrackSectionIndex];
thisSection.ClearOccupied(this, true);
}
{
ClearSectionItem thisItem = thisAction as ClearSectionItem;
TrackCircuitSection thisSection = signalRef.TrackCircuitList[thisItem.TrackSectionIndex];
thisSection.ClearOccupied(this, true);
}

}

//================================================================================================//
//
// Update track actions after coupling
Expand Down
16 changes: 8 additions & 8 deletions Source/Orts.Simulation/Simulation/Timetables/ProcessTimetable.cs
Expand Up @@ -1032,8 +1032,8 @@ public void FinalizeActivationCommands(ref List<TTTrain> trainList, ref TTTrain
{
if (thisTrain.TriggeredActivationRequired)
{
activatedTrains.Add(thisTrain.OrgAINumber);
}
activatedTrains.Add(thisTrain.OrgAINumber);
}
}

if (reqPlayerTrain.TriggeredActivationRequired)
Expand Down Expand Up @@ -3227,12 +3227,12 @@ public StopInfo(string name, string arrTime, string depTime, TimetableInfo ttinf
else
{

validArrTime = TimeSpan.TryParse(arrTime, out atime);
if (validArrTime)
{
arrivalTime = Convert.ToInt32(atime.TotalSeconds);
arrivalDT = new DateTime(atime.Ticks);
}
validArrTime = TimeSpan.TryParse(arrTime, out atime);
if (validArrTime)
{
arrivalTime = Convert.ToInt32(atime.TotalSeconds);
arrivalDT = new DateTime(atime.Ticks);
}
}

validDepTime = TimeSpan.TryParse(depTime, out atime);
Expand Down
24 changes: 12 additions & 12 deletions Source/Orts.Simulation/Simulation/Timetables/TTTrain.cs
Expand Up @@ -3322,9 +3322,9 @@ public override AITrain.AI_MOVEMENT_STATE UpdateStoppedState(float elapsedClockS

// check attach details
if (AttachDetails != null && AttachDetails.Valid && AttachDetails.ReadyToAttach && AttachDetails.AttachTrain == OtherTrain.OrgAINumber)
{
attachToTrain = true;
}
{
attachToTrain = true;
}

if (!attachToTrain)
{
Expand Down Expand Up @@ -5270,9 +5270,9 @@ public override void UpdateFollowingState(float elapsedClockSeconds, int present

// check attach details
if (AttachDetails != null && AttachDetails.Valid && AttachDetails.ReadyToAttach && AttachDetails.AttachTrain == OtherTrain.OrgAINumber)
{
attachToTrain = true;
}
{
attachToTrain = true;
}

// check pickup details
if (!attachToTrain)
Expand Down Expand Up @@ -10873,13 +10873,13 @@ public override void ActionsForSignalStop(ref bool claimAllowed)
if (otherTrain.OrgAINumber == AttachDetails.AttachTrain)
{
if (otherTrain.AtStation)
{
AttachDetails.ReadyToAttach = true;
}
{
AttachDetails.ReadyToAttach = true;
}
else if (otherTrain.MovementState == AI_MOVEMENT_STATE.AI_STATIC && otherTrain.ActivateTime != null)
{
AttachDetails.ReadyToAttach = true;
}
{
AttachDetails.ReadyToAttach = true;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Orts.Simulation/Simulation/Turntables.cs
Expand Up @@ -874,7 +874,7 @@ public override bool CheckMovingTableAligned(Train train, bool forward)
/// <summary>
/// Check if train position is on turntable track section
/// </summary>

public bool CheckOnSection(Traveller trainPosition)
{
bool onTable = false;
Expand Down
28 changes: 14 additions & 14 deletions Source/RunActivity/Viewer3D/Shapes.cs
Expand Up @@ -1800,7 +1800,7 @@ public override void Draw(GraphicsDevice graphicsDevice)
graphicsDevice.SetVertexBuffers(VertexBufferBindings);
if (IndexBuffer != null)
{
graphicsDevice.Indices = IndexBuffer;
graphicsDevice.Indices = IndexBuffer;
graphicsDevice.DrawIndexedPrimitives(PrimitiveType, baseVertex: 0, startIndex: PrimitiveOffset, primitiveCount: PrimitiveCount);
}
else
Expand Down Expand Up @@ -2596,8 +2596,8 @@ public void PrepareFrame(RenderFrame frame, WorldPosition location, Matrix[] ani
else
{
// .s lod-ding is based on distance levels
while ((displayDetailLevel > 0) && Viewer.Camera.InRange(mstsLocation, lodControl.DistanceLevels[displayDetailLevel - 1].ViewSphereRadius, lodControl.DistanceLevels[displayDetailLevel - 1].ViewingDistance * lodBias))
displayDetailLevel--;
while ((displayDetailLevel > 0) && Viewer.Camera.InRange(mstsLocation, lodControl.DistanceLevels[displayDetailLevel - 1].ViewSphereRadius, lodControl.DistanceLevels[displayDetailLevel - 1].ViewingDistance * lodBias))
displayDetailLevel--;
}
}

Expand Down Expand Up @@ -2644,12 +2644,12 @@ public virtual Matrix SetRenderMatrices(ShapePrimitive shapePrimitive, Matrix[]
bones = null; // standard scenery material has no skin and bones
var xnaMatrix = Matrix.Identity;
var hi = shapePrimitive.HierarchyIndex;
while (hi >= 0 && hi < shapePrimitive.Hierarchy.Length)
{
Matrix.Multiply(ref xnaMatrix, ref animatedXNAMatrices[hi], out xnaMatrix);
hi = shapePrimitive.Hierarchy[hi];
}
Matrix.Multiply(ref xnaMatrix, ref xnaDTileTranslation, out xnaMatrix);
while (hi >= 0 && hi < shapePrimitive.Hierarchy.Length)
{
Matrix.Multiply(ref xnaMatrix, ref animatedXNAMatrices[hi], out xnaMatrix);
hi = shapePrimitive.Hierarchy[hi];
}
Matrix.Multiply(ref xnaMatrix, ref xnaDTileTranslation, out xnaMatrix);
return xnaMatrix;
}

Expand All @@ -2659,11 +2659,11 @@ public virtual Matrix GetMatrixProduct(int iNode)
Matrix matrix = Matrix.Identity;
if (h != null && h.Length > iNode)
{
while (iNode != -1)
{
matrix *= Matrices[iNode];
iNode = h[iNode];
}
while (iNode != -1)
{
matrix *= Matrices[iNode];
iNode = h[iNode];
}
}
return matrix;
}
Expand Down

0 comments on commit 17754dd

Please sign in to comment.