mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 19:09:20 +02:00
make buffer create failure not fatal
This commit is contained in:
11
audio.cpp
11
audio.cpp
@@ -62,12 +62,13 @@ 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)) {
|
||||
alBufferData(id, AL_FORMAT_MONO16, buf, si.frames * 2, rate);
|
||||
}
|
||||
else {
|
||||
ErrorLog("sound: failed to create AL buffer");
|
||||
}
|
||||
|
||||
delete[] buf;
|
||||
delete[] fbuf;
|
||||
|
||||
Reference in New Issue
Block a user