diff options
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; |