16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 15:09:19 +02:00

Ostatnie poprawki init. Wyzerowanie macierzy liczby animacji.

This commit is contained in:
firleju
2016-11-08 19:37:02 +01:00
parent e90b7cfb25
commit 283973f773
3 changed files with 30 additions and 21 deletions

View File

@@ -1607,12 +1607,14 @@ TDynamicObject::TDynamicObject()
RaLightsSet(0, 0); // początkowe zerowanie stanu świateł RaLightsSet(0, 0); // początkowe zerowanie stanu świateł
// Ra: domyślne ilości animacji dla zgodności wstecz (gdy brak ilości podanych // Ra: domyślne ilości animacji dla zgodności wstecz (gdy brak ilości podanych
// w MMD) // w MMD)
iAnimType[ANIM_WHEELS] = 8; // 0-osie (8) // ustawienie liczby modeli animowanych podczas konstruowania obiektu a nie na 0
iAnimType[ANIM_DOORS] = 8; // 1-drzwi (8) // prowadzi prosto do wysypów jeśli źle zdefiniowane mmd
iAnimType[ANIM_LEVERS] = 4; // 2-wahacze (4) - np. nogi konia iAnimType[ANIM_WHEELS] = 0; // 0-osie (8)
iAnimType[ANIM_BUFFERS] = 4; // 3-zderzaki (4) iAnimType[ANIM_DOORS] = 0; // 1-drzwi (8)
iAnimType[ANIM_BOOGIES] = 2; // 4-wózki (2) iAnimType[ANIM_LEVERS] = 0; // 2-wahacze (4) - np. nogi konia
iAnimType[ANIM_PANTS] = 2; // 5-pantografy (2) iAnimType[ANIM_BUFFERS] = 0; // 3-zderzaki (4)
iAnimType[ANIM_BOOGIES] = 0; // 4-wózki (2)
iAnimType[ANIM_PANTS] = 0; // 5-pantografy (2)
iAnimType[ANIM_STEAMS] = 0; // 6-tłoki (napęd parowozu) iAnimType[ANIM_STEAMS] = 0; // 6-tłoki (napęd parowozu)
iAnimations = 0; // na razie nie ma żadnego iAnimations = 0; // na razie nie ma żadnego
pAnimations = NULL; pAnimations = NULL;
@@ -1738,6 +1740,20 @@ TDynamicObject::Init(string Name, // nazwa pojazdu, np. "EU07-424"
Type_Name); Type_Name);
return 0.0; // zerowa długość to brak pojazdu return 0.0; // zerowa długość to brak pojazdu
} }
// ustawienie pozycji hamulca
MoverParameters->LocalBrakePos = 0;
if (driveractive)
{
if (Cab == 0)
MoverParameters->BrakeCtrlPos =
floor(MoverParameters->Handle->GetPos(bh_NP));
else
MoverParameters->BrakeCtrlPos = floor(MoverParameters->Handle->GetPos(bh_RP));
}
else
MoverParameters->BrakeCtrlPos =
floor(MoverParameters->Handle->GetPos(bh_NP));
MoverParameters->BrakeLevelSet( MoverParameters->BrakeLevelSet(
MoverParameters->BrakeCtrlPos); // poprawienie hamulca po ewentualnym MoverParameters->BrakeCtrlPos); // poprawienie hamulca po ewentualnym
// przestawieniu przez Pascal // przestawieniu przez Pascal
@@ -1810,7 +1826,7 @@ TDynamicObject::Init(string Name, // nazwa pojazdu, np. "EU07-424"
if (ActPar.find("1") != string::npos) // wylaczanie 10% if (ActPar.find("1") != string::npos) // wylaczanie 10%
{ {
if (random(10) < 1) // losowanie 1/10 if (Random(10) < 1) // losowanie 1/10
{ {
MoverParameters->BrakeStatus |= 128; // wylacz MoverParameters->BrakeStatus |= 128; // wylacz
MoverParameters->Hamulec->ForceEmptiness(); MoverParameters->Hamulec->ForceEmptiness();
@@ -1819,7 +1835,7 @@ TDynamicObject::Init(string Name, // nazwa pojazdu, np. "EU07-424"
} }
if (ActPar.find("X") != string::npos) // agonalny wylaczanie 20%, usrednienie przekladni if (ActPar.find("X") != string::npos) // agonalny wylaczanie 20%, usrednienie przekladni
{ {
if (random(100) < 20) // losowanie 20/100 if (Random(100) < 20) // losowanie 20/100
{ {
MoverParameters->BrakeStatus |= 128; // wylacz MoverParameters->BrakeStatus |= 128; // wylacz
MoverParameters->Hamulec->ForceEmptiness(); MoverParameters->Hamulec->ForceEmptiness();
@@ -1828,7 +1844,7 @@ TDynamicObject::Init(string Name, // nazwa pojazdu, np. "EU07-424"
if (MoverParameters->BrakeCylMult[2] * MoverParameters->BrakeCylMult[1] > if (MoverParameters->BrakeCylMult[2] * MoverParameters->BrakeCylMult[1] >
0.01) // jesli jest nastawiacz mechaniczny PL 0.01) // jesli jest nastawiacz mechaniczny PL
{ {
float rnd = random(100); float rnd = Random(100);
if (rnd < 20) // losowanie 20/100 usrednienie if (rnd < 20) // losowanie 20/100 usrednienie
{ {
MoverParameters->BrakeCylMult[2] = MoverParameters->BrakeCylMult[1] = MoverParameters->BrakeCylMult[2] = MoverParameters->BrakeCylMult[1] =
@@ -4221,10 +4237,10 @@ void TDynamicObject::LoadMMediaFile(string BaseDir, string TypeName,
delete fs; delete fs;
return; return;
} }
if (fs->width() == 0) // if (fs->width() == 0)
{ // {
return delete fs; // return delete fs;
}; // };
string asAnimName; string asAnimName;
bool Stop_InternalData = false; bool Stop_InternalData = false;
//char *buf = new char[size + 1]; // ciąg bajtów o długości równej rozmiwarowi pliku //char *buf = new char[size + 1]; // ciąg bajtów o długości równej rozmiwarowi pliku

View File

@@ -469,7 +469,7 @@ class TDynamicObject
// void UpdatePos(); // void UpdatePos();
// McZapkie-260202 // McZapkie-260202
void LoadMMediaFile(std::string BaseDir, std::string TypeName, std::string ReplacableSkin); void LoadMMediaFile(string BaseDir, string TypeName, string ReplacableSkin);
inline double ABuGetDirection() // ABu. inline double ABuGetDirection() // ABu.
{ {

View File

@@ -6926,12 +6926,6 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int Dir)
ScndPipePress = CompressedVolume / VeselVolume; ScndPipePress = CompressedVolume / VeselVolume;
PipePress = CntrlPipePress; PipePress = CntrlPipePress;
BrakePress = 0; BrakePress = 0;
LocalBrakePos = 0;
if (CabNo == 0)
BrakeCtrlPos = floor(Handle->GetPos(bh_NP)); // Q: TODO: Trunc na floor
else
BrakeCtrlPos = floor(Handle->GetPos(bh_RP));
MainSwitch(false); MainSwitch(false);
PantFront(true); PantFront(true);
PantRear(true); PantRear(true);
@@ -6950,7 +6944,6 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int Dir)
PipeBrakePress = MaxBrakePress[3]; PipeBrakePress = MaxBrakePress[3];
BrakePress = MaxBrakePress[3]; BrakePress = MaxBrakePress[3];
LocalBrakePos = 0; LocalBrakePos = 0;
BrakeCtrlPos = Trunc(Handle->GetPos(bh_NP)); // Q: TODO: Trunc na floor
LimPipePress = LowPipePress; LimPipePress = LowPipePress;
} }