Rearrange alut error checking a bit

This commit is contained in:
ehofman
2009-12-29 09:47:04 +00:00
committed by Tim Moore
parent 4cc17a7f6e
commit 4950c96f1c

View File

@@ -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));