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

audio transcript sound volume based filtering, minor ai logic fixes

This commit is contained in:
tmj-fstate
2019-03-22 21:43:36 +01:00
parent faaabf116b
commit 73af767312
4 changed files with 16 additions and 9 deletions

View File

@@ -4950,10 +4950,12 @@ TController::UpdateSituation(double dt) {
// za radą yB ustawiamy pozycję 3 kranu (ruszanie kranem w innych miejscach
// powino zostać wyłączone)
// WriteLog("Zahamowanie składu");
mvOccupied->BrakeLevelSet(
mvOccupied->BrakeSystem == TBrakeSystem::ElectroPneumatic ?
1 :
3 );
if( mvOccupied->BrakeSystem == TBrakeSystem::ElectroPneumatic ) {
mvOccupied->BrakeLevelSet( mvOccupied->Handle->GetPos( bh_EPB ) );
}
else {
BrakeCtrlPosition = 3;
}
double p = mvOccupied->BrakePressureActual.PipePressureVal;
if( p < 3.9 ) {
// tu może być 0 albo -1 nawet

View File

@@ -172,9 +172,7 @@ openal_source::bind( sound_source *Controller, uint32_sequence Sounds, Iterator_
First, Last,
[&]( audio::buffer_handle const &bufferhandle ) {
auto const &buffer { audio::renderer.buffer( bufferhandle ) };
buffers.emplace_back( buffer.id );
if( false == buffer.caption.empty() ) {
ui::Transcripts.Add( buffer.caption ); } } );
buffers.emplace_back( buffer.id ); } );
if( id != audio::null_resource ) {
::alSourceQueueBuffers( id, static_cast<ALsizei>( buffers.size() ), buffers.data() );

View File

@@ -211,7 +211,7 @@ scenario_panel::render() {
auto const assignmentheader { locale::strings[ locale::string::driver_scenario_assignment ] };
if( ( false == owner->assignment().empty() )
&& ( true == ImGui::CollapsingHeader( assignmentheader.c_str() ) ) ) {
ImGui::TextWrapped( owner->assignment().c_str() );
ImGui::TextWrapped( "%s", owner->assignment().c_str() );
ImGui::Separator();
}
}
@@ -1034,7 +1034,7 @@ transcripts_panel::render() {
if( true == ImGui::Begin( panelname.c_str(), &is_open, flags ) ) {
// header section
for( auto const &line : text_lines ) {
ImGui::TextWrapped( line.data.c_str() );
ImGui::TextWrapped( "%s", line.data.c_str() );
}
}
ImGui::End();

View File

@@ -861,6 +861,13 @@ sound_source::update_counter( sound_handle const Sound, int const Value ) {
// sound( Sound ).playing = std::max( 0, sound( Sound ).playing + Value );
sound( Sound ).playing += Value;
if( ( m_properties.gain > 0.f )
&& ( sound( Sound ).playing == 1 ) ) {
auto const &buffer { audio::renderer.buffer( sound( Sound ).buffer ) };
if( false == buffer.caption.empty() ) {
ui::Transcripts.Add( buffer.caption );
}
}
assert( sound( Sound ).playing >= 0 );
}