diff options
author | Benjamin Haisch | 2009-01-23 12:17:12 +0000 |
---|---|---|
committer | Benjamin Haisch | 2009-01-23 12:17:12 +0000 |
commit | a8562cf64bbb1e023680a6e113b5140590546127 (patch) | |
tree | 9a242f952f3056f2f3bf2aacd181c3595e4cef88 /engines/made | |
parent | 2d866c0483231a4814c7a7e6c11f303a4dfe6af2 (diff) | |
download | scummvm-rg350-a8562cf64bbb1e023680a6e113b5140590546127.tar.gz scummvm-rg350-a8562cf64bbb1e023680a6e113b5140590546127.tar.bz2 scummvm-rg350-a8562cf64bbb1e023680a6e113b5140590546127.zip |
- Implemented sfGetMusicBeat (used in several games as some kind of timer)
svn-id: r36023
Diffstat (limited to 'engines/made')
-rw-r--r-- | engines/made/made.h | 2 | ||||
-rw-r--r-- | engines/made/scriptfuncs.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/engines/made/made.h b/engines/made/made.h index f6044f29c6..0b66146e0b 100644 --- a/engines/made/made.h +++ b/engines/made/made.h @@ -119,6 +119,8 @@ public: bool _autoStopSound; uint _soundEnergyIndex; SoundEnergyArray *_soundEnergyArray; + + uint32 _musicBeatStart; int32 _timers[50]; int16 getTicks(); diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index 01ddcfcc04..bdd3da2adf 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -249,6 +249,8 @@ int16 ScriptFunctions::sfPlaySound(int16 argc, int16 *argv) { int16 ScriptFunctions::sfPlayMusic(int16 argc, int16 *argv) { int16 musicNum = argv[0]; + _vm->_musicBeatStart = _vm->_system->getMillis(); + if (_vm->getGameID() == GID_RTZ) { if (musicNum > 0) { _musicRes = _vm->_res->getXmidi(musicNum); @@ -337,11 +339,8 @@ int16 ScriptFunctions::sfShowMouseCursor(int16 argc, int16 *argv) { } int16 ScriptFunctions::sfGetMusicBeat(int16 argc, int16 *argv) { - // TODO - // This is called loads of times in the intro of the floppy version - // of RtZ. Not sure what it does. Commented out to reduce spam - //warning("Unimplemented opcode: sfGetMusicBeat"); - return 0; + // This is used as timer in some games + return (_vm->_system->getMillis() - _vm->_musicBeatStart) / 360; } int16 ScriptFunctions::sfSetScreenLock(int16 argc, int16 *argv) { |