aboutsummaryrefslogtreecommitdiff
path: root/engines/made/scriptfuncs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/made/scriptfuncs.cpp')
-rw-r--r--engines/made/scriptfuncs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index 2e5636d908..88bd440c51 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -652,7 +652,8 @@ int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) {
if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle) && _vm->_soundEnergyArray) {
while (_vm->_soundEnergyIndex < _vm->_soundEnergyArray->size()) {
SoundEnergyItem *soundEnergyItem = &(*_vm->_soundEnergyArray)[_vm->_soundEnergyIndex];
- if (((_vm->_soundRate / 1000) * _vm->_mixer->getSoundElapsedTime(_audioStreamHandle)) < soundEnergyItem->position) {
+ const Audio::Timestamp ts = _vm->_mixer->getElapsedTime(_audioStreamHandle);
+ if (ts.convertToFramerate(_vm->_soundRate).totalNumberOfFrames() < soundEnergyItem->position) {
result = soundEnergyItem->energy;
break;
}