mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
make buffer create failure not fatal
This commit is contained in:
@@ -62,12 +62,13 @@ openal_buffer::openal_buffer( std::string const &Filename ) :
|
|||||||
buf[i] = val;
|
buf[i] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = 0;
|
|
||||||
alGenBuffers(1, &id);
|
alGenBuffers(1, &id);
|
||||||
if (!id)
|
if (id != null_resource && alIsBuffer(id)) {
|
||||||
throw std::runtime_error("sound: cannot generate buffer");
|
|
||||||
|
|
||||||
alBufferData(id, AL_FORMAT_MONO16, buf, si.frames * 2, rate);
|
alBufferData(id, AL_FORMAT_MONO16, buf, si.frames * 2, rate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ErrorLog("sound: failed to create AL buffer");
|
||||||
|
}
|
||||||
|
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
delete[] fbuf;
|
delete[] fbuf;
|
||||||
|
|||||||
Reference in New Issue
Block a user