diff options
author | Matthew Hoops | 2010-07-20 16:05:25 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-07-20 16:05:25 +0000 |
commit | 14c2fb2f08df8cb8e600734400ffc0c750cbcf7d (patch) | |
tree | c3f0132cc9f214c8e1f2380ab74fb0fda172b95e /engines/made/scriptfuncs.h | |
parent | 90d45aaa7d6aa0b63505e034430293c7b3fe352c (diff) | |
download | scummvm-rg350-14c2fb2f08df8cb8e600734400ffc0c750cbcf7d.tar.gz scummvm-rg350-14c2fb2f08df8cb8e600734400ffc0c750cbcf7d.tar.bz2 scummvm-rg350-14c2fb2f08df8cb8e600734400ffc0c750cbcf7d.zip |
Implement PlayNote/StopNote and PlayTele/StopTele for The Manhole.
svn-id: r51066
Diffstat (limited to 'engines/made/scriptfuncs.h')
-rw-r--r-- | engines/made/scriptfuncs.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h index 5fdfb77f45..3bed27c5c8 100644 --- a/engines/made/scriptfuncs.h +++ b/engines/made/scriptfuncs.h @@ -33,6 +33,10 @@ #include "made/resource.h" +namespace Audio { + class PCSpeaker; +} + namespace Made { class MadeEngine; @@ -41,17 +45,16 @@ typedef Common::Functor2<int16, int16*, int16> ExternalFunc; class ScriptFunctions { public: - ScriptFunctions(MadeEngine *vm) : _vm(vm), _soundStarted(false) {} - virtual ~ScriptFunctions() { - for (uint i = 0; i < _externalFuncs.size(); ++i) - delete _externalFuncs[i]; - } + ScriptFunctions(MadeEngine *vm); + virtual ~ScriptFunctions(); + int16 callFunction(uint16 index, int16 argc, int16 *argv) { if (index >= _externalFuncs.size()) error("ScriptFunctions::callFunction() Invalid function index %d", index); debug(4, "%s", _externalFuncNames[index]); return (*_externalFuncs[index])(argc, argv); } + void setupExternalsTable(); const char* getFuncName(int index) { return _externalFuncNames[index]; } int getCount() const { return _externalFuncs.size(); } @@ -64,6 +67,10 @@ protected: SoundResource* _soundResource; bool _soundStarted; + // PlayNote/StopNote and PlayTele/StopTele wave generators + Audio::SoundHandle _pcSpeakerHandle1, _pcSpeakerHandle2; + Audio::PCSpeaker *_pcSpeaker1, *_pcSpeaker2; + Common::Array<const ExternalFunc*> _externalFuncs; Common::Array<const char *> _externalFuncNames; GenericResource *_musicRes; |