Merge branch 'milek-dev' into gfx-work

This commit is contained in:
milek7
2019-09-12 18:16:04 +02:00
3 changed files with 10 additions and 7 deletions

View File

@@ -62,12 +62,15 @@ openal_buffer::openal_buffer( std::string const &Filename ) :
buf[i] = val;
}
id = 0;
alGenBuffers(1, &id);
if (!id)
throw std::runtime_error("sound: cannot generate buffer");
alBufferData(id, AL_FORMAT_MONO16, buf, si.frames * 2, rate);
if (id != null_resource && alIsBuffer(id)) {
alGetError();
alBufferData(id, AL_FORMAT_MONO16, buf, si.frames * 2, rate);
}
else {
id = null_resource;
ErrorLog("sound: failed to create AL buffer");
}
delete[] buf;
delete[] fbuf;

View File

@@ -175,7 +175,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 (buffer.id != null_resource) buffers.emplace_back( buffer.id ); } );
if( id != audio::null_resource ) {
::alSourceQueueBuffers( id, static_cast<ALsizei>( buffers.size() ), buffers.data() );

View File

@@ -1 +1 @@
#define VERSION_INFO "M7 (gfx-work) 7.09.2019"
#define VERSION_INFO "M7 (gfx-work) 12.09.2019"