mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
start jolt sound tweaks, ati crash gfx renderer fix, lights event fix
This commit is contained in:
@@ -3933,7 +3933,7 @@ void TDynamicObject::RenderSounds() {
|
||||
if( Global.iPause != 0 ) { return; }
|
||||
|
||||
if( ( m_startjoltplayed )
|
||||
&& ( ( MoverParameters->AccSVBased < 0.01 )
|
||||
&& ( ( std::abs( MoverParameters->AccSVBased ) < 0.01 )
|
||||
|| ( GetVelocity() < 0.01 ) ) ) {
|
||||
// if the vehicle comes to a stop set the movement jolt to play when it starts moving again
|
||||
m_startjoltplayed = false;
|
||||
@@ -4397,8 +4397,8 @@ void TDynamicObject::RenderSounds() {
|
||||
// movement start jolt
|
||||
if( false == m_startjoltplayed ) {
|
||||
auto const velocity { GetVelocity() };
|
||||
if( ( MoverParameters->AccSVBased > 0.2 )
|
||||
&& ( velocity > 2.5 )
|
||||
if( ( MoverParameters->V > 0.0 ? ( MoverParameters->AccSVBased > 0.1 ) : ( MoverParameters->AccSVBased < 0.1 ) )
|
||||
&& ( velocity > 1.0 )
|
||||
&& ( velocity < 15.0 ) ) {
|
||||
m_startjolt.play( sound_flags::exclusive );
|
||||
m_startjoltplayed = true;
|
||||
|
||||
@@ -1498,7 +1498,7 @@ lights_event::run_() {
|
||||
if( targetmodel == nullptr ) { continue; }
|
||||
// event effect code
|
||||
for( auto lightidx = 0; lightidx < iMaxNumLights; ++lightidx ) {
|
||||
if( m_lights[ lightidx ] == std::numeric_limits<float>::quiet_NaN() ) {
|
||||
if( std::isnan( m_lights[ lightidx ] ) ) {
|
||||
// processed all supplied values, bail out
|
||||
break;
|
||||
}
|
||||
@@ -1518,7 +1518,7 @@ lights_event::export_as_text_( std::ostream &Output ) const {
|
||||
|
||||
auto lightidx{ 0 };
|
||||
while( ( lightidx < iMaxNumLights )
|
||||
&& ( m_lights[ lightidx ] != std::numeric_limits<float>::quiet_NaN() ) ) {
|
||||
&& ( false == std::isnan( m_lights[ lightidx ] ) ) ) {
|
||||
Output << m_lights[ lightidx ] << ' ';
|
||||
++lightidx;
|
||||
}
|
||||
|
||||
@@ -4314,7 +4314,8 @@ double TMoverParameters::CouplerForce(int CouplerN, double dt)
|
||||
else if( ( Couplers[ CouplerN ].CouplingFlag != coupling::faux )
|
||||
&& ( newdist > 0.001 )
|
||||
&& ( Couplers[ CouplerN ].Dist <= 0.001 )
|
||||
&& ( absdV > 0.005 ) ) {
|
||||
&& ( absdV > 0.005 )
|
||||
&& ( Vel > 1.0 ) ) {
|
||||
// 090503: dzwieki pracy sprzegu
|
||||
SetFlag(
|
||||
Couplers[ CouplerN ].sounds,
|
||||
|
||||
31
renderer.cpp
31
renderer.cpp
@@ -1438,6 +1438,9 @@ opengl_renderer::Render( world_environment *Environment ) {
|
||||
::glPushMatrix();
|
||||
::glScalef( 500.f, 500.f, 500.f );
|
||||
Environment->m_skydome.Render();
|
||||
if( Global.bUseVBO ) {
|
||||
gfx::opengl_vbogeometrybank::reset();
|
||||
}
|
||||
::glPopMatrix();
|
||||
// stars
|
||||
if( Environment->m_stars.m_stars != nullptr ) {
|
||||
@@ -2686,30 +2689,7 @@ opengl_renderer::Render( TTrack *Track ) {
|
||||
++m_debugstats.drawcalls;
|
||||
|
||||
switch( m_renderpass.draw_mode ) {
|
||||
case rendermode::color:
|
||||
case rendermode::reflections: {
|
||||
setup_environment_light( Track->eEnvironment );
|
||||
if( Track->m_material1 != 0 ) {
|
||||
Bind_Material( Track->m_material1 );
|
||||
m_geometry.draw( std::begin( Track->Geometry1 ), std::end( Track->Geometry1 ) );
|
||||
}
|
||||
if( Track->m_material2 != 0 ) {
|
||||
Bind_Material( Track->m_material2 );
|
||||
m_geometry.draw( std::begin( Track->Geometry2 ), std::end( Track->Geometry2 ) );
|
||||
}
|
||||
if( ( Track->eType == tt_Switch )
|
||||
&& ( Track->SwitchExtension->m_material3 != 0 ) ) {
|
||||
Bind_Material( Track->SwitchExtension->m_material3 );
|
||||
m_geometry.draw( Track->SwitchExtension->Geometry3 );
|
||||
}
|
||||
setup_environment_light();
|
||||
break;
|
||||
}
|
||||
case rendermode::shadows: {
|
||||
// shadow pass includes trackbeds but not tracks themselves due to low resolution of the map
|
||||
// TODO: implement
|
||||
break;
|
||||
}
|
||||
// single path pieces are rendererd in pick scenery mode only
|
||||
case rendermode::pickscenery: {
|
||||
// add the node to the pick list
|
||||
m_picksceneryitems.emplace_back( Track );
|
||||
@@ -2729,7 +2709,6 @@ opengl_renderer::Render( TTrack *Track ) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case rendermode::pickcontrols:
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
@@ -2824,7 +2803,7 @@ opengl_renderer::Render( scene::basic_cell::path_sequence::const_iterator First,
|
||||
// restore default lighting
|
||||
setup_environment_light();
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case rendermode::shadows: {
|
||||
if( ( std::abs( track->fTexHeight1 ) < 0.35f )
|
||||
|
||||
Reference in New Issue
Block a user