mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 04:33:09 +00:00
EMI: Fix implementation of ImStateHasEnded.
This commit is contained in:
parent
2a8820bbee
commit
146af5a498
@ -111,8 +111,7 @@ void Lua_V2::ImStateHasEnded() {
|
||||
|
||||
int state = (int)lua_getnumber(stateObj);
|
||||
|
||||
// FIXME: Make sure this logic is correct.
|
||||
pushbool(g_imuseState != state);
|
||||
pushbool(g_emiSound->stateHasEnded(state));
|
||||
|
||||
Debug::debug(Debug::Sound | Debug::Scripts, "Lua_V2::ImStateHasEnded: state %d.", state);
|
||||
}
|
||||
|
@ -315,6 +315,15 @@ bool EMISound::stateHasLooped(int stateId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EMISound::stateHasEnded(int stateId) {
|
||||
if (stateId == _curMusicState) {
|
||||
if (_musicChannel != -1 && _channels[_musicChannel] != nullptr) {
|
||||
return !_channels[_musicChannel]->isPlaying();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void EMISound::setMusicState(int stateId) {
|
||||
Common::StackLock lock(_mutex);
|
||||
if (stateId == _curMusicState)
|
||||
|
@ -75,6 +75,7 @@ public:
|
||||
void selectMusicSet(int setId);
|
||||
|
||||
bool stateHasLooped(int stateId);
|
||||
bool stateHasEnded(int stateId);
|
||||
|
||||
void restoreState(SaveGame *savedState);
|
||||
void saveState(SaveGame *savedState);
|
||||
|
Loading…
x
Reference in New Issue
Block a user