mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-17 22:39:17 +02:00
refactor: replace null with nullptr
This commit is contained in:
10
Console.cpp
10
Console.cpp
@@ -72,14 +72,14 @@ void SetLedState( unsigned char Code, bool bOn ) {
|
||||
int Console::iBits = 0; // zmienna statyczna - obiekt Console jest jednen wspólny
|
||||
int Console::iMode = 0;
|
||||
int Console::iConfig = 0;
|
||||
TPoKeys55 *Console::PoKeys55[2] = {NULL, NULL};
|
||||
TLPT *Console::LPT = NULL;
|
||||
TPoKeys55 *Console::PoKeys55[2] = {nullptr, nullptr};
|
||||
TLPT *Console::LPT = nullptr;
|
||||
int Console::iSwitch[8]; // bistabilne w kabinie, załączane z [Shift], wyłączane bez
|
||||
int Console::iButton[8]; // monostabilne w kabinie, załączane podczas trzymania klawisza
|
||||
|
||||
Console::Console()
|
||||
{
|
||||
PoKeys55[0] = PoKeys55[1] = NULL;
|
||||
PoKeys55[0] = PoKeys55[1] = nullptr;
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{ // zerowanie przełączników
|
||||
iSwitch[i] = 0; // bity 0..127 - bez [Ctrl], 128..255 - z [Ctrl]
|
||||
@@ -118,7 +118,7 @@ int Console::On()
|
||||
else
|
||||
{ // połączenie nie wyszło, ma być NULL
|
||||
delete LPT;
|
||||
LPT = NULL;
|
||||
LPT = nullptr;
|
||||
}
|
||||
break;
|
||||
case 4: // PoKeys
|
||||
@@ -131,7 +131,7 @@ int Console::On()
|
||||
else
|
||||
{ // połączenie nie wyszło, ma być NULL
|
||||
delete PoKeys55[0];
|
||||
PoKeys55[0] = NULL;
|
||||
PoKeys55[0] = nullptr;
|
||||
WriteLog("PoKeys not found!");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -76,13 +76,13 @@ bool TPoKeys55::Connect()
|
||||
// First populate a list of plugged in devices (by specifying "DIGCF_PRESENT"), which are of the
|
||||
// specified class GUID.
|
||||
DeviceInfoTable =
|
||||
SetupDiGetClassDevs(&InterfaceClassGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
|
||||
SetupDiGetClassDevs(&InterfaceClassGuid, nullptr, nullptr, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
|
||||
// Now look through the list we just populated. We are trying to see if any of them match our
|
||||
// device.
|
||||
while (true)
|
||||
{
|
||||
InterfaceDataStructure->cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
|
||||
if (SetupDiEnumDeviceInterfaces(DeviceInfoTable, NULL, &InterfaceClassGuid, InterfaceIndex,
|
||||
if (SetupDiEnumDeviceInterfaces(DeviceInfoTable, nullptr, &InterfaceClassGuid, InterfaceIndex,
|
||||
InterfaceDataStructure))
|
||||
{
|
||||
ErrorStatus = GetLastError();
|
||||
@@ -113,11 +113,11 @@ bool TPoKeys55::Connect()
|
||||
// First query for the size of the hardware ID, so we can know how big a buffer to allocate
|
||||
// for the data.
|
||||
SetupDiGetDeviceRegistryProperty(DeviceInfoTable, &DevInfoData, SPDRP_HARDWAREID,
|
||||
&dwRegType, NULL, 0, &dwRegSize);
|
||||
&dwRegType, nullptr, 0, &dwRegSize);
|
||||
// Allocate a buffer for the hardware ID.
|
||||
// PropertyValueBuffer=(BYTE*)malloc(dwRegSize);
|
||||
PropertyValueBuffer = new BYTE[dwRegSize];
|
||||
if (PropertyValueBuffer == NULL) // if null,error,couldn't allocate enough memory
|
||||
if (PropertyValueBuffer == nullptr) // if null,error,couldn't allocate enough memory
|
||||
{ // Can't really recover from this situation,just exit instead.
|
||||
// ShowMessage("Allocation PropertyValueBuffer impossible");
|
||||
SetupDiDestroyDeviceInfoList(
|
||||
@@ -132,7 +132,7 @@ bool TPoKeys55::Connect()
|
||||
// and PID,in the example
|
||||
// format "Vid_04d8&Pid_003f".
|
||||
SetupDiGetDeviceRegistryProperty(DeviceInfoTable, &DevInfoData, SPDRP_HARDWAREID,
|
||||
&dwRegType, PropertyValueBuffer, dwRegSize, NULL);
|
||||
&dwRegType, PropertyValueBuffer, dwRegSize, nullptr);
|
||||
// Now check if the first string in the hardware ID matches the device ID of my USB device.
|
||||
// ListBox1->Items->Add((char*)PropertyValueBuffer);
|
||||
DeviceIDFromRegistry = reinterpret_cast<char*>(PropertyValueBuffer);
|
||||
@@ -157,12 +157,11 @@ bool TPoKeys55::Connect()
|
||||
// get the structure (after we have allocated enough memory for the structure.)
|
||||
DetailedInterfaceDataStructure->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
|
||||
// First call populates "StructureSize" with the correct value
|
||||
SetupDiGetDeviceInterfaceDetail(DeviceInfoTable, InterfaceDataStructure, NULL, 0,
|
||||
&StructureSize, NULL);
|
||||
SetupDiGetDeviceInterfaceDetail(DeviceInfoTable, InterfaceDataStructure, nullptr, 0,
|
||||
&StructureSize, nullptr);
|
||||
DetailedInterfaceDataStructure =
|
||||
(PSP_DEVICE_INTERFACE_DETAIL_DATA)(malloc(StructureSize)); // Allocate enough memory
|
||||
if (DetailedInterfaceDataStructure ==
|
||||
NULL) // if null,error,couldn't allocate enough memory
|
||||
if (DetailedInterfaceDataStructure == nullptr) // if null,error,couldn't allocate enough memory
|
||||
{ // Can't really recover from this situation,just exit instead.
|
||||
SetupDiDestroyDeviceInfoList(
|
||||
DeviceInfoTable); // Clean up the old structure we no longer need.
|
||||
@@ -171,19 +170,18 @@ bool TPoKeys55::Connect()
|
||||
DetailedInterfaceDataStructure->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
|
||||
// Now call SetupDiGetDeviceInterfaceDetail() a second time to receive the goods.
|
||||
SetupDiGetDeviceInterfaceDetail(DeviceInfoTable, InterfaceDataStructure,
|
||||
DetailedInterfaceDataStructure, StructureSize, NULL,
|
||||
NULL);
|
||||
DetailedInterfaceDataStructure, StructureSize, nullptr, nullptr);
|
||||
// We now have the proper device path,and we can finally open read and write handles to
|
||||
// the device.
|
||||
// We store the handles in the global variables "WriteHandle" and "ReadHandle",which we
|
||||
// will use later to actually communicate.
|
||||
WriteHandle = CreateFile((DetailedInterfaceDataStructure->DevicePath), GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, 0);
|
||||
ErrorStatus = GetLastError();
|
||||
// if (ErrorStatus==ERROR_SUCCESS)
|
||||
// ToggleLedBtn->Enabled=true;//Make button no longer greyed out
|
||||
ReadHandle = CreateFile((DetailedInterfaceDataStructure->DevicePath), GENERIC_READ,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, 0);
|
||||
ErrorStatus = GetLastError();
|
||||
if (ErrorStatus == ERROR_SUCCESS)
|
||||
{
|
||||
|
||||
@@ -536,7 +536,7 @@ TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit,
|
||||
{
|
||||
Couplers[b].AllowedFlag = 3; // domyślnie hak i hamulec, inne trzeba włączyć jawnie w FIZ
|
||||
Couplers[b].CouplingFlag = 0;
|
||||
Couplers[b].Connected = NULL;
|
||||
Couplers[b].Connected = nullptr;
|
||||
Couplers[b].ConnectedNr = 0; // Ra: to nie ma znaczenia jak nie podłączony
|
||||
Couplers[b].Render = false;
|
||||
Couplers[b].CForce = 0.0;
|
||||
@@ -4630,7 +4630,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
|
||||
LocBrakePress = LocHandle->GetCP();
|
||||
for (int b = 0; b < 2; b++)
|
||||
if (((TrainType & (dt_ET41 | dt_ET42)) != 0) && (Couplers[b].Connected != NULL)) // nie podoba mi się to rozwiązanie, chyba trzeba
|
||||
if (((TrainType & (dt_ET41 | dt_ET42)) != 0) && (Couplers[b].Connected != nullptr)) // nie podoba mi się to rozwiązanie, chyba trzeba
|
||||
// dodać jakiś wpis do fizyki na to
|
||||
if (((Couplers[b].Connected->TrainType & (dt_ET41 | dt_ET42)) != 0) && ((Couplers[b].CouplingFlag & 36) == 36))
|
||||
LocBrakePress = std::max(Couplers[b].Connected->LocHandle->GetCP(), LocBrakePress);
|
||||
@@ -4779,7 +4779,7 @@ void TMoverParameters::UpdateScndPipePressure(double dt)
|
||||
dv2 = 0;
|
||||
|
||||
// sprzeg 1
|
||||
if (Couplers[0].Connected != NULL)
|
||||
if (Couplers[0].Connected != nullptr)
|
||||
if (TestFlag(Couplers[0].CouplingFlag, ctrain_scndpneumatic))
|
||||
{
|
||||
c = Couplers[0].Connected; // skrot
|
||||
@@ -4789,7 +4789,7 @@ void TMoverParameters::UpdateScndPipePressure(double dt)
|
||||
c->Pipe2->Flow(-dv1);
|
||||
}
|
||||
// sprzeg 2
|
||||
if (Couplers[1].Connected != NULL)
|
||||
if (Couplers[1].Connected != nullptr)
|
||||
if (TestFlag(Couplers[1].CouplingFlag, ctrain_scndpneumatic))
|
||||
{
|
||||
c = Couplers[1].Connected; // skrot
|
||||
@@ -4798,7 +4798,7 @@ void TMoverParameters::UpdateScndPipePressure(double dt)
|
||||
c->switch_physics(true);
|
||||
c->Pipe2->Flow(-dv2);
|
||||
}
|
||||
if ((Couplers[1].Connected != NULL) && (Couplers[0].Connected != NULL))
|
||||
if ((Couplers[1].Connected != nullptr) && (Couplers[0].Connected != nullptr))
|
||||
if ((TestFlag(Couplers[0].CouplingFlag, ctrain_scndpneumatic)) && (TestFlag(Couplers[1].CouplingFlag, ctrain_scndpneumatic)))
|
||||
{
|
||||
dV = 0.00025 * dt * PF(Couplers[0].Connected->ScndPipePress, Couplers[1].Connected->ScndPipePress, Spz * 0.25);
|
||||
@@ -4869,7 +4869,7 @@ double TMoverParameters::GetDVc(double dt)
|
||||
dv1 = 0;
|
||||
dv2 = 0;
|
||||
// sprzeg 1
|
||||
if (Couplers[0].Connected != NULL)
|
||||
if (Couplers[0].Connected != nullptr)
|
||||
if (TestFlag(Couplers[0].CouplingFlag, ctrain_pneumatic))
|
||||
{ //*0.85
|
||||
c = Couplers[0].Connected; // skrot //0.08 //e/D * L/D = e/D^2 * L
|
||||
@@ -4879,7 +4879,7 @@ double TMoverParameters::GetDVc(double dt)
|
||||
c->Pipe->Flow(-dv1);
|
||||
}
|
||||
// sprzeg 2
|
||||
if (Couplers[1].Connected != NULL)
|
||||
if (Couplers[1].Connected != nullptr)
|
||||
if (TestFlag(Couplers[1].CouplingFlag, ctrain_pneumatic))
|
||||
{
|
||||
c = Couplers[1].Connected; // skrot
|
||||
|
||||
@@ -1086,7 +1086,7 @@ void eu07_application::init_files()
|
||||
#ifdef _WIN32
|
||||
DeleteFile("log.txt");
|
||||
DeleteFile("errors.txt");
|
||||
CreateDirectory("logs", NULL);
|
||||
CreateDirectory("logs", nullptr);
|
||||
#elif __unix__
|
||||
unlink("log.txt");
|
||||
unlink("errors.txt");
|
||||
|
||||
@@ -34,7 +34,7 @@ openal_buffer::openal_buffer( std::string const &Filename ) :
|
||||
if (sf == nullptr)
|
||||
throw std::runtime_error("sound: sf_open failed");
|
||||
|
||||
sf_command(sf, SFC_SET_NORM_FLOAT, NULL, SF_TRUE);
|
||||
sf_command(sf, SFC_SET_NORM_FLOAT, nullptr, SF_TRUE);
|
||||
|
||||
float *fbuf = new float[si.frames * si.channels];
|
||||
if (sf_readf_float(sf, fbuf, si.frames) != si.frames)
|
||||
|
||||
@@ -46,7 +46,7 @@ piped_proc::piped_proc(std::string cmd, bool write)
|
||||
|
||||
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
saAttr.bInheritHandle = TRUE;
|
||||
saAttr.lpSecurityDescriptor = NULL;
|
||||
saAttr.lpSecurityDescriptor = nullptr;
|
||||
|
||||
if (!CreatePipe(&pipe_rd, &pipe_wr, &saAttr, 0)) {
|
||||
ErrorLog("piped_proc: CreatePipe failed!");
|
||||
@@ -66,7 +66,7 @@ piped_proc::piped_proc(std::string cmd, bool write)
|
||||
siStartInfo.hStdInput = pipe_rd;
|
||||
siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
|
||||
|
||||
if (!CreateProcessA(NULL, (char*)cmd.c_str(), NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &siStartInfo, &process)) {
|
||||
if (!CreateProcessA(nullptr, (char*)cmd.c_str(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW, nullptr, nullptr, &siStartInfo, &process)) {
|
||||
ErrorLog("piped_proc: CreateProcess failed!");
|
||||
return;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ size_t piped_proc::read(unsigned char *buf, size_t len)
|
||||
return 0;
|
||||
|
||||
DWORD read = 0;
|
||||
BOOL ret = ReadFile(pipe_rd, buf, len, &read, NULL);
|
||||
BOOL ret = ReadFile(pipe_rd, buf, len, &read, nullptr);
|
||||
|
||||
return read;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ size_t piped_proc::write(unsigned char *buf, size_t len)
|
||||
return 0;
|
||||
|
||||
DWORD wrote = 0;
|
||||
BOOL ret = WriteFile(pipe_wr, buf, len, &wrote, NULL);
|
||||
BOOL ret = WriteFile(pipe_wr, buf, len, &wrote, nullptr);
|
||||
|
||||
return wrote;
|
||||
}
|
||||
|
||||
@@ -36,16 +36,16 @@ TAnimContainer::TAnimContainer()
|
||||
vTranslateTo = glm::dvec3(0.0, 0.0, 0.0); // docelowe przesunięcie
|
||||
fTranslateSpeed = 0.0;
|
||||
fAngleSpeed = 0.0;
|
||||
pSubModel = NULL;
|
||||
pSubModel = nullptr;
|
||||
iAnim = 0; // położenie początkowe
|
||||
evDone = NULL; // powiadamianie o zakończeniu animacji
|
||||
evDone = nullptr; // powiadamianie o zakończeniu animacji
|
||||
}
|
||||
|
||||
bool TAnimContainer::Init(TSubModel *pNewSubModel)
|
||||
{
|
||||
fRotateSpeed = 0.0f;
|
||||
pSubModel = pNewSubModel;
|
||||
return (pSubModel != NULL);
|
||||
return (pSubModel != nullptr);
|
||||
}
|
||||
|
||||
void TAnimContainer::SetRotateAnim(glm::vec3 vNewRotateAngles, double fNewRotateSpeed)
|
||||
|
||||
@@ -30,7 +30,7 @@ using namespace Mtable;
|
||||
|
||||
float TSubModel::fSquareDist = 0.f;
|
||||
std::uintptr_t TSubModel::iInstance; // numer renderowanego egzemplarza obiektu
|
||||
texture_handle const *TSubModel::ReplacableSkinId = NULL;
|
||||
texture_handle const *TSubModel::ReplacableSkinId = nullptr;
|
||||
int TSubModel::iAlpha = 0x30300030; // maska do testowania flag tekstur wymiennych
|
||||
TModel3d *TSubModel::pRoot; // Ra: tymczasowo wskaźnik na model widoczny z submodelu
|
||||
std::string *TSubModel::pasText;
|
||||
@@ -1116,7 +1116,7 @@ TSubModel *TSubModel::GetFromName(std::string const &search, bool i)
|
||||
if (result)
|
||||
return result;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
// WORD hbIndices[18]={3,0,1,5,4,2,1,0,4,1,5,3,2,3,5,2,4,0};
|
||||
|
||||
@@ -41,9 +41,9 @@ int AirCoupler::GetStatus()
|
||||
*/
|
||||
void AirCoupler::Clear()
|
||||
{
|
||||
ModelOn = NULL;
|
||||
ModelOff = NULL;
|
||||
ModelxOn = NULL;
|
||||
ModelOn = nullptr;
|
||||
ModelOff = nullptr;
|
||||
ModelxOn = nullptr;
|
||||
On = false;
|
||||
xOn = false;
|
||||
}
|
||||
@@ -73,9 +73,9 @@ void AirCoupler::Load(cParser *Parser, TModel3d *Model)
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelOn = NULL;
|
||||
ModelxOn = NULL;
|
||||
ModelOff = NULL;
|
||||
ModelOn = nullptr;
|
||||
ModelxOn = nullptr;
|
||||
ModelOff = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ void TSpeedPos::Clear()
|
||||
fSectionVelocityDist = 0.0; //brak długości
|
||||
fDist = 0.0;
|
||||
vPos = glm::dvec3(0, 0, 0);
|
||||
trTrack = NULL; // brak wskaźnika
|
||||
trTrack = nullptr; // brak wskaźnika
|
||||
};
|
||||
|
||||
void TSpeedPos::CommandCheck()
|
||||
@@ -1918,7 +1918,7 @@ TController::TController(bool AI, TDynamicObject *NewControll, bool InitPsyche,
|
||||
|
||||
if( WriteLogFlag ) {
|
||||
#ifdef _WIN32
|
||||
CreateDirectory( "physicslog", NULL );
|
||||
CreateDirectory( "physicslog", nullptr);
|
||||
#elif __unix__
|
||||
mkdir( "physicslog", 0744 );
|
||||
#endif
|
||||
|
||||
@@ -71,9 +71,27 @@ TextureTest( std::string const &Name ) {
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
void TAnimPant::common_pantograph_settings()
|
||||
{ // wspólne ustawienia, liczone po przypisaniu wymiarów ramion
|
||||
vPos = glm::dvec3(0, 0, 0);
|
||||
fAngleL0 = glm::radians(2.8547285515689267247882521833308);
|
||||
fAngleL = fAngleL0; // początkowy kąt dolnego ramienia
|
||||
fAngleU0 = acos((fLenL1 * cos(fAngleL) + fHoriz) / fLenU1); // górne ramię
|
||||
fAngleU = fAngleU0; // początkowy kąt
|
||||
PantWys = fLenL1 * sin(fAngleL) + fLenU1 * sin(fAngleU) + fHeight; // wysokość początkowa
|
||||
PantTraction = PantWys;
|
||||
hvPowerWire = nullptr;
|
||||
fWidthExtra = 0.381f; //(2.032m-1.027)/2
|
||||
// poza obszarem roboczym jest aproksymacja łamaną o 5 odcinkach
|
||||
fHeightExtra[0] = 0.0f; //+0.0762
|
||||
fHeightExtra[1] = -0.01f; //+0.1524
|
||||
fHeightExtra[2] = -0.03f; //+0.2286
|
||||
fHeightExtra[3] = -0.07f; //+0.3048
|
||||
fHeightExtra[4] = -0.15f; //+0.3810
|
||||
}
|
||||
|
||||
void TAnimPant::AKP_4E()
|
||||
{ // ustawienie wymiarów dla pantografu AKP-4E
|
||||
vPos = glm::dvec3(0, 0, 0); // przypisanie domyśnych współczynników do pantografów
|
||||
fLenL1 = 1.22; // 1.176289 w modelach
|
||||
fLenU1 = 1.755; // 1.724482197 w modelach
|
||||
fHoriz = 0.535; // 0.54555075 przesunięcie ślizgu w długości pojazdu względem
|
||||
@@ -81,27 +99,10 @@ void TAnimPant::AKP_4E()
|
||||
// ramienia
|
||||
fHeight = 0.07; // wysokość ślizgu ponad oś obrotu
|
||||
fWidth = 0.635; // połowa szerokości ślizgu, 0.635 dla AKP-1 i AKP-4E
|
||||
fAngleL0 = glm::radians(2.8547285515689267247882521833308);
|
||||
fAngleL = fAngleL0; // początkowy kąt dolnego ramienia
|
||||
// fAngleU0=acos((1.22*cos(fAngleL)+0.535)/1.755); //górne ramię
|
||||
fAngleU0 = acos((fLenL1 * cos(fAngleL) + fHoriz) / fLenU1); // górne ramię
|
||||
fAngleU = fAngleU0; // początkowy kąt
|
||||
// PantWys=1.22*sin(fAngleL)+1.755*sin(fAngleU); //wysokość początkowa
|
||||
PantWys = fLenL1 * sin(fAngleL) + fLenU1 * sin(fAngleU) + fHeight; // wysokość początkowa
|
||||
PantTraction = PantWys;
|
||||
hvPowerWire = NULL;
|
||||
fWidthExtra = 0.381f; //(2.032m-1.027)/2
|
||||
// poza obszarem roboczym jest aproksymacja łamaną o 5 odcinkach
|
||||
fHeightExtra[0] = 0.0f; //+0.0762
|
||||
fHeightExtra[1] = -0.01f; //+0.1524
|
||||
fHeightExtra[2] = -0.03f; //+0.2286
|
||||
fHeightExtra[3] = -0.07f; //+0.3048
|
||||
fHeightExtra[4] = -0.15f; //+0.3810
|
||||
common_pantograph_settings();
|
||||
};
|
||||
void TAnimPant::WBL85()
|
||||
{ // ustawienie wymiarów dla pantografu WBL88
|
||||
vPos = glm::dvec3(0, 0, 0); // przypisanie domyśnych współczynników do pantografów
|
||||
|
||||
// mnozniki animacji ramion dla pantografu WBL88
|
||||
rd1rf = 1.f;
|
||||
rd2rf = 1.2;
|
||||
@@ -115,27 +116,10 @@ void TAnimPant::WBL85()
|
||||
// osi obrotu dolnego ramienia
|
||||
fHeight = 0.09353; // wysokość ślizgu ponad oś obrotu
|
||||
fWidth = 0.4969; // połowa szerokości ślizgu
|
||||
fAngleL0 = glm::radians(2.8547285515689267247882521833308);
|
||||
fAngleL = fAngleL0; // początkowy kąt dolnego ramienia
|
||||
// fAngleU0=acos((1.22*cos(fAngleL)+0.535)/1.755); //górne ramię
|
||||
fAngleU0 = acos((fLenL1 * cos(fAngleL) + fHoriz) / fLenU1); // górne ramię
|
||||
fAngleU = fAngleU0; // początkowy kąt
|
||||
// PantWys=1.22*sin(fAngleL)+1.755*sin(fAngleU); //wysokość początkowa
|
||||
PantWys = fLenL1 * sin(fAngleL) + fLenU1 * sin(fAngleU) + fHeight; // wysokość początkowa
|
||||
PantTraction = PantWys;
|
||||
hvPowerWire = NULL;
|
||||
fWidthExtra = 0.381f; //(2.032m-1.027)/2
|
||||
// poza obszarem roboczym jest aproksymacja łamaną o 5 odcinkach
|
||||
fHeightExtra[0] = 0.0f; //+0.0762
|
||||
fHeightExtra[1] = -0.01f; //+0.1524
|
||||
fHeightExtra[2] = -0.03f; //+0.2286
|
||||
fHeightExtra[3] = -0.07f; //+0.3048
|
||||
fHeightExtra[4] = -0.15f; //+0.3810
|
||||
common_pantograph_settings();
|
||||
};
|
||||
void TAnimPant::EC160_200()
|
||||
{ // ustawienie wymiarów dla pantografow EC160 lub EC200
|
||||
vPos = glm::dvec3(0, 0, 0); // przypisanie domyśnych współczynników do pantografów
|
||||
|
||||
// mnozniki animacji ramion dla pantografow EC160 lub EC200
|
||||
rd1rf = 1.f;
|
||||
rd2rf = 0.85;
|
||||
@@ -149,27 +133,10 @@ void TAnimPant::EC160_200()
|
||||
// osi obrotu dolnego ramienia
|
||||
fHeight = 0.09353; // wysokość ślizgu ponad oś obrotu
|
||||
fWidth = 0.4969; // połowa szerokości ślizgu
|
||||
fAngleL0 = glm::radians(2.8547285515689267247882521833308);
|
||||
fAngleL = fAngleL0; // początkowy kąt dolnego ramienia
|
||||
// fAngleU0=acos((1.22*cos(fAngleL)+0.535)/1.755); //górne ramię
|
||||
fAngleU0 = acos((fLenL1 * cos(fAngleL) + fHoriz) / fLenU1); // górne ramię
|
||||
fAngleU = fAngleU0; // początkowy kąt
|
||||
// PantWys=1.22*sin(fAngleL)+1.755*sin(fAngleU); //wysokość początkowa
|
||||
PantWys = fLenL1 * sin(fAngleL) + fLenU1 * sin(fAngleU) + fHeight; // wysokość początkowa
|
||||
PantTraction = PantWys;
|
||||
hvPowerWire = NULL;
|
||||
fWidthExtra = 0.381f; //(2.032m-1.027)/2
|
||||
// poza obszarem roboczym jest aproksymacja łamaną o 5 odcinkach
|
||||
fHeightExtra[0] = 0.0f; //+0.0762
|
||||
fHeightExtra[1] = -0.01f; //+0.1524
|
||||
fHeightExtra[2] = -0.03f; //+0.2286
|
||||
fHeightExtra[3] = -0.07f; //+0.3048
|
||||
fHeightExtra[4] = -0.15f; //+0.3810
|
||||
common_pantograph_settings();
|
||||
};
|
||||
void TAnimPant::DSAx()
|
||||
{ // ustawienie wymiarów dla pantografow z rodziny DSA
|
||||
vPos = glm::dvec3(0, 0, 0); // przypisanie domyśnych współczynników do pantografów
|
||||
|
||||
// mnozniki animacji ramion dla pantografow z rodziny DSA
|
||||
rd1rf = 1.f;
|
||||
rd2rf = 1.025;
|
||||
@@ -183,22 +150,7 @@ void TAnimPant::DSAx()
|
||||
// osi obrotu dolnego ramienia
|
||||
fHeight = 0.09353; // wysokość ślizgu ponad oś obrotu
|
||||
fWidth = 0.4969; // połowa szerokości ślizgu
|
||||
fAngleL0 = glm::radians(2.8547285515689267247882521833308);
|
||||
fAngleL = fAngleL0; // początkowy kąt dolnego ramienia
|
||||
// fAngleU0=acos((1.22*cos(fAngleL)+0.535)/1.755); //górne ramię
|
||||
fAngleU0 = acos((fLenL1 * cos(fAngleL) + fHoriz) / fLenU1); // górne ramię
|
||||
fAngleU = fAngleU0; // początkowy kąt
|
||||
// PantWys=1.22*sin(fAngleL)+1.755*sin(fAngleU); //wysokość początkowa
|
||||
PantWys = fLenL1 * sin(fAngleL) + fLenU1 * sin(fAngleU) + fHeight; // wysokość początkowa
|
||||
PantTraction = PantWys;
|
||||
hvPowerWire = NULL;
|
||||
fWidthExtra = 0.381f; //(2.032m-1.027)/2
|
||||
// poza obszarem roboczym jest aproksymacja łamaną o 5 odcinkach
|
||||
fHeightExtra[0] = 0.0f; //+0.0762
|
||||
fHeightExtra[1] = -0.01f; //+0.1524
|
||||
fHeightExtra[2] = -0.03f; //+0.2286
|
||||
fHeightExtra[3] = -0.07f; //+0.3048
|
||||
fHeightExtra[4] = -0.15f; //+0.3810
|
||||
common_pantograph_settings();
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
int TAnim::TypeSet(int i, TMoverParameters currentMover, int fl)
|
||||
@@ -218,7 +170,7 @@ int TAnim::TypeSet(int i, TMoverParameters currentMover, int fl)
|
||||
break; // 1-drzwi
|
||||
case 2:
|
||||
iFlags = 0x020;
|
||||
fParam = fl ? new float[fl] : NULL;
|
||||
fParam = fl ? new float[fl] : nullptr;
|
||||
iFlags += fl << 8;
|
||||
break; // 2-wahacz, dźwignia itp.
|
||||
case 3:
|
||||
@@ -389,7 +341,7 @@ TDynamicObject * TDynamicObject::FirstFind(int &coupler_nr, int cf)
|
||||
for (int i = 0; i < 300; i++) // ograniczenie do 300 na wypadek zapętlenia składu
|
||||
{
|
||||
if (!temp)
|
||||
return NULL; // Ra: zabezpieczenie przed ewentaulnymi błędami sprzęgów
|
||||
return nullptr; // Ra: zabezpieczenie przed ewentaulnymi błędami sprzęgów
|
||||
if ((temp->MoverParameters->Couplers[coupler_nr].CouplingFlag & cf) != cf)
|
||||
return temp; // nic nie ma już dalej podłączone sprzęgiem cf
|
||||
if (coupler_nr == end::front)
|
||||
@@ -415,7 +367,7 @@ TDynamicObject * TDynamicObject::FirstFind(int &coupler_nr, int cf)
|
||||
return temp; // jeśli jednak z tyłu nic nie ma
|
||||
}
|
||||
}
|
||||
return NULL; // to tylko po wyczerpaniu pętli
|
||||
return nullptr; // to tylko po wyczerpaniu pętli
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -1446,7 +1398,7 @@ TDynamicObject * TDynamicObject::ABuScanNearestObject(glm::vec3 pos, TTrack *Tra
|
||||
TDynamicObject *FoundedObj;
|
||||
FoundedObj =
|
||||
ABuFindNearestObject(pos, Track, this, CouplNr); // zwraca numer sprzęgu znalezionego pojazdu
|
||||
if (FoundedObj == NULL)
|
||||
if (FoundedObj == nullptr)
|
||||
{
|
||||
double ActDist; // Przeskanowana odleglosc.
|
||||
double CurrDist = 0; // Aktualna dlugosc toru.
|
||||
@@ -1478,11 +1430,11 @@ TDynamicObject * TDynamicObject::ABuScanNearestObject(glm::vec3 pos, TTrack *Tra
|
||||
ScanDir = -ScanDir;
|
||||
}
|
||||
}
|
||||
if (Track != NULL)
|
||||
if (Track != nullptr)
|
||||
{ // jesli jest kolejny odcinek toru
|
||||
CurrDist = Track->Length();
|
||||
FoundedObj = ABuFindNearestObject(pos, Track, this, CouplNr);
|
||||
if (FoundedObj != NULL)
|
||||
if (FoundedObj != nullptr)
|
||||
ActDist = ScanDist;
|
||||
}
|
||||
else // Jesli nie ma, to wychodzimy.
|
||||
@@ -1505,7 +1457,7 @@ void TDynamicObject::ABuBogies()
|
||||
{ // Obracanie wozkow na zakretach. Na razie
|
||||
// uwzględnia tylko zakręty,
|
||||
// bez zadnych gorek i innych przeszkod.
|
||||
if ((smBogie[0] != NULL) && (smBogie[1] != NULL))
|
||||
if ((smBogie[0] != nullptr) && (smBogie[1] != nullptr))
|
||||
{
|
||||
// modelRot.z=ABuAcos(Axle0.pPosition-Axle1.pPosition); //kąt obrotu pojazdu
|
||||
// [rad]
|
||||
@@ -1661,13 +1613,13 @@ int TDynamicObject::Dettach(int dir)
|
||||
TDynamicObject *d = this;
|
||||
while (d)
|
||||
{
|
||||
d->ctOwner = NULL; // usuwanie właściciela
|
||||
d->ctOwner = nullptr; // usuwanie właściciela
|
||||
d = d->Prev();
|
||||
}
|
||||
d = Next();
|
||||
while (d)
|
||||
{
|
||||
d->ctOwner = NULL; // usuwanie właściciela
|
||||
d->ctOwner = nullptr; // usuwanie właściciela
|
||||
d = d->Next(); // i w drugą stronę
|
||||
}
|
||||
}
|
||||
@@ -1872,8 +1824,8 @@ TDynamicObject::TDynamicObject() {
|
||||
vFront = vWorldFront;
|
||||
vLeft = vWorldLeft;
|
||||
iNumAxles = 0;
|
||||
MoverParameters = NULL;
|
||||
Mechanik = NULL;
|
||||
MoverParameters = nullptr;
|
||||
Mechanik = nullptr;
|
||||
MechInside = false;
|
||||
// McZapkie-270202
|
||||
Controller = AIdriver;
|
||||
@@ -1881,7 +1833,7 @@ TDynamicObject::TDynamicObject() {
|
||||
// NextConnected = PrevConnected = NULL;
|
||||
// NextConnectedNo = PrevConnectedNo = 2; // ABu: Numery sprzegow. 2=nie podłączony
|
||||
bEnabled = true;
|
||||
MyTrack = NULL;
|
||||
MyTrack = nullptr;
|
||||
// McZapkie-260202
|
||||
dWheelAngle[0] = 0.0;
|
||||
dWheelAngle[1] = 0.0;
|
||||
@@ -1889,19 +1841,19 @@ TDynamicObject::TDynamicObject() {
|
||||
// Winger 160204 - pantografy
|
||||
// PantVolume = 3.5;
|
||||
NoVoltTime = 0;
|
||||
mdModel = NULL;
|
||||
mdKabina = NULL;
|
||||
mdModel = nullptr;
|
||||
mdKabina = nullptr;
|
||||
// smWiazary[0]=smWiazary[1]=NULL;
|
||||
smWahacze[0] = smWahacze[1] = smWahacze[2] = smWahacze[3] = NULL;
|
||||
smWahacze[0] = smWahacze[1] = smWahacze[2] = smWahacze[3] = nullptr;
|
||||
fWahaczeAmp = 0;
|
||||
smBrakeMode = NULL;
|
||||
smLoadMode = NULL;
|
||||
mdLoad = NULL;
|
||||
mdLowPolyInt = NULL;
|
||||
smBrakeMode = nullptr;
|
||||
smLoadMode = nullptr;
|
||||
mdLoad = nullptr;
|
||||
mdLowPolyInt = nullptr;
|
||||
//smMechanik0 = smMechanik1 = NULL;
|
||||
smBuforLewy[0] = smBuforLewy[1] = NULL;
|
||||
smBuforPrawy[0] = smBuforPrawy[1] = NULL;
|
||||
smBogie[0] = smBogie[1] = NULL;
|
||||
smBuforLewy[0] = smBuforLewy[1] = nullptr;
|
||||
smBuforPrawy[0] = smBuforPrawy[1] = nullptr;
|
||||
smBogie[0] = smBogie[1] = nullptr;
|
||||
bogieRot[0] = bogieRot[1] = glm::dvec3(0, 0, 0);
|
||||
modelRot = glm::dvec3(0, 0, 0);
|
||||
cp1 = cp2 = sp1 = sp2 = 0;
|
||||
@@ -1915,16 +1867,16 @@ TDynamicObject::TDynamicObject() {
|
||||
// ustawienie liczby modeli animowanych podczas konstruowania obiektu a nie na 0
|
||||
// prowadzi prosto do wysypów jeśli źle zdefiniowane mmd
|
||||
iAnimations = 0; // na razie nie ma żadnego
|
||||
pAnimated = NULL;
|
||||
pAnimated = nullptr;
|
||||
fShade = 0.0; // standardowe oświetlenie na starcie
|
||||
iHornWarning = 1; // numer syreny do użycia po otrzymaniu sygnału do jazdy
|
||||
asDestination = "none"; // stojący nigdzie nie jedzie
|
||||
pValveGear = NULL; // Ra: tymczasowo
|
||||
pValveGear = nullptr; // Ra: tymczasowo
|
||||
iCabs = 0; // maski bitowe modeli kabin
|
||||
smBrakeSet = NULL; // nastawa hamulca (wajcha)
|
||||
smLoadSet = NULL; // nastawa ładunku (wajcha)
|
||||
smWiper = NULL; // wycieraczka (poniekąd też wajcha)
|
||||
ctOwner = NULL; // na początek niczyj
|
||||
smBrakeSet = nullptr; // nastawa hamulca (wajcha)
|
||||
smLoadSet = nullptr; // nastawa ładunku (wajcha)
|
||||
smWiper = nullptr; // wycieraczka (poniekąd też wajcha)
|
||||
ctOwner = nullptr; // na początek niczyj
|
||||
iOverheadMask = 0; // maska przydzielana przez AI pojazdom posiadającym
|
||||
// pantograf, aby wymuszały
|
||||
// jazdę bezprądową
|
||||
@@ -5246,8 +5198,8 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
std::string asFileName = asBaseDir + TypeName + ".mmd";
|
||||
std::string asAnimName;
|
||||
bool Stop_InternalData = false;
|
||||
pants = NULL; // wskaźnik pierwszego obiektu animującego dla pantografów
|
||||
wipers = NULL; // wskaznik pierwszego obiektu animujacego dla wycieraczek
|
||||
pants = nullptr; // wskaźnik pierwszego obiektu animującego dla pantografów
|
||||
wipers = nullptr; // wskaznik pierwszego obiektu animujacego dla wycieraczek
|
||||
{
|
||||
// preliminary check whether the file exists
|
||||
cParser parser( TypeName + ".mmd", cParser::buffer_FILE, asBaseDir );
|
||||
@@ -5507,7 +5459,7 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
// m(3)[1]=m[3][1]+0.054; //w górę o wysokość ślizgu (na razie tak)
|
||||
pants[i].fParamPants->vPos.z = m[3][0]; // przesunięcie w bok (asymetria)
|
||||
pants[i].fParamPants->vPos.y = m[3][1]; // przesunięcie w górę odczytane z modelu
|
||||
if ((sm = pants[i].smElement[0]->ChildGet()) != NULL)
|
||||
if ((sm = pants[i].smElement[0]->ChildGet()) != nullptr)
|
||||
{ // jeśli ma potomny, można policzyć długość (odległość potomnego od osi obrotu)
|
||||
m = float4x4(*sm->GetMatrix()); // wystarczyłby wskaźnik, nie trzeba kopiować
|
||||
// może trzeba: pobrać macierz dolnego ramienia, wyzerować przesunięcie, przemnożyć przez macierz górnego
|
||||
@@ -5521,7 +5473,7 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
// //normalnie ok. 0.05
|
||||
// pants[i].fParamPants->fAngleL0=pants[i].fParamPants->fAngleL;
|
||||
pants[i].fParamPants->fAngleL = pants[i].fParamPants->fAngleL0; // początkowy kąt dolnego ramienia
|
||||
if ((sm = sm->ChildGet()) != NULL)
|
||||
if ((sm = sm->ChildGet()) != nullptr)
|
||||
{ // jeśli dalej jest ślizg, można policzyć długość górnego ramienia
|
||||
m = float4x4(*sm->GetMatrix()); // wystarczyłby wskaźnik,
|
||||
// nie trzeba kopiować trzeba by uwzględnić macierz dolnego ramienia, żeby uzyskać kąt do poziomu...
|
||||
|
||||
@@ -113,7 +113,8 @@ class TAnimPant
|
||||
float rg1rf{1.f}; // mnoznik obrotu ramienia gornego 1
|
||||
float rg2rf{1.f}; // mnoznik obrotu ramienia gornego 2
|
||||
float slizgrf{1.f}; // mnoznik obrotu slizgacza
|
||||
void AKP_4E();
|
||||
void common_pantograph_settings();
|
||||
void AKP_4E();
|
||||
void WBL85();
|
||||
void DSAx();
|
||||
void EC160_200();
|
||||
|
||||
@@ -594,7 +594,7 @@ TTrain::TTrain()
|
||||
pMechOffset = glm::dvec3(0, 0, 0);
|
||||
fBlinkTimer = 0;
|
||||
fHaslerTimer = 0;
|
||||
DynamicSet(NULL); // ustawia wszystkie mv*
|
||||
DynamicSet(nullptr); // ustawia wszystkie mv*
|
||||
//-----
|
||||
pMechSittingPosition = glm::dvec3(0, 0, 0); // ABu: 180404
|
||||
fTachoTimer = 0.0; // włączenie skoków wskazań prędkościomierza
|
||||
@@ -647,7 +647,7 @@ bool TTrain::Init(TDynamicObject *NewDynamicObject, bool e3d)
|
||||
|
||||
DynamicSet(NewDynamicObject);
|
||||
if (!e3d)
|
||||
if (DynamicObject->Mechanik == NULL)
|
||||
if (DynamicObject->Mechanik == nullptr)
|
||||
return false;
|
||||
|
||||
DynamicObject->MechInside = true;
|
||||
@@ -10854,7 +10854,7 @@ void TTrain::DynamicSet(TDynamicObject *d)
|
||||
}
|
||||
|
||||
mvControlled = DynamicObject->FindPowered()->MoverParameters;
|
||||
mvSecond = NULL; // gdyby się nic nie znalazło
|
||||
mvSecond = nullptr; // gdyby się nic nie znalazło
|
||||
if (mvOccupied->Power > 1.0) // dwuczłonowe lub ukrotnienia, żeby nie szukać każdorazowo
|
||||
if (mvOccupied->Couplers[1].Connected ? mvOccupied->Couplers[1].AllowedFlag & coupling::control : false)
|
||||
{ // gdy jest człon od sprzęgu 1, a sprzęg łączony
|
||||
|
||||
@@ -43,7 +43,7 @@ const int iLewo3[4] = {1, 3, 2, 1}; // segmenty do skręcania w lewo
|
||||
const int iPrawo3[4] = {-2, -1, -3, -2}; // segmenty do skręcania w prawo
|
||||
const int iProsto3[4] = {1, -1, 2, 1}; // segmenty do jazdy prosto
|
||||
const int iEnds3[13] = {3, 0, 2, 1, 2, 0, -1, 1, 0, 2, 0, 3, 1}; // numer sąsiedniego toru na końcu segmentu "-1"
|
||||
TIsolated *TIsolated::pRoot = NULL;
|
||||
TIsolated *TIsolated::pRoot = nullptr;
|
||||
|
||||
TTrack::profiles_array TTrack::m_profiles;
|
||||
TTrack::profiles_map TTrack::m_profilesmap;
|
||||
@@ -1067,7 +1067,7 @@ bool TTrack::AddDynamicObject(TDynamicObject *Dynamic)
|
||||
// Ra: usunąć po upowszechnieniu się odcinków izolowanych
|
||||
if (iCategoryFlag & 0x100) // jeśli usuwaczek
|
||||
{
|
||||
Dynamic->MyTrack = NULL; // trzeba by to uzależnić od kierunku ruchu...
|
||||
Dynamic->MyTrack = nullptr; // trzeba by to uzależnić od kierunku ruchu...
|
||||
return true;
|
||||
}
|
||||
if( Global.iMultiplayer ) {
|
||||
@@ -1839,16 +1839,15 @@ bool TTrack::Switch(int i, float const t, float const d)
|
||||
{ // 0: rozłączenie sąsiednich torów od obrotnicy
|
||||
if (trPrev) // jeśli jest tor od Point1 obrotnicy
|
||||
if (iPrevDirection) // 0:dołączony Point1, 1:dołączony Point2
|
||||
trPrev->trNext = NULL; // rozłączamy od Point2
|
||||
trPrev->trNext = nullptr; // rozłączamy od Point2
|
||||
else
|
||||
trPrev->trPrev = NULL; // rozłączamy od Point1
|
||||
trPrev->trPrev = nullptr; // rozłączamy od Point1
|
||||
if (trNext) // jeśli jest tor od Point2 obrotnicy
|
||||
if (iNextDirection) // 0:dołączony Point1, 1:dołączony Point2
|
||||
trNext->trNext = NULL; // rozłączamy od Point2
|
||||
trNext->trNext = nullptr; // rozłączamy od Point2
|
||||
else
|
||||
trNext->trPrev = NULL; // rozłączamy od Point1
|
||||
trNext = trPrev =
|
||||
NULL; // na końcu rozłączamy obrotnicę (wkaźniki do sąsiadów już niepotrzebne)
|
||||
trNext->trPrev = nullptr; // rozłączamy od Point1
|
||||
trNext = trPrev = nullptr; // na końcu rozłączamy obrotnicę (wkaźniki do sąsiadów już niepotrzebne)
|
||||
fVelocity = 0.0; // AI, nie ruszaj się!
|
||||
if (SwitchExtension->pOwner)
|
||||
SwitchExtension->pOwner->RaTrackAnimAdd(this); // dodanie do listy animacyjnej
|
||||
@@ -1975,7 +1974,7 @@ void TTrack::RaAnimListAdd(TTrack *t)
|
||||
else
|
||||
{
|
||||
SwitchExtension->pNextAnim = t;
|
||||
t->SwitchExtension->pNextAnim = NULL; // nowo dodawany nie może mieć ogona
|
||||
t->SwitchExtension->pNextAnim = nullptr; // nowo dodawany nie może mieć ogona
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2155,10 +2154,10 @@ int TTrack::TestPoint(const glm::dvec3 *Point)
|
||||
switch (eType)
|
||||
{
|
||||
case tt_Normal: // zwykły odcinek
|
||||
if (trPrev == NULL)
|
||||
if (trPrev == nullptr)
|
||||
if (Equal(Segment->FastGetPoint_0(), Point))
|
||||
return 0;
|
||||
if (trNext == NULL)
|
||||
if (trNext == nullptr)
|
||||
if (Equal(Segment->FastGetPoint_1(), Point))
|
||||
return 1;
|
||||
break;
|
||||
@@ -2168,14 +2167,14 @@ int TTrack::TestPoint(const glm::dvec3 *Point)
|
||||
// Ra: TODO: jak się zmieni na bezpośrednie odwołania do segmentow zwrotnicy,
|
||||
// to się wykoleja, ponieważ trNext zależy od przełożenia
|
||||
Switch(0);
|
||||
if (trPrev == NULL)
|
||||
if (trPrev == nullptr)
|
||||
// if (Equal(SwitchExtension->Segments[0]->FastGetPoint_0(),Point))
|
||||
if (Equal(Segment->FastGetPoint_0(), Point))
|
||||
{
|
||||
Switch(state);
|
||||
return 2;
|
||||
}
|
||||
if (trNext == NULL)
|
||||
if (trNext == nullptr)
|
||||
// if (Equal(SwitchExtension->Segments[0]->FastGetPoint_1(),Point))
|
||||
if (Equal(Segment->FastGetPoint_1(), Point))
|
||||
{
|
||||
@@ -2183,14 +2182,14 @@ int TTrack::TestPoint(const glm::dvec3 *Point)
|
||||
return 3;
|
||||
}
|
||||
Switch(1); // można by się pozbyć tego przełączania
|
||||
if (trPrev == NULL) // Ra: z tym chyba nie potrzeba łączyć
|
||||
if (trPrev == nullptr) // Ra: z tym chyba nie potrzeba łączyć
|
||||
// if (Equal(SwitchExtension->Segments[1]->FastGetPoint_0(),Point))
|
||||
if (Equal(Segment->FastGetPoint_0(), Point))
|
||||
{
|
||||
Switch(state); // Switch(0);
|
||||
return 4;
|
||||
}
|
||||
if (trNext == NULL) // TODO: to zależy od przełożenia zwrotnicy
|
||||
if (trNext == nullptr) // TODO: to zależy od przełożenia zwrotnicy
|
||||
// if (Equal(SwitchExtension->Segments[1]->FastGetPoint_1(),Point))
|
||||
if (Equal(Segment->FastGetPoint_1(), Point))
|
||||
{
|
||||
@@ -2675,7 +2674,7 @@ TTrack * TTrack::Connected(int s, double &d) const
|
||||
d = -d;
|
||||
return SwitchExtension->pNexts[1];
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
// creates rail profile data for current track
|
||||
|
||||
@@ -74,7 +74,7 @@ TTrack * TTrackFollower::SetCurrentTrack(TTrack *pTrack, int end)
|
||||
}
|
||||
if ((end ? iSegment : -iSegment) < 0)
|
||||
fDirection = -fDirection; // wtórna zmiana
|
||||
pTrack->SwitchForced(abs(iSegment) - 1, NULL); // wybór zapamiętanego segmentu
|
||||
pTrack->SwitchForced(abs(iSegment) - 1, nullptr); // wybór zapamiętanego segmentu
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user