From 33c3e5354aadceb4996076e46efa22f56e00336d Mon Sep 17 00:00:00 2001 From: tmj-fstate Date: Mon, 11 Nov 2019 00:01:57 +0100 Subject: [PATCH] default vehicle sounds tweak, model error logging tweak --- DynObj.cpp | 90 +++++++++++++++++++++++++++-------------------------- Model3d.cpp | 2 ++ 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/DynObj.cpp b/DynObj.cpp index 60c7cf01..866fc9ed 100644 --- a/DynObj.cpp +++ b/DynObj.cpp @@ -5718,53 +5718,55 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co } // assign default samples to sound emitters which weren't included in the config file - // engine - if( MoverParameters->Power > 0 ) { - if( true == m_powertrainsounds.dsbWejscie_na_bezoporow.empty() ) { + if( TestFlag( MoverParameters->CategoryFlag, 1 ) ) { + // rail vehicles: + // engine + if( MoverParameters->Power > 0 ) { + if( true == m_powertrainsounds.dsbWejscie_na_bezoporow.empty() ) { + // hunter-111211: domyslne, gdy brak + m_powertrainsounds.dsbWejscie_na_bezoporow.deserialize( "wejscie_na_bezoporow.wav", sound_type::single ); + m_powertrainsounds.dsbWejscie_na_bezoporow.owner( this ); + } + if( true == m_powertrainsounds.motor_parallel.empty() ) { + m_powertrainsounds.motor_parallel.deserialize( "wescie_na_drugi_uklad.wav", sound_type::single ); + m_powertrainsounds.motor_parallel.owner( this ); + } + } + // braking sounds + if( true == rsUnbrake.empty() ) { + rsUnbrake.deserialize( "[1007]estluz.wav", sound_type::single ); + rsUnbrake.owner( this ); + } + // couplers + for( auto &couplersounds : m_couplersounds ) { + if( true == couplersounds.dsbCouplerAttach.empty() ) { + couplersounds.dsbCouplerAttach.deserialize( "couplerattach.wav", sound_type::single ); + couplersounds.dsbCouplerAttach.owner( this ); + } + if( true == couplersounds.dsbCouplerDetach.empty() ) { + couplersounds.dsbCouplerDetach.deserialize( "couplerdetach.wav", sound_type::single ); + couplersounds.dsbCouplerDetach.owner( this ); + } + if( true == couplersounds.dsbCouplerStretch.empty() ) { + couplersounds.dsbCouplerStretch.deserialize( "en57_couplerstretch.wav", sound_type::single ); + couplersounds.dsbCouplerStretch.owner( this ); + } + if( true == couplersounds.dsbBufferClamp.empty() ) { + couplersounds.dsbBufferClamp.deserialize( "en57_bufferclamp.wav", sound_type::single ); + couplersounds.dsbBufferClamp.owner( this ); + } + } + // other sounds + if( true == m_wheelflat.empty() ) { + m_wheelflat.deserialize( "lomotpodkucia.wav 0.23 0.0", sound_type::single, sound_parameters::frequency ); + m_wheelflat.owner( this ); + } + if( true == rscurve.empty() ) { // hunter-111211: domyslne, gdy brak - m_powertrainsounds.dsbWejscie_na_bezoporow.deserialize( "wejscie_na_bezoporow.wav", sound_type::single ); - m_powertrainsounds.dsbWejscie_na_bezoporow.owner( this ); - } - if( true == m_powertrainsounds.motor_parallel.empty() ) { - m_powertrainsounds.motor_parallel.deserialize( "wescie_na_drugi_uklad.wav", sound_type::single ); - m_powertrainsounds.motor_parallel.owner( this ); + rscurve.deserialize( "curve.wav", sound_type::single ); + rscurve.owner( this ); } } - // braking sounds - if( true == rsUnbrake.empty() ) { - rsUnbrake.deserialize( "[1007]estluz.wav", sound_type::single ); - rsUnbrake.owner( this ); - } - // couplers - for( auto &couplersounds : m_couplersounds ) { - if( true == couplersounds.dsbCouplerAttach.empty() ) { - couplersounds.dsbCouplerAttach.deserialize( "couplerattach.wav", sound_type::single ); - couplersounds.dsbCouplerAttach.owner( this ); - } - if( true == couplersounds.dsbCouplerDetach.empty() ) { - couplersounds.dsbCouplerDetach.deserialize( "couplerdetach.wav", sound_type::single ); - couplersounds.dsbCouplerDetach.owner( this ); - } - if( true == couplersounds.dsbCouplerStretch.empty() ) { - couplersounds.dsbCouplerStretch.deserialize( "en57_couplerstretch.wav", sound_type::single ); - couplersounds.dsbCouplerStretch.owner( this ); - } - if( true == couplersounds.dsbBufferClamp.empty() ) { - couplersounds.dsbBufferClamp.deserialize( "en57_bufferclamp.wav", sound_type::single ); - couplersounds.dsbBufferClamp.owner( this ); - } - } - // other sounds - if( true == m_wheelflat.empty() ) { - m_wheelflat.deserialize( "lomotpodkucia.wav 0.23 0.0", sound_type::single, sound_parameters::frequency ); - m_wheelflat.owner( this ); - } - if( true == rscurve.empty() ) { - // hunter-111211: domyslne, gdy brak - rscurve.deserialize( "curve.wav", sound_type::single ); - rscurve.owner( this ); - } - if (mdModel) mdModel->Init(); // obrócenie modelu oraz optymalizacja, również zapisanie binarnego diff --git a/Model3d.cpp b/Model3d.cpp index 8a77c117..639567c8 100644 --- a/Model3d.cpp +++ b/Model3d.cpp @@ -612,9 +612,11 @@ int TSubModel::Load( cParser &parser, TModel3d *Model, /*int Pos,*/ bool dynamic wsp[ adjacenvertextidx ] = vertexidx; // informacja, że w tym wierzchołku jest już policzony wektor normalny vertexnormal += facenormals[ adjacenvertextidx / 3 ]; } + /* else { ErrorLog( "Bad model: opposite normals in the same smoothing group, check sub-model \"" + pName + "\" for two-sided faces and/or scaling", logtype::model ); } + */ // i szukanie od kolejnego trójkąta adjacenvertextidx = SeekFaceNormal(sg, adjacenvertextidx / 3 + 1, sg[faceidx], Vertices[vertexidx].position, Vertices); }