mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
point light size increase, changed movement scheme control in the cab
This commit is contained in:
@@ -1171,6 +1171,10 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
|||||||
iDrivigFlags |= moveSemaphorFound; //jeśli z przodu to dajemy falgę, że jest
|
iDrivigFlags |= moveSemaphorFound; //jeśli z przodu to dajemy falgę, że jest
|
||||||
d_to_next_sem = Min0R(sSpeedTable[i].fDist, d_to_next_sem);
|
d_to_next_sem = Min0R(sSpeedTable[i].fDist, d_to_next_sem);
|
||||||
}
|
}
|
||||||
|
if( sSpeedTable[ i ].fDist <= d_to_next_sem )
|
||||||
|
{
|
||||||
|
VelSignalNext = sSpeedTable[ i ].fVelNext;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (sSpeedTable[i].iFlags & spRoadVel)
|
else if (sSpeedTable[i].iFlags & spRoadVel)
|
||||||
{ // to W6
|
{ // to W6
|
||||||
|
|||||||
28
DynObj.cpp
28
DynObj.cpp
@@ -3100,7 +3100,11 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
dDOMoveLen =
|
dDOMoveLen =
|
||||||
GetdMoveLen() + MoverParameters->ComputeMovement(dt, dt1, ts, tp, tmpTraction, l, r);
|
GetdMoveLen() + MoverParameters->ComputeMovement(dt, dt1, ts, tp, tmpTraction, l, r);
|
||||||
// yB: zeby zawsze wrzucalo w jedna strone zakretu
|
// yB: zeby zawsze wrzucalo w jedna strone zakretu
|
||||||
|
/*
|
||||||
|
// this seemed to have opposite effect, if anything -- the sway direction would be affected
|
||||||
|
// by the 'direction' of the track, making the sway go sometimes inward, sometimes outward
|
||||||
MoverParameters->AccN *= -ABuGetDirection();
|
MoverParameters->AccN *= -ABuGetDirection();
|
||||||
|
*/
|
||||||
// if (dDOMoveLen!=0.0) //Ra: nie może być, bo blokuje Event0
|
// if (dDOMoveLen!=0.0) //Ra: nie może być, bo blokuje Event0
|
||||||
Move(dDOMoveLen);
|
Move(dDOMoveLen);
|
||||||
if (!bEnabled) // usuwane pojazdy nie mają toru
|
if (!bEnabled) // usuwane pojazdy nie mają toru
|
||||||
@@ -3530,24 +3534,24 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
// NBMX Obsluga drzwi, MC: zuniwersalnione
|
// NBMX Obsluga drzwi, MC: zuniwersalnione
|
||||||
if ((dDoorMoveL < MoverParameters->DoorMaxShiftL) && (MoverParameters->DoorLeftOpened))
|
if ((dDoorMoveL < MoverParameters->DoorMaxShiftL) && (MoverParameters->DoorLeftOpened))
|
||||||
{
|
{
|
||||||
rsDoorOpen.Play(vol, 0, MechInside, vPosition);
|
rsDoorOpen.Play(1, 0, MechInside, vPosition);
|
||||||
dDoorMoveL += dt1 * 0.5 * MoverParameters->DoorOpenSpeed;
|
dDoorMoveL += dt1 * 0.5 * MoverParameters->DoorOpenSpeed;
|
||||||
}
|
}
|
||||||
if ((dDoorMoveL > 0) && (!MoverParameters->DoorLeftOpened))
|
if ((dDoorMoveL > 0) && (!MoverParameters->DoorLeftOpened))
|
||||||
{
|
{
|
||||||
rsDoorClose.Play(vol, 0, MechInside, vPosition);
|
rsDoorClose.Play(1, 0, MechInside, vPosition);
|
||||||
dDoorMoveL -= dt1 * MoverParameters->DoorCloseSpeed;
|
dDoorMoveL -= dt1 * MoverParameters->DoorCloseSpeed;
|
||||||
if (dDoorMoveL < 0)
|
if (dDoorMoveL < 0)
|
||||||
dDoorMoveL = 0;
|
dDoorMoveL = 0;
|
||||||
}
|
}
|
||||||
if ((dDoorMoveR < MoverParameters->DoorMaxShiftR) && (MoverParameters->DoorRightOpened))
|
if ((dDoorMoveR < MoverParameters->DoorMaxShiftR) && (MoverParameters->DoorRightOpened))
|
||||||
{
|
{
|
||||||
rsDoorOpen.Play(vol, 0, MechInside, vPosition);
|
rsDoorOpen.Play(1, 0, MechInside, vPosition);
|
||||||
dDoorMoveR += dt1 * 0.5 * MoverParameters->DoorOpenSpeed;
|
dDoorMoveR += dt1 * 0.5 * MoverParameters->DoorOpenSpeed;
|
||||||
}
|
}
|
||||||
if ((dDoorMoveR > 0) && (!MoverParameters->DoorRightOpened))
|
if ((dDoorMoveR > 0) && (!MoverParameters->DoorRightOpened))
|
||||||
{
|
{
|
||||||
rsDoorClose.Play(vol, 0, MechInside, vPosition);
|
rsDoorClose.Play(1, 0, MechInside, vPosition);
|
||||||
dDoorMoveR -= dt1 * MoverParameters->DoorCloseSpeed;
|
dDoorMoveR -= dt1 * MoverParameters->DoorCloseSpeed;
|
||||||
if (dDoorMoveR < 0)
|
if (dDoorMoveR < 0)
|
||||||
dDoorMoveR = 0;
|
dDoorMoveR = 0;
|
||||||
@@ -5357,10 +5361,6 @@ void TDynamicObject::LoadMMediaFile(std::string BaseDir, std::string TypeName,
|
|||||||
token, 50,
|
token, 50,
|
||||||
GetPosition().x, GetPosition().y, GetPosition().z,
|
GetPosition().x, GetPosition().y, GetPosition().z,
|
||||||
true );
|
true );
|
||||||
sPantUp.AM = 50000;
|
|
||||||
sPantUp.AA = -1 * ( 105 - Random( 10 ) ) / 100;
|
|
||||||
sPantUp.FM = 1.0;
|
|
||||||
sPantUp.FA = 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( token == "pantographdown:" ) {
|
else if( token == "pantographdown:" ) {
|
||||||
@@ -5370,10 +5370,6 @@ void TDynamicObject::LoadMMediaFile(std::string BaseDir, std::string TypeName,
|
|||||||
token, 50,
|
token, 50,
|
||||||
GetPosition().x, GetPosition().y, GetPosition().z,
|
GetPosition().x, GetPosition().y, GetPosition().z,
|
||||||
true );
|
true );
|
||||||
sPantDown.AM = 50000;
|
|
||||||
sPantDown.AA = -1 * ( 105 - Random( 10 ) ) / 100;
|
|
||||||
sPantDown.FM = 1.0;
|
|
||||||
sPantDown.FA = 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( token == "compressor:" ) {
|
else if( token == "compressor:" ) {
|
||||||
@@ -5404,10 +5400,6 @@ void TDynamicObject::LoadMMediaFile(std::string BaseDir, std::string TypeName,
|
|||||||
token, 50,
|
token, 50,
|
||||||
GetPosition().x, GetPosition().y, GetPosition().z,
|
GetPosition().x, GetPosition().y, GetPosition().z,
|
||||||
true );
|
true );
|
||||||
rsDoorOpen.AM = 50000;
|
|
||||||
rsDoorOpen.AA = -1 * ( 105 - Random( 10 ) ) / 100;
|
|
||||||
rsDoorOpen.FM = 1.0;
|
|
||||||
rsDoorOpen.FA = 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( token == "doorclose:" ) {
|
else if( token == "doorclose:" ) {
|
||||||
@@ -5417,10 +5409,6 @@ void TDynamicObject::LoadMMediaFile(std::string BaseDir, std::string TypeName,
|
|||||||
token, 50,
|
token, 50,
|
||||||
GetPosition().x, GetPosition().y, GetPosition().z,
|
GetPosition().x, GetPosition().y, GetPosition().z,
|
||||||
true );
|
true );
|
||||||
rsDoorClose.AM = 50000;
|
|
||||||
rsDoorClose.AA = -1 * ( 105 - Random( 10 ) ) / 100;
|
|
||||||
rsDoorClose.FM = 1.0;
|
|
||||||
rsDoorClose.FA = 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( token == "sand:" ) {
|
else if( token == "sand:" ) {
|
||||||
|
|||||||
@@ -726,7 +726,7 @@ void TSubModel::DisplayLists()
|
|||||||
glColorMaterial(GL_FRONT, GL_EMISSION);
|
glColorMaterial(GL_FRONT, GL_EMISSION);
|
||||||
glDisable(GL_LIGHTING); // Tolaris-030603: bo mu punkty swiecace sie blendowaly
|
glDisable(GL_LIGHTING); // Tolaris-030603: bo mu punkty swiecace sie blendowaly
|
||||||
glBegin(GL_POINTS);
|
glBegin(GL_POINTS);
|
||||||
glVertex3f(0, 0, 0);
|
glVertex3f( 0.0f, 0.0f, -0.025f ); // shift point towards the viewer, to avoid z-fighting with the light polygons
|
||||||
glEnd();
|
glEnd();
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
|
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
|
||||||
|
|||||||
250
Train.cpp
250
Train.cpp
@@ -24,6 +24,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "McZapkie\hamulce.h"
|
#include "McZapkie\hamulce.h"
|
||||||
#include "McZapkie\MOVER.h"
|
#include "McZapkie\MOVER.h"
|
||||||
|
#include "Camera.h"
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
using namespace Timer;
|
using namespace Timer;
|
||||||
@@ -891,56 +892,56 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
|||||||
if (false == (mvOccupied->LightsPosNo > 0))
|
if (false == (mvOccupied->LightsPosNo > 0))
|
||||||
{
|
{
|
||||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||||
(ggRearLeftLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu
|
(ggRearRightLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu.
|
||||||
|
// 17.02.17 changed rear to opposite side, so the same key actually controls both lights on the left side, from the driver's point of view
|
||||||
|
// TODO: do it a more elegant way. preferably along with the rest of the controlling code
|
||||||
{
|
{
|
||||||
//------------------------------
|
|
||||||
if (mvOccupied->ActiveCab == 1)
|
if (mvOccupied->ActiveCab == 1)
|
||||||
{ // kabina 1
|
{ // kabina 1
|
||||||
if (((DynamicObject->iLights[1]) & 3) == 0)
|
if (((DynamicObject->iLights[1]) & 48) == 0)
|
||||||
{
|
{
|
||||||
DynamicObject->iLights[1] |= 1;
|
DynamicObject->iLights[1] |= 16;
|
||||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
||||||
dsbSwitch->Play(0, 0, 0);
|
dsbSwitch->Play(0, 0, 0);
|
||||||
ggRearLeftLightButton.PutValue(1);
|
ggRearRightLightButton.PutValue(1);
|
||||||
}
|
}
|
||||||
if (((DynamicObject->iLights[1]) & 3) == 2)
|
if (((DynamicObject->iLights[1]) & 48) == 32)
|
||||||
{
|
{
|
||||||
DynamicObject->iLights[1] &= (255 - 2);
|
DynamicObject->iLights[1] &= (255 - 32);
|
||||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
||||||
dsbSwitch->Play(0, 0, 0);
|
dsbSwitch->Play(0, 0, 0);
|
||||||
if (ggRearLeftEndLightButton.SubModel)
|
if (ggRearRightEndLightButton.SubModel)
|
||||||
{
|
{
|
||||||
ggRearLeftEndLightButton.PutValue(0);
|
ggRearRightEndLightButton.PutValue(0);
|
||||||
ggRearLeftLightButton.PutValue(0);
|
ggRearRightLightButton.PutValue(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ggRearLeftLightButton.PutValue(0);
|
ggRearRightLightButton.PutValue(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // kabina -1
|
{ // kabina -1
|
||||||
if (((DynamicObject->iLights[0]) & 3) == 0)
|
if (((DynamicObject->iLights[0]) & 48) == 0)
|
||||||
{
|
{
|
||||||
DynamicObject->iLights[0] |= 1;
|
DynamicObject->iLights[0] |= 16;
|
||||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
||||||
dsbSwitch->Play(0, 0, 0);
|
dsbSwitch->Play(0, 0, 0);
|
||||||
ggRearLeftLightButton.PutValue(1);
|
ggRearRightLightButton.PutValue(1);
|
||||||
}
|
}
|
||||||
if (((DynamicObject->iLights[0]) & 3) == 2)
|
if (((DynamicObject->iLights[0]) & 48) == 32)
|
||||||
{
|
{
|
||||||
DynamicObject->iLights[0] &= (255 - 2);
|
DynamicObject->iLights[0] &= (255 - 32);
|
||||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
||||||
dsbSwitch->Play(0, 0, 0);
|
dsbSwitch->Play(0, 0, 0);
|
||||||
if (ggRearLeftEndLightButton.SubModel)
|
if (ggRearRightEndLightButton.SubModel)
|
||||||
{
|
{
|
||||||
ggRearLeftEndLightButton.PutValue(0);
|
ggRearRightEndLightButton.PutValue(0);
|
||||||
ggRearLeftLightButton.PutValue(0);
|
ggRearRightLightButton.PutValue(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ggRearLeftLightButton.PutValue(0);
|
ggRearRightLightButton.PutValue(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//----------------------
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1066,53 +1067,46 @@ if ((mvControlled->PantFrontVolt) || (mvControlled->PantRearVolt) ||
|
|||||||
if (false == (mvOccupied->LightsPosNo > 0))
|
if (false == (mvOccupied->LightsPosNo > 0))
|
||||||
{
|
{
|
||||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||||
(ggRearRightLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu
|
(ggRearLeftLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu
|
||||||
|
// 17.02.17 changed rear to opposite side, so the same key actually controls both lights on the left side, from the driver's point of view
|
||||||
|
// TODO: do it a more elegant way. preferably along with the rest of the controlling code
|
||||||
{
|
{
|
||||||
//------------------------------
|
if( mvOccupied->ActiveCab == 1 ) { // kabina 1
|
||||||
if (mvOccupied->ActiveCab == 1)
|
if( ( ( DynamicObject->iLights[ 1 ] ) & 3 ) == 0 ) {
|
||||||
{ // kabina 1
|
DynamicObject->iLights[ 1 ] |= 1;
|
||||||
if (((DynamicObject->iLights[1]) & 48) == 0)
|
|
||||||
{
|
|
||||||
DynamicObject->iLights[1] |= 16;
|
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
ggRearRightLightButton.PutValue(1);
|
ggRearLeftLightButton.PutValue( 1 );
|
||||||
}
|
}
|
||||||
if (((DynamicObject->iLights[1]) & 48) == 32)
|
if( ( ( DynamicObject->iLights[ 1 ] ) & 3 ) == 2 ) {
|
||||||
{
|
DynamicObject->iLights[ 1 ] &= ( 255 - 2 );
|
||||||
DynamicObject->iLights[1] &= (255 - 32);
|
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
if (ggRearRightEndLightButton.SubModel)
|
if( ggRearLeftEndLightButton.SubModel ) {
|
||||||
{
|
ggRearLeftEndLightButton.PutValue( 0 );
|
||||||
ggRearRightEndLightButton.PutValue(0);
|
ggRearLeftLightButton.PutValue( 0 );
|
||||||
ggRearRightLightButton.PutValue(0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ggRearRightLightButton.PutValue(0);
|
ggRearLeftLightButton.PutValue( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else { // kabina -1
|
||||||
{ // kabina -1
|
if( ( ( DynamicObject->iLights[ 0 ] ) & 3 ) == 0 ) {
|
||||||
if (((DynamicObject->iLights[0]) & 48) == 0)
|
DynamicObject->iLights[ 0 ] |= 1;
|
||||||
{
|
|
||||||
DynamicObject->iLights[0] |= 16;
|
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
ggRearRightLightButton.PutValue(1);
|
ggRearLeftLightButton.PutValue( 1 );
|
||||||
}
|
}
|
||||||
if (((DynamicObject->iLights[0]) & 48) == 32)
|
if( ( ( DynamicObject->iLights[ 0 ] ) & 3 ) == 2 ) {
|
||||||
{
|
DynamicObject->iLights[ 0 ] &= ( 255 - 2 );
|
||||||
DynamicObject->iLights[0] &= (255 - 32);
|
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
if (ggRearRightEndLightButton.SubModel)
|
if( ggRearLeftEndLightButton.SubModel ) {
|
||||||
{
|
ggRearLeftEndLightButton.PutValue( 0 );
|
||||||
ggRearRightEndLightButton.PutValue(0);
|
ggRearLeftLightButton.PutValue( 0 );
|
||||||
ggRearRightLightButton.PutValue(0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ggRearRightLightButton.PutValue(0);
|
ggRearLeftLightButton.PutValue( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //------------------------------
|
} //------------------------------
|
||||||
@@ -2099,52 +2093,46 @@ if
|
|||||||
{
|
{
|
||||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||||
(ggRearLeftLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
(ggRearLeftLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
||||||
|
// 17.02.17 changed rear to opposite side, so the same key actually controls both lights on the left side, from the driver's point of view
|
||||||
|
// TODO: do it a more elegant way. preferably along with the rest of the controlling code
|
||||||
{
|
{
|
||||||
//------------------------------
|
//------------------------------
|
||||||
if (mvOccupied->ActiveCab == 1)
|
if( mvOccupied->ActiveCab == 1 ) { // kabina 1 (od strony 0)
|
||||||
{ // kabina 1
|
if( ( ( DynamicObject->iLights[ 1 ] ) & 48 ) == 0 ) {
|
||||||
if (((DynamicObject->iLights[1]) & 3) == 0)
|
DynamicObject->iLights[ 1 ] |= 32;
|
||||||
{
|
|
||||||
DynamicObject->iLights[1] |= 2;
|
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
if (ggRearLeftEndLightButton.SubModel)
|
if( ggRearRightEndLightButton.SubModel ) {
|
||||||
{
|
ggRearRightEndLightButton.PutValue( 1 );
|
||||||
ggRearLeftEndLightButton.PutValue(1);
|
ggRearRightLightButton.PutValue( 0 );
|
||||||
ggRearLeftLightButton.PutValue(0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ggRearLeftLightButton.PutValue(-1);
|
ggRearRightLightButton.PutValue( -1 );
|
||||||
}
|
}
|
||||||
if (((DynamicObject->iLights[1]) & 3) == 1)
|
if( ( ( DynamicObject->iLights[ 1 ] ) & 48 ) == 16 ) {
|
||||||
{
|
DynamicObject->iLights[ 1 ] &= ( 255 - 16 );
|
||||||
DynamicObject->iLights[1] &= (255 - 1);
|
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
ggRearLeftLightButton.PutValue(0);
|
ggRearRightLightButton.PutValue( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else { // kabina -1
|
||||||
|
if( ( ( DynamicObject->iLights[ 0 ] ) & 48 ) == 0 ) {
|
||||||
|
DynamicObject->iLights[ 0 ] |= 32;
|
||||||
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
|
if( ggRearRightEndLightButton.SubModel ) {
|
||||||
|
ggRearRightEndLightButton.PutValue( 1 );
|
||||||
|
ggRearRightLightButton.PutValue( 0 );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{ // kabina -1
|
ggRearRightLightButton.PutValue( -1 );
|
||||||
if (((DynamicObject->iLights[0]) & 3) == 0)
|
}
|
||||||
{
|
if( ( ( DynamicObject->iLights[ 0 ] ) & 48 ) == 16 ) {
|
||||||
DynamicObject->iLights[0] |= 2;
|
DynamicObject->iLights[ 0 ] &= ( 255 - 16 );
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
if (ggRearLeftEndLightButton.SubModel)
|
ggRearRightLightButton.PutValue( 0 );
|
||||||
{
|
|
||||||
ggRearLeftEndLightButton.PutValue(1);
|
|
||||||
ggRearLeftLightButton.PutValue(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ggRearLeftLightButton.PutValue(-1);
|
|
||||||
}
|
|
||||||
if (((DynamicObject->iLights[1]) & 3) == 1)
|
|
||||||
{
|
|
||||||
DynamicObject->iLights[1] &= (255 - 1);
|
|
||||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
|
||||||
dsbSwitch->Play(0, 0, 0);
|
|
||||||
ggLeftLightButton.PutValue(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //------------------------------
|
} //------------------------------
|
||||||
@@ -2272,52 +2260,46 @@ if
|
|||||||
{
|
{
|
||||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||||
(ggRearRightLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
(ggRearRightLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
||||||
|
// 17.02.17 changed rear to opposite side, so the same key actually controls both lights on the left side, from the driver's point of view
|
||||||
|
// TODO: do it a more elegant way. preferably along with the rest of the controlling code
|
||||||
{
|
{
|
||||||
//------------------------------
|
//------------------------------
|
||||||
if (mvOccupied->ActiveCab == 1)
|
if( mvOccupied->ActiveCab == 1 ) { // kabina 1
|
||||||
{ // kabina 1 (od strony 0)
|
if( ( ( DynamicObject->iLights[ 1 ] ) & 3 ) == 0 ) {
|
||||||
if (((DynamicObject->iLights[1]) & 48) == 0)
|
DynamicObject->iLights[ 1 ] |= 2;
|
||||||
{
|
|
||||||
DynamicObject->iLights[1] |= 32;
|
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
if (ggRearRightEndLightButton.SubModel)
|
if( ggRearLeftEndLightButton.SubModel ) {
|
||||||
{
|
ggRearLeftEndLightButton.PutValue( 1 );
|
||||||
ggRearRightEndLightButton.PutValue(1);
|
ggRearLeftLightButton.PutValue( 0 );
|
||||||
ggRearRightLightButton.PutValue(0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ggRearRightLightButton.PutValue(-1);
|
ggRearLeftLightButton.PutValue( -1 );
|
||||||
}
|
}
|
||||||
if (((DynamicObject->iLights[1]) & 48) == 16)
|
if( ( ( DynamicObject->iLights[ 1 ] ) & 3 ) == 1 ) {
|
||||||
{
|
DynamicObject->iLights[ 1 ] &= ( 255 - 1 );
|
||||||
DynamicObject->iLights[1] &= (255 - 16);
|
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
ggRearRightLightButton.PutValue(0);
|
ggRearLeftLightButton.PutValue( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else { // kabina -1
|
||||||
|
if( ( ( DynamicObject->iLights[ 0 ] ) & 3 ) == 0 ) {
|
||||||
|
DynamicObject->iLights[ 0 ] |= 2;
|
||||||
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
|
if( ggRearLeftEndLightButton.SubModel ) {
|
||||||
|
ggRearLeftEndLightButton.PutValue( 1 );
|
||||||
|
ggRearLeftLightButton.PutValue( 0 );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{ // kabina -1
|
ggRearLeftLightButton.PutValue( -1 );
|
||||||
if (((DynamicObject->iLights[0]) & 48) == 0)
|
}
|
||||||
{
|
if( ( ( DynamicObject->iLights[ 1 ] ) & 3 ) == 1 ) {
|
||||||
DynamicObject->iLights[0] |= 32;
|
DynamicObject->iLights[ 1 ] &= ( 255 - 1 );
|
||||||
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
dsbSwitch->SetVolume( DSBVOLUME_MAX );
|
||||||
dsbSwitch->Play( 0, 0, 0 );
|
dsbSwitch->Play( 0, 0, 0 );
|
||||||
if (ggRearRightEndLightButton.SubModel)
|
ggLeftLightButton.PutValue( 0 );
|
||||||
{
|
|
||||||
ggRearRightEndLightButton.PutValue(1);
|
|
||||||
ggRearRightLightButton.PutValue(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ggRearRightLightButton.PutValue(-1);
|
|
||||||
}
|
|
||||||
if (((DynamicObject->iLights[0]) & 48) == 16)
|
|
||||||
{
|
|
||||||
DynamicObject->iLights[0] &= (255 - 16);
|
|
||||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
|
||||||
dsbSwitch->Play(0, 0, 0);
|
|
||||||
ggRearRightLightButton.PutValue(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //------------------------------
|
} //------------------------------
|
||||||
@@ -2402,17 +2384,25 @@ if
|
|||||||
{
|
{
|
||||||
// McZapkie: poruszanie sie po kabinie, w updatemechpos zawarte sa wiezy
|
// McZapkie: poruszanie sie po kabinie, w updatemechpos zawarte sa wiezy
|
||||||
|
|
||||||
// double dt=Timer::GetDeltaTime();
|
auto step = 60.0f * Timer::GetDeltaTime();
|
||||||
if (mvOccupied->ActiveCab < 0)
|
auto const camerayaw = Global::pCamera->Yaw;
|
||||||
fMechCroach = -0.5;
|
Math3D::vector3 direction( 0.0f, 0.0f, step );
|
||||||
else
|
direction.RotateY( camerayaw );
|
||||||
fMechCroach = 0.5;
|
Math3D::vector3 right( -step, 0.0f, 0.0f );
|
||||||
|
right.RotateY( camerayaw );
|
||||||
|
// auto right = Math3D::CrossProduct( direction, Math3D::vector3( 0.0f, 1.0f, 0.0f ) );
|
||||||
|
|
||||||
|
if( mvOccupied->ActiveCab < 0 ) {
|
||||||
|
|
||||||
|
direction *= -1.0f;
|
||||||
|
right *= -1.0f;
|
||||||
|
}
|
||||||
// if (!GetAsyncKeyState(VK_SHIFT)<0) // bez shifta
|
// if (!GetAsyncKeyState(VK_SHIFT)<0) // bez shifta
|
||||||
if (!Console::Pressed(VK_CONTROL)) // gdy [Ctrl] zwolniony (dodatkowe widoki)
|
if (!Console::Pressed(VK_CONTROL)) // gdy [Ctrl] zwolniony (dodatkowe widoki)
|
||||||
{
|
{
|
||||||
if (cKey == Global::Keys[k_MechLeft])
|
if (cKey == Global::Keys[k_MechLeft])
|
||||||
{
|
{
|
||||||
vMechMovement.x += fMechCroach;
|
vMechMovement -= right;
|
||||||
if (DynamicObject->Mechanik)
|
if (DynamicObject->Mechanik)
|
||||||
if (!FreeFlyModeFlag) //żeby nie mieszać obserwując z zewnątrz
|
if (!FreeFlyModeFlag) //żeby nie mieszać obserwując z zewnątrz
|
||||||
DynamicObject->Mechanik->RouteSwitch(
|
DynamicObject->Mechanik->RouteSwitch(
|
||||||
@@ -2420,7 +2410,7 @@ if
|
|||||||
}
|
}
|
||||||
else if (cKey == Global::Keys[k_MechRight])
|
else if (cKey == Global::Keys[k_MechRight])
|
||||||
{
|
{
|
||||||
vMechMovement.x -= fMechCroach;
|
vMechMovement += right;
|
||||||
if (DynamicObject->Mechanik)
|
if (DynamicObject->Mechanik)
|
||||||
if (!FreeFlyModeFlag) //żeby nie mieszać obserwując z zewnątrz
|
if (!FreeFlyModeFlag) //żeby nie mieszać obserwując z zewnątrz
|
||||||
DynamicObject->Mechanik->RouteSwitch(
|
DynamicObject->Mechanik->RouteSwitch(
|
||||||
@@ -2428,7 +2418,7 @@ if
|
|||||||
}
|
}
|
||||||
else if (cKey == Global::Keys[k_MechBackward])
|
else if (cKey == Global::Keys[k_MechBackward])
|
||||||
{
|
{
|
||||||
vMechMovement.z -= fMechCroach;
|
vMechMovement -= direction;
|
||||||
// if (DynamicObject->Mechanik)
|
// if (DynamicObject->Mechanik)
|
||||||
// if (!FreeFlyModeFlag) //żeby nie mieszać obserwując z zewnątrz
|
// if (!FreeFlyModeFlag) //żeby nie mieszać obserwując z zewnątrz
|
||||||
// DynamicObject->Mechanik->RouteSwitch(0); //na skrzyżowaniu stanie
|
// DynamicObject->Mechanik->RouteSwitch(0); //na skrzyżowaniu stanie
|
||||||
@@ -2436,16 +2426,16 @@ if
|
|||||||
}
|
}
|
||||||
else if (cKey == Global::Keys[k_MechForward])
|
else if (cKey == Global::Keys[k_MechForward])
|
||||||
{
|
{
|
||||||
vMechMovement.z += fMechCroach;
|
vMechMovement += direction;
|
||||||
if (DynamicObject->Mechanik)
|
if (DynamicObject->Mechanik)
|
||||||
if (!FreeFlyModeFlag) //żeby nie mieszać obserwując z zewnątrz
|
if (!FreeFlyModeFlag) //żeby nie mieszać obserwując z zewnątrz
|
||||||
DynamicObject->Mechanik->RouteSwitch(
|
DynamicObject->Mechanik->RouteSwitch(
|
||||||
3); // na skrzyżowaniu pojedzie prosto
|
3); // na skrzyżowaniu pojedzie prosto
|
||||||
}
|
}
|
||||||
else if (cKey == Global::Keys[k_MechUp])
|
else if (cKey == Global::Keys[k_MechUp])
|
||||||
pMechOffset.y += 0.2; // McZapkie-120302 - wstawanie
|
pMechOffset.y += 0.25; // McZapkie-120302 - wstawanie
|
||||||
else if (cKey == Global::Keys[k_MechDown])
|
else if (cKey == Global::Keys[k_MechDown])
|
||||||
pMechOffset.y -= 0.2; // McZapkie-120302 - siadanie
|
pMechOffset.y -= 0.25; // McZapkie-120302 - siadanie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5994,6 +5984,10 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
|
|||||||
{
|
{
|
||||||
btLampkaHamienie.Load(Parser, DynamicObject->mdKabina);
|
btLampkaHamienie.Load(Parser, DynamicObject->mdKabina);
|
||||||
}
|
}
|
||||||
|
else if( Label == "i-dynamicbrake:" ) {
|
||||||
|
|
||||||
|
btLampkaED.Load( Parser, DynamicObject->mdKabina );
|
||||||
|
}
|
||||||
else if (Label == "i-braking-ezt:")
|
else if (Label == "i-braking-ezt:")
|
||||||
{
|
{
|
||||||
btLampkaHamowanie1zes.Load(Parser, DynamicObject->mdKabina);
|
btLampkaHamowanie1zes.Load(Parser, DynamicObject->mdKabina);
|
||||||
@@ -6334,6 +6328,10 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
|
|||||||
// hunter-091012: przyciemnienie swiatla w kabinie
|
// hunter-091012: przyciemnienie swiatla w kabinie
|
||||||
ggCabLightDimButton.Load(Parser, DynamicObject->mdKabina);
|
ggCabLightDimButton.Load(Parser, DynamicObject->mdKabina);
|
||||||
}
|
}
|
||||||
|
else if( Label == "battery_sw:" ) {
|
||||||
|
|
||||||
|
ggBatteryButton.Load( Parser, DynamicObject->mdKabina );
|
||||||
|
}
|
||||||
// ABu 090305: uniwersalne przyciski lub inne rzeczy
|
// ABu 090305: uniwersalne przyciski lub inne rzeczy
|
||||||
else if (Label == "universal1:")
|
else if (Label == "universal1:")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -345,8 +345,10 @@ bool TWorld::Init(HWND NhWnd, HDC hDC)
|
|||||||
WriteLog("glLineWidth(1.0f);");
|
WriteLog("glLineWidth(1.0f);");
|
||||||
glLineWidth(1.0f);
|
glLineWidth(1.0f);
|
||||||
// glLineWidth(2.0f);
|
// glLineWidth(2.0f);
|
||||||
WriteLog("glPointSize(2.0f);");
|
WriteLog("glPointSize(3.0f);");
|
||||||
glPointSize(2.0f);
|
glPointSize(3.0f);
|
||||||
|
// glHint( GL_POINT_SMOOTH_HINT, GL_NICEST ); // Really Nice Perspective Calculations
|
||||||
|
// glEnable( GL_POINT_SMOOTH );
|
||||||
|
|
||||||
// ----------- LIGHTING SETUP -----------
|
// ----------- LIGHTING SETUP -----------
|
||||||
// Light values and coordinates
|
// Light values and coordinates
|
||||||
|
|||||||
Reference in New Issue
Block a user