mirror of
https://github.com/love2d/love-android.git
synced 2026-08-19 04:05:22 +02:00
updated to latest mobile-common branch of Löve
This commit is contained in:
@@ -165,15 +165,16 @@ love::audio::Source *Source::clone()
|
||||
return new Source(*this);
|
||||
}
|
||||
|
||||
void Source::play()
|
||||
bool Source::play()
|
||||
{
|
||||
if (valid && paused)
|
||||
{
|
||||
pool->resume(this);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
valid = pool->play(this, source);
|
||||
return valid;
|
||||
}
|
||||
|
||||
void Source::stop()
|
||||
@@ -512,7 +513,7 @@ bool Source::isLooping() const
|
||||
return looping;
|
||||
}
|
||||
|
||||
void Source::playAtomic()
|
||||
bool Source::playAtomic()
|
||||
{
|
||||
if (type == TYPE_STATIC)
|
||||
{
|
||||
@@ -539,10 +540,19 @@ void Source::playAtomic()
|
||||
// of the new one.
|
||||
reset();
|
||||
|
||||
// Clear errors.
|
||||
alGetError();
|
||||
|
||||
alSourcePlay(source);
|
||||
|
||||
// alSourcePlay may fail if the system has reached its limit of simultaneous
|
||||
// playing sources.
|
||||
bool success = alGetError() == AL_NO_ERROR;
|
||||
|
||||
valid = true; //if it fails it will be set to false again
|
||||
//but this prevents a horrible, horrible bug
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
void Source::stopAtomic()
|
||||
|
||||
Reference in New Issue
Block a user