diff options
author | stevenhoefel | 2017-01-09 09:31:48 +1100 |
---|---|---|
committer | Eugene Sandulenko | 2017-01-09 00:00:17 +0100 |
commit | 8c3c9df3508bdb18f0b083de93f0e88983660028 (patch) | |
tree | f062344c6d9358f4b6a7e6386c345a6a0be50ff6 /engines | |
parent | 3359ea9c99eba7f7e630a2b8057ec4df55fed83c (diff) | |
download | scummvm-rg350-8c3c9df3508bdb18f0b083de93f0e88983660028.tar.gz scummvm-rg350-8c3c9df3508bdb18f0b083de93f0e88983660028.tar.bz2 scummvm-rg350-8c3c9df3508bdb18f0b083de93f0e88983660028.zip |
DIRECTOR: System beep and Mouse Cursors.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 4 | ||||
-rw-r--r-- | engines/director/lingo/lingo-funcs.cpp | 35 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 4 | ||||
-rw-r--r-- | engines/director/sound.cpp | 10 | ||||
-rw-r--r-- | engines/director/sound.h | 4 |
5 files changed, 55 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 1d93b9ab44..a53601366d 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -615,7 +615,7 @@ void Lingo::b_alert(int nargs) { void Lingo::b_cursor(int nargs) { Datum d = g_lingo->pop(); d.toInt(); - warning("STUB: b_cursor(%d)", d.u.i); + g_lingo->func_cursor(d.u.i); } void Lingo::b_showGlobals(int nargs) { @@ -767,7 +767,7 @@ void Lingo::b_point(int nargs) { /////////////////// void Lingo::b_beep(int nargs) { Datum d = g_lingo->pop(); - warning("STUB: b_beep(%d)", d.u.i); + g_lingo->func_beep(d.u.i); } void Lingo::b_mci(int nargs) { diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index e22044c1e9..6becd1410d 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -26,6 +26,7 @@ #include "common/util.h" #include "director/lingo/lingo-gr.h" #include "director/sound.h" +#include "graphics/macgui/macwindowmanager.h" namespace Director { @@ -210,4 +211,38 @@ void Lingo::func_gotoprevious() { _vm->_currentScore->gotoprevious(); } +void Lingo::func_cursor(int c) { + if (_cursorOnStack) { + //pop cursor + _vm->getMacWindowManager()->popCursor(); + } + + //and then push cursor. + switch (c) { + case 0: + case -1: + _vm->getMacWindowManager()->pushArrowCursor(); + break; + case 1: + _vm->getMacWindowManager()->pushBeamCursor(); + break; + case 2: + _vm->getMacWindowManager()->pushCrossHairCursor(); + break; + case 3: + _vm->getMacWindowManager()->pushCrossBarCursor(); + break; + case 4: + _vm->getMacWindowManager()->pushWatchCursor(); + break; + } + + warning("STUB: func_cursor(%d)", c); +} + +void Lingo::func_beep(int repeats) { + for (int r = 0; r <= repeats; r++) + _vm->getSoundManager()->systemBeep(); +} + } diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 5e7242abe6..67ab57ae22 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -401,10 +401,12 @@ public: void func_mci(Common::String &s); void func_mciwait(Common::String &s); + void func_beep(int repeats); void func_goto(Datum &frame, Datum &movie); void func_gotoloop(); void func_gotonext(); void func_gotoprevious(); + void func_cursor(int c); public: void setTheEntity(int entity, Datum &id, int field, Datum &d); @@ -440,6 +442,8 @@ public: bool _exitRepeat; + bool _cursorOnStack; + private: int parse(const char *code); void parseMenu(const char *code); diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp index 1bd70d257d..0fc1a43666 100644 --- a/engines/director/sound.cpp +++ b/engines/director/sound.cpp @@ -34,6 +34,11 @@ DirectorSound::DirectorSound() { _sound2 = new Audio::SoundHandle(); _scriptSound = new Audio::SoundHandle(); _mixer = g_system->getMixer(); + + _speaker = new Audio::PCSpeaker(); + _pcSpeakerHandle = new Audio::SoundHandle(); + _mixer->playStream(Audio::Mixer::kSFXSoundType, + _pcSpeakerHandle, _speaker, -1, 50, 0, DisposeAfterUse::NO, true); } DirectorSound::~DirectorSound() { @@ -100,6 +105,11 @@ bool DirectorSound::isChannelActive(uint8 channelID) { void DirectorSound::stopSound() { _mixer->stopHandle(*_sound1); _mixer->stopHandle(*_sound2); + _mixer->stopHandle(*_pcSpeakerHandle); +} + +void DirectorSound::systemBeep() { + _speaker->play(Audio::PCSpeaker::kWaveFormSquare, 500, 150); } } // End of namespace Director diff --git a/engines/director/sound.h b/engines/director/sound.h index 0472da0ef7..6a770314a3 100644 --- a/engines/director/sound.h +++ b/engines/director/sound.h @@ -22,6 +22,7 @@ #include "audio/audiostream.h" #include "audio/mixer.h" +#include "audio/softsynth/pcspk.h" #ifndef DIRECTOR_SOUND_H #define DIRECTOR_SOUND_H @@ -35,6 +36,8 @@ private: Audio::SoundHandle *_sound2; Audio::SoundHandle *_scriptSound; Audio::Mixer *_mixer; + Audio::PCSpeaker *_speaker; + Audio::SoundHandle *_pcSpeakerHandle; public: DirectorSound(); @@ -43,6 +46,7 @@ public: void playWAV(Common::String filename, uint8 channelID); void playAIFF(Common::String filename, uint8 channelID); void playMCI(Audio::AudioStream &stream, uint32 from, uint32 to); + void systemBeep(); bool isChannelActive(uint8 channelID); void stopSound(); }; |