Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 40572df

Browse files
committed
Automatic merge of T1.5.1-947-g34e078c205 and 15 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 3ca0eb1: Blueprint/train car operations UI window - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #903 at 7af1f91: Downloading route content (Github, zip) - Pull request #912 at 6b9fca4: New Triple Valve Features Vol. 2 - Pull request #919 at 26cc6a8: Added mouse wheel support for controls which can be moved by pressing t… - Pull request #923 at fc1ac91: Add curve squeal to route - Pull request #924 at 6c2c3cd: Default Asset Improvements - Pull request #927 at a28da45: AI Train Power Supply/Lights Fix - Pull request #929 at a406a69: Add support for common circuit breaker variants - Pull request #938 at ebe8047: Fix Missing Initializations From Copy in MSTSWagon.cs
17 parents 17e3f48 + 34e078c + dfc715e + d00beb9 + f92de76 + 3ca0eb1 + 6c0785b + 1f5ba4c + 5866028 + 7af1f91 + 6b9fca4 + 26cc6a8 + fc1ac91 + 6c2c3cd + a28da45 + a406a69 + ebe8047 commit 40572df

35 files changed

+453
-4100
lines changed

Source/3rdPartyLibs/glTFLoader/Build_Instructions.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

Source/3rdPartyLibs/glTFLoader/extras.schema.json

Lines changed: 0 additions & 13 deletions
This file was deleted.
-62.5 KB
Binary file not shown.

Source/ORTS.Common/ConsistGenerator.cs

Lines changed: 0 additions & 168 deletions
This file was deleted.

Source/ORTS.Settings/UserSettings.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,6 @@ public enum DirectXFeature
205205
public int DayAmbientLight { get; set; }
206206
[Default(AntiAliasingMethod.MSAA2x)]
207207
public int AntiAliasing { get; set; }
208-
[Default(false)]
209-
public bool GltfAnimations { get; set; }
210-
[Default(true)]
211-
public bool GltfTangentsAlwaysCalculatedPerPixel { get; set; }
212208

213209
// Simulation settings:
214210

Source/Orts.Formats.Msts/ConsistFile.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ public ConsistFile(string filePath)
3939
Name = Train.TrainCfg.Name;
4040
}
4141

42-
/// <summary>
43-
/// Allows to use a procedurally generated consist file.
44-
/// </summary>
45-
public ConsistFile(Stream inputStream, string filePath)
46-
{
47-
using (var stf = new STFReader(inputStream, filePath, System.Text.Encoding.UTF8, false))
48-
stf.ParseFile(new STFReader.TokenProcessor[] {
49-
new STFReader.TokenProcessor("train", ()=>{ Train = new Train_Config(stf); }),
50-
});
51-
}
52-
5342
public override string ToString()
5443
{
5544
return Name;

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4990,7 +4990,6 @@ public void ToggleCabRadio( bool newState)
49904990
public void ToggleWipers(bool newState)
49914991
{
49924992
SignalEvent(newState ? Event.WiperOn : Event.WiperOff);
4993-
if (ConsistGenerator.GltfVisualTestRun) Train.SignalEvent(newState ? Event.WiperOn : Event.WiperOff);
49944993
}
49954994

49964995
public void SetBailOff(bool bailOff)
@@ -5058,14 +5057,12 @@ public void GenericItem1Toggle()
50585057
{
50595058
GenericItem1 = !GenericItem1;
50605059
SignalEvent(GenericItem1? Event.GenericItem1On : Event.GenericItem1Off); // hook for sound trigger
5061-
if (ConsistGenerator.GltfVisualTestRun) Train.SignalEvent(GenericItem1 ? Event.GenericItem1On : Event.GenericItem1Off);
50625060
}
50635061

50645062
public void GenericItem2Toggle()
50655063
{
50665064
GenericItem2 = !GenericItem2;
50675065
SignalEvent(GenericItem2 ? Event.GenericItem2On : Event.GenericItem2Off); // hook for sound trigger
5068-
if (ConsistGenerator.GltfVisualTestRun) Train.SignalEvent(GenericItem2 ? Event.GenericItem2On : Event.GenericItem2Off);
50695066
}
50705067

50715068
public override bool GetCabFlipped()
@@ -5148,10 +5145,6 @@ public override void SignalEvent(Event evt)
51485145
}
51495146
break;
51505147
}
5151-
case Event.GenericItem1On: if (ConsistGenerator.GltfVisualTestRun) GenericItem1 = true; break;
5152-
case Event.GenericItem1Off: if (ConsistGenerator.GltfVisualTestRun) GenericItem1 = false; break;
5153-
case Event.GenericItem2On: if (ConsistGenerator.GltfVisualTestRun) GenericItem2 = true; break;
5154-
case Event.GenericItem2Off: if (ConsistGenerator.GltfVisualTestRun) GenericItem2 = false; break;
51555148
}
51565149

51575150
base.SignalEvent(evt);

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,7 @@ public virtual void LoadFromWagFile(string wagFilePath)
430430
if (File.Exists(orFile))
431431
wagFilePath = orFile;
432432

433-
using (STFReader stf = ConsistGenerator.IsWagonRecognized(wagFilePath)
434-
? new STFReader(ConsistGenerator.GetWagon(wagFilePath), wagFilePath, System.Text.Encoding.UTF8, true)
435-
: new STFReader(wagFilePath, true))
433+
using (STFReader stf = new STFReader(wagFilePath, true))
436434
{
437435
while (!stf.Eof)
438436
{
@@ -3048,7 +3046,7 @@ private void UpdateWheelBearingTemperature(float elapsedClockSeconds)
30483046
private void UpdateWindForce()
30493047
{
30503048
// Calculate compensation for wind
3051-
// There are two components due to wind -
3049+
// There are two components due to wind -
30523050
// Drag, impact of wind on train, will increase resistance when head on, will decrease resistance when acting as a tailwind.
30533051
// Lateral resistance - due to wheel flange being pushed against rail due to side wind.
30543052
// Calculation based upon information provided in AREA 1942 Proceedings - https://archive.org/details/proceedingsofann431942amer - pg 56
@@ -3060,7 +3058,7 @@ private void UpdateWindForce()
30603058
var directionRad = (float)Math.Atan2(WorldPosition.XNAMatrix.M13, WorldPosition.XNAMatrix.M11);
30613059
var directionDeg = MathHelper.ToDegrees(directionRad);
30623060

3063-
// If car is flipped, then the car's direction will be reversed by 180 compared to the rest of the train, and thus for calculation purposes only,
3061+
// If car is flipped, then the car's direction will be reversed by 180 compared to the rest of the train, and thus for calculation purposes only,
30643062
// it is necessary to reverse the "assumed" direction of the car back again. This shouldn't impact the visual appearance of the car.
30653063
if (Flipped)
30663064
{
@@ -3070,12 +3068,12 @@ private void UpdateWindForce()
30703068
// If this results in an angle greater then 360, then convert it back to an angle between 0 & 360.
30713069
if (directionDeg > 360)
30723070
directionDeg -= 360;
3073-
}
3071+
}
30743072

30753073
// If a westerly direction (ie -ve) convert to an angle between 0 and 360
30763074
if (directionDeg < 0)
30773075
directionDeg += 360;
3078-
3076+
30793077
// Find angle between wind and direction of train
30803078
var resultantWindComponentDeg = 0.0f;
30813079
if (Train.PhysicsWindDirectionDeg > directionDeg)
@@ -3097,7 +3095,7 @@ private void UpdateWindForce()
30973095
var windResultantSpeedMpS = (float)Math.Sqrt(AbsSpeedMpS * AbsSpeedMpS + Train.PhysicsWindSpeedMpS * Train.PhysicsWindSpeedMpS + 2.0f * AbsSpeedMpS * Train.PhysicsWindSpeedMpS * (float)Math.Cos(resultantWindComponentRad));
30983096

30993097
// Calculate Drag Resistance
3100-
// The drag resistance will be the difference between the STILL firction calculated using the standard Davies equation,
3098+
// The drag resistance will be the difference between the STILL firction calculated using the standard Davies equation,
31013099
// and that produced using the wind resultant speed (combination of wind speed and train speed)
31023100
var tempStillDragResistanceForceN = AbsSpeedMpS * AbsSpeedMpS * DavisCNSSpMM;
31033101
var tempCombinedDragResistanceForceN = windResultantSpeedMpS * windResultantSpeedMpS * DavisCNSSpMM; // R3 of Davis formula taking into account wind
@@ -3107,7 +3105,7 @@ private void UpdateWindForce()
31073105
// This difference will be added or subtracted from the overall friction force depending upon the estimated wind direction.
31083106
if (tempCombinedDragResistanceForceN > tempStillDragResistanceForceN)
31093107
{
3110-
// Wind typically headon to train - increase resistance - +ve differential
3108+
// Wind typically headon to train - increase resistance - +ve differential
31113109
windDragResistanceForceN = tempCombinedDragResistanceForceN - tempStillDragResistanceForceN;
31123110
}
31133111
else

Source/Orts.Simulation/Simulation/RollingStocks/RollingStock.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using Orts.Parsers.Msts;
2020
using Orts.Simulation.Physics;
2121
using Orts.Simulation.RollingStocks.SubSystems;
22-
using ORTS.Common;
2322
using System;
2423
using System.Collections.Generic;
2524
using System.Diagnostics;
@@ -139,9 +138,7 @@ public GenericWAGFile(string filenamewithpath)
139138

140139
public void WagFile(string filenamewithpath)
141140
{
142-
using (STFReader stf = ConsistGenerator.IsWagonRecognized(filenamewithpath)
143-
? new STFReader(ConsistGenerator.GetWagon(filenamewithpath), filenamewithpath, System.Text.Encoding.UTF8, false)
144-
: new STFReader(filenamewithpath, false))
141+
using (STFReader stf = new STFReader(filenamewithpath, false))
145142
stf.ParseBlock(new STFReader.TokenProcessor[] {
146143
new STFReader.TokenProcessor("engine", ()=>{ Engine = new EngineClass(stf); }),
147144
new STFReader.TokenProcessor("_openrails", ()=>{ OpenRails = new OpenRailsData(stf); }),

Source/Orts.Simulation/Simulation/Simulator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ private Train InitializePlayerTrain()
13011301
// place rear of train on starting location of aiPath.
13021302
train.RearTDBTraveller = new Traveller(TSectionDat, TDB.TrackDB.TrackNodes, aiPath);
13031303

1304-
ConsistFile conFile = ConsistGenerator.IsConsistRecognized(conFileName) ? new ConsistFile(ConsistGenerator.GetConsist(conFileName), conFileName) : new ConsistFile(conFileName);
1304+
ConsistFile conFile = new ConsistFile(conFileName);
13051305
CurveDurability = conFile.Train.TrainCfg.Durability; // Finds curve durability of consist based upon the value in consist file
13061306
train.TcsParametersFileName = conFile.Train.TrainCfg.TcsParametersFileName;
13071307

@@ -1318,7 +1318,7 @@ private Train InitializePlayerTrain()
13181318
wagonFilePath = wagonFolder + @"\" + wagon.Name + ".eot";
13191319
}
13201320

1321-
if (!File.Exists(wagonFilePath) && !ConsistGenerator.IsWagonRecognized(wagonFilePath))
1321+
if (!File.Exists(wagonFilePath))
13221322
{
13231323
// First wagon is the player's loco and required, so issue a fatal error message
13241324
if (wagon == conFile.Train.TrainCfg.WagonList[0])

0 commit comments

Comments
 (0)