mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32:45 +03:00
fix(sound): correct ready list logic in DoneLoadingCallback
This commit is contained in:
parent
6888c64279
commit
b2447e7197
@ -61,8 +61,6 @@ FMOD_RESULT DoneLoadingCallback(FMOD_SOUND* fmodSound, FMOD_RESULT callbackResul
|
|||||||
return FMOD_OK;
|
return FMOD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto internal = static_cast<SEDiskSound*>(lookup->m_internal);
|
|
||||||
|
|
||||||
if (callbackResult != FMOD_OK) {
|
if (callbackResult != FMOD_OK) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
@ -71,8 +69,8 @@ FMOD_RESULT DoneLoadingCallback(FMOD_SOUND* fmodSound, FMOD_RESULT callbackResul
|
|||||||
|
|
||||||
// Add to ready list (processed by SESound::Heartbeat)
|
// Add to ready list (processed by SESound::Heartbeat)
|
||||||
|
|
||||||
for (auto existing = SESound::s_InternalList.Head(); existing; existing = SESound::s_InternalList.Link(internal)->Next()) {
|
for (auto existing = SESound::s_InternalList.Head(); existing; existing = SESound::s_InternalList.Link(existing)->Next()) {
|
||||||
auto pendingLoad = internal->m_type == 1
|
auto pendingLoad = existing->m_type == 1
|
||||||
&& static_cast<SEDiskSound*>(existing)->m_fmodSound == reinterpret_cast<FMOD::Sound*>(fmodSound)
|
&& static_cast<SEDiskSound*>(existing)->m_fmodSound == reinterpret_cast<FMOD::Sound*>(fmodSound)
|
||||||
&& !existing->m_fmodChannel;
|
&& !existing->m_fmodChannel;
|
||||||
|
|
||||||
@ -87,8 +85,8 @@ FMOD_RESULT DoneLoadingCallback(FMOD_SOUND* fmodSound, FMOD_RESULT callbackResul
|
|||||||
|
|
||||||
// Mark cache sound node as loaded
|
// Mark cache sound node as loaded
|
||||||
|
|
||||||
if (internal->m_useCache) {
|
if (lookup->m_internal->m_useCache) {
|
||||||
internal->m_cacheNode->loaded = 1;
|
static_cast<SEDiskSound*>(lookup->m_internal)->m_cacheNode->loaded = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SESound::s_LoadingCritSect.Leave();
|
SESound::s_LoadingCritSect.Leave();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user