From decbcd8055a10af35c658a128ce328d6f7f163bf Mon Sep 17 00:00:00 2001 From: tmj-fstate Date: Mon, 28 Aug 2017 20:23:16 +0200 Subject: [PATCH] build 170828. track scanning fix, vbo render path made default --- Driver.cpp | 54 +++++++++++++++++++++++++++++++---------------------- Globals.cpp | 2 +- version.h | 2 +- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Driver.cpp b/Driver.cpp index a3d39221..6c7f97a5 100644 --- a/Driver.cpp +++ b/Driver.cpp @@ -3583,36 +3583,46 @@ bool TController::UpdateSituation(double dt) pVehicles[ 0 ] == pVehicles[ 1 ] ? pVehicles[ 0 ] : pVehicles[ 1 ] ); - if( iDirection > 0 ) { + if( mvOccupied->V >= 0.0 ) { // towards coupler 0 - if( ( rearvehicle->NextConnected != nullptr ) - && ( rearvehicle->MoverParameters->Couplers[ ( rearvehicle->DirectionGet() > 0 ? 1 : 0 ) ].CouplingFlag == ctrain_virtual ) ) { - // scan behind if we had something connected there and are moving away - rearvehicle->ABuScanObjects( -1, fMaxProximityDist ); + if( ( mvOccupied->V * iDirection < 0.0 ) + || ( ( rearvehicle->NextConnected != nullptr ) + && ( rearvehicle->MoverParameters->Couplers[ ( rearvehicle->DirectionGet() > 0 ? 1 : 0 ) ].CouplingFlag == ctrain_virtual ) ) ) { + // scan behind if we're moving backward, or if we had something connected there and are moving away + rearvehicle->ABuScanObjects( ( + pVehicle->DirectionGet() == rearvehicle->DirectionGet() ? + -1 : + 1 ), + fMaxProximityDist ); } - pVehicles[ 0 ]->ABuScanObjects( 1, scandistance ); + pVehicles[ 0 ]->ABuScanObjects( ( + pVehicle->DirectionGet() == pVehicles[ 0 ]->DirectionGet() ? + 1 : + -1 ), + scandistance ); } else { // towards coupler 1 - if( ( rearvehicle->PrevConnected != nullptr ) - && ( rearvehicle->MoverParameters->Couplers[ ( rearvehicle->DirectionGet() > 0 ? 0 : 1 ) ].CouplingFlag == ctrain_virtual ) ) { - // scan behind if we had something connected there and are moving away - rearvehicle->ABuScanObjects( 1, fMaxProximityDist ); + if( ( mvOccupied->V * iDirection < 0.0 ) + || ( ( rearvehicle->PrevConnected != nullptr ) + && ( rearvehicle->MoverParameters->Couplers[ ( rearvehicle->DirectionGet() > 0 ? 0 : 1 ) ].CouplingFlag == ctrain_virtual ) ) ) { + // scan behind if we're moving backward, or if we had something connected there and are moving away + rearvehicle->ABuScanObjects( ( + pVehicle->DirectionGet() == rearvehicle->DirectionGet() ? + 1 : + -1 ), + fMaxProximityDist ); } - pVehicles[ 0 ]->ABuScanObjects( -1, scandistance ); + pVehicles[ 0 ]->ABuScanObjects( ( + pVehicle->DirectionGet() == pVehicles[ 0 ]->DirectionGet() ? + -1 : + 1 ), + scandistance ); } } -/* - pVehicles[ 0 ]->fScanDist = ( - mvOccupied->Vel > 5.0 ? - 400 + fBrakeDist : - 300.0 ); - pVehicles[ 0 ]->Update_scan(); - if( pVehicles[ 1 ] != pVehicles[ 0 ] ) { - pVehicles[ 1 ]->fScanDist = pVehicles[ 0 ]->fScanDist; - pVehicles[ 1 ]->Update_scan(); - } -*/ + + + if (AIControllFlag) { // tu bedzie logika sterowania if (mvOccupied->CommandIn.Command != "") diff --git a/Globals.cpp b/Globals.cpp index f83d9e89..780b5697 100644 --- a/Globals.cpp +++ b/Globals.cpp @@ -126,7 +126,7 @@ int Global::iDefaultFiltering = 9; // domyślne rozmywanie tekstur TGA bez alfa int Global::iBallastFiltering = 9; // domyślne rozmywanie tekstur podsypki int Global::iRailProFiltering = 5; // domyślne rozmywanie tekstur szyn int Global::iDynamicFiltering = 5; // domyślne rozmywanie tekstur pojazdów -bool Global::bUseVBO = false; // czy jest VBO w karcie graficznej (czy użyć) +bool Global::bUseVBO = true; // czy jest VBO w karcie graficznej (czy użyć) std::string Global::LastGLError; GLint Global::iMaxTextureSize = 4096; // maksymalny rozmiar tekstury bool Global::bSmoothTraction = false; // wygładzanie drutów starym sposobem diff --git a/version.h b/version.h index 13f434c4..7525fac4 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #pragma once #define VERSION_MAJOR 17 -#define VERSION_MINOR 825 +#define VERSION_MINOR 828 #define VERSION_REVISION 0