diff --git a/.gitignore b/.gitignore index 838d8452..2f13bf45 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ builds/ CMakeLists.txt.user ci_shadervalidator/validateshaders +build/ +.vscode/ \ No newline at end of file diff --git a/McZapkie/hamulce.cpp b/McZapkie/hamulce.cpp index 68cc4d2a..ea37533d 100644 --- a/McZapkie/hamulce.cpp +++ b/McZapkie/hamulce.cpp @@ -118,8 +118,7 @@ double PFVd( double PH, double PL, double const S, double LIM, double const DP ) LIM = LIM + 1; PH = PH + 1.0; // wyzsze cisnienie absolutne PL = PL + 1.0; // nizsze cisnienie absolutne - assert( PH != PL ); - double sg = PL / PH; // bezwymiarowy stosunek cisnien + double sg = std::min( 1.0, PL / PH ); // bezwymiarowy stosunek cisnien double FM = PH * 197.0 * S; // najwyzszy mozliwy przeplyw, wraz z kierunkiem if ((PH - LIM) < 0.1) FM = FM * (PH - LIM) / DP; // jesli jestesmy przy nastawieniu, to zawor sie przymyka diff --git a/audio.cpp b/audio.cpp index 93e34058..8dc98f8f 100644 --- a/audio.cpp +++ b/audio.cpp @@ -69,7 +69,7 @@ openal_buffer::openal_buffer( std::string const &Filename ) : } else { id = null_resource; - ErrorLog("sound: failed to create AL buffer"); + ErrorLog("sound: failed to create AL buffer: " + std::string(alGetString(alGetError()))); } delete[] buf; diff --git a/audiorenderer_extra.h b/audiorenderer_extra.h index 79a2f20e..69bc2a34 100644 --- a/audiorenderer_extra.h +++ b/audiorenderer_extra.h @@ -17,7 +17,7 @@ openal_source::bind( sound_source *Controller, uint32_sequence Sounds, Iterator_ is_multipart = ( buffers.size() > 1 ); - if( id != audio::null_resource ) { + if( id != audio::null_resource && !buffers.empty()) { ::alSourceQueueBuffers( id, static_cast( buffers.size() ), buffers.data() ); ::alSourceRewind( id ); // sound controller can potentially request playback to start from certain buffer point