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

custom sounds for cab controls configurable on per-item basis

This commit is contained in:
tmj-fstate
2017-07-15 19:27:49 +02:00
parent 4f9000ebe2
commit 3a67219e30
15 changed files with 687 additions and 570 deletions

View File

@@ -78,7 +78,8 @@ zwiekszenie nacisku przy duzych predkosciach w hamulcach Oerlikona
*/
#include "dumb3d.h"
using namespace Math3D;
extern int ConversionError;
const double Steel2Steel_friction = 0.15; //tarcie statyczne
const double g = 9.81; //przyspieszenie ziemskie
@@ -996,8 +997,8 @@ public:
double FrictConst2d= 0.0;
double TotalMassxg = 0.0; /*TotalMass*g*/
vector3 vCoulpler[2]; // powtórzenie współrzędnych sprzęgów z DynObj :/
vector3 DimHalf; // połowy rozmiarów do obliczeń geometrycznych
Math3D::vector3 vCoulpler[2]; // powtórzenie współrzędnych sprzęgów z DynObj :/
Math3D::vector3 DimHalf; // połowy rozmiarów do obliczeń geometrycznych
// int WarningSignal; //0: nie trabi, 1,2: trabi syreną o podanym numerze
int WarningSignal = 0; // tymczasowo 8bit, ze względu na funkcje w MTools
double fBrakeCtrlPos = -2.0; // płynna nastawa hamulca zespolonego
@@ -1210,47 +1211,3 @@ private:
};
extern double Distance(TLocation Loc1, TLocation Loc2, TDimension Dim1, TDimension Dim2);
inline
std::string
extract_value( std::string const &Key, std::string const &Input ) {
std::string value;
auto lookup = Input.find( Key + "=" );
if( lookup != std::string::npos ) {
value = Input.substr( Input.find_first_not_of( ' ', lookup + Key.size() + 1 ) );
lookup = value.find( ' ' );
if( lookup != std::string::npos ) {
// trim everything past the value
value.erase( lookup );
}
}
return value;
}
template <typename Type_>
bool
extract_value( Type_ &Variable, std::string const &Key, std::string const &Input, std::string const &Default ) {
auto value = extract_value( Key, Input );
if( false == value.empty() ) {
// set the specified variable to retrieved value
std::stringstream converter;
converter << value;
converter >> Variable;
return true; // located the variable
}
else {
// set the variable to provided default value
if( false == Default.empty() ) {
std::stringstream converter;
converter << Default;
converter >> Variable;
}
return false; // couldn't locate the variable in provided input
}
}
template <>
bool
extract_value( bool &Variable, std::string const &Key, std::string const &Input, std::string const &Default );