Skip to content

Commit f6f2e97

Browse files
committed
Added ESD_ORTSBellAnimationFPS in .sd file
1 parent 3db0718 commit f6f2e97

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Source/Orts.Formats.Msts/ShapeDescriptorFile.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public SDShape(STFReader stf)
6464
ESD_Bounding_Box = null;
6565
}),
6666
new STFReader.TokenProcessor("esd_ortssoundfilename", ()=>{ ESD_SoundFileName = stf.ReadStringBlock(null); }),
67+
new STFReader.TokenProcessor("esd_ortsbellanimationfps", ()=>{ ESD_BellAnimationFPS = stf.ReadFloatBlock(STFReader.UNITS.Frequency, null); }),
6768
});
6869
// TODO - some objects have no bounding box - ie JP2BillboardTree1.sd
6970
//if (ESD_Bounding_Box == null) throw new STFException(stf, "Missing ESD_Bound_Box statement");
@@ -75,6 +76,7 @@ public SDShape(STFReader stf)
7576
public bool ESD_Snapable;
7677
public bool ESD_SubObj;
7778
public string ESD_SoundFileName = "";
79+
public float ESD_BellAnimationFPS = 8;
7880
}
7981

8082
public class ESD_Bounding_Box

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
268268

269269
// Wipers and bell animation
270270
Wipers.UpdateLoop(Locomotive.Wiper, elapsedTime);
271-
Bell.UpdateLoop(Locomotive.Bell, elapsedTime, 8.0f);
271+
Bell.UpdateLoop(Locomotive.Bell, elapsedTime, TrainCarShape.SharedShape.BellAnimationFPS);
272272

273273
// Draw 2D CAB View - by GeorgeS
274274
if (Viewer.Camera.AttachedCar == this.MSTSWagon &&

Source/RunActivity/Viewer3D/Shapes.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,7 @@ public class SharedShape
13861386
public int RootSubObjectIndex = 0;
13871387
//public bool negativeBogie = false;
13881388
public string SoundFileName = "";
1389+
public float BellAnimationFPS = 8;
13891390

13901391

13911392
readonly Viewer Viewer;
@@ -1449,6 +1450,7 @@ void LoadContent()
14491450
if ((textureFlags & Helpers.TextureFlags.Night) != 0 && FilePath.Contains("\\trainset\\"))
14501451
textureFlags |= Helpers.TextureFlags.Underground;
14511452
SoundFileName = sdFile.shape.ESD_SoundFileName;
1453+
BellAnimationFPS = sdFile.shape.ESD_BellAnimationFPS;
14521454
}
14531455

14541456
var matrixCount = sFile.shape.matrices.Count;

0 commit comments

Comments
 (0)