compressor governor lock tweaks, fuel pump cab indicator, optional offset for scenario clock

This commit is contained in:
tmj-fstate
2018-03-29 23:19:14 +02:00
parent 6ffced1d90
commit 1fd89923f6
8 changed files with 307 additions and 170 deletions

View File

@@ -10,6 +10,7 @@ http://mozilla.org/MPL/2.0/.
#include "stdafx.h"
#include "mtable.h"
#include "globals.h"
#include "world.h"
#include "utilities.h"
@@ -521,20 +522,21 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
// NextStationName:=TimeTable[1].StationName;
/* TTVmax:=TimeTable[1].vmax; */
}
if ((iPlus != 0)) // jeżeli jest przesunięcie rozkładu
auto const timeoffset { static_cast<int>( Global.ScenarioTimeOffset * 60 ) + iPlus };
if( timeoffset != 0.0 ) // jeżeli jest przesunięcie rozkładu
{
long i_end = StationCount + 1;
for (i = 1; i < i_end; ++i) // bez with, bo ciężko się przenosi na C++
{
if ((TimeTable[i].Ah >= 0))
{
time = iPlus + TimeTable[i].Ah * 60 + TimeTable[i].Am; // nowe minuty
time = clamp_circular( TimeTable[i].Ah * 60 + TimeTable[i].Am + timeoffset, 1440 ); // nowe minuty
TimeTable[i].Am = time % 60;
TimeTable[i].Ah = (time /*div*/ / 60) % 60;
}
if ((TimeTable[i].Dh >= 0))
{
time = iPlus + TimeTable[i].Dh * 60 + TimeTable[i].Dm; // nowe minuty
time = clamp_circular( TimeTable[i].Dh * 60 + TimeTable[i].Dm + timeoffset, 1440 ); // nowe minuty
TimeTable[i].Dm = time % 60;
TimeTable[i].Dh = (time /*div*/ / 60) % 60;
}