Fixed 'no music/sfx in VS when using optimisation' bug.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1584 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2008-02-24 23:02:56 +00:00
parent eced1729a4
commit cf3303367f

View File

@@ -39,7 +39,8 @@ SFXImpl::SFXImpl(const char* filename)
{
m_soundBuffer= 0;
m_soundSource= 0;
assert(load(filename));
bool ok=load(filename);
assert(ok);
}
//-----------------------------------------------------------------------------
@@ -53,6 +54,15 @@ SFXImpl::~SFXImpl()
void SFXImpl::play()
{
alSourcePlay(m_soundSource);
// Check (and clear) the error flag
int error = alGetError();
if(error != AL_NO_ERROR)
{
fprintf(stderr, "SFX OpenAL error: %d\n", error);
}
}
//-----------------------------------------------------------------------------