mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'gfx-work' into sim
This commit is contained in:
13
audio.cpp
13
audio.cpp
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user