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:
10
Driver.cpp
10
Driver.cpp
@@ -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
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user