Rearrange alut error checking a bit
This commit is contained in:
@@ -554,8 +554,8 @@ bool SGSoundMgr::load(string &samplepath, void **dbuf, int *fmt,
|
||||
ALfloat freqf;
|
||||
data = alutLoadMemoryFromFile(samplepath.c_str(), &format, &size, &freqf );
|
||||
freq = (ALsizei)freqf;
|
||||
if (data == NULL) {
|
||||
int error = alutGetError();
|
||||
int error = alutGetError();
|
||||
if (data == NULL || error != ALUT_ERROR_NO_ERROR) {
|
||||
string msg = "Failed to load wav file: ";
|
||||
msg.append(alutGetErrorString(error));
|
||||
throw sg_io_exception(msg.c_str(), sg_location(samplepath));
|
||||
|
||||
Reference in New Issue
Block a user