mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 04:33:09 +00:00
DIRECTOR: System beep and Mouse Cursors.
This commit is contained in:
parent
3359ea9c99
commit
8c3c9df350
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
};
|
||||
|
@ -88,6 +88,60 @@ static const byte macCursorBeam[] = {
|
||||
3, 3, 0, 3, 0, 3, 3, 3, 3, 3, 3,
|
||||
0, 0, 3, 3, 3, 0, 0, 3, 3, 3, 3,
|
||||
};
|
||||
static const byte macCursorCrossHair[] = {
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
static const byte macCursorWatch[] = {
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
|
||||
1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1,
|
||||
1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
|
||||
1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
|
||||
0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0,
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
};
|
||||
static const byte macCursorCrossBar[] = {
|
||||
0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
|
||||
0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
|
||||
1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0,
|
||||
1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1,
|
||||
1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1,
|
||||
1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1,
|
||||
0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
MacWindowManager::MacWindowManager() {
|
||||
_screen = 0;
|
||||
@ -327,6 +381,22 @@ void MacWindowManager::pushArrowCursor() {
|
||||
CursorMan.pushCursor(macCursorArrow, 11, 16, 1, 1, 3);
|
||||
}
|
||||
|
||||
void MacWindowManager::pushBeamCursor() {
|
||||
CursorMan.pushCursor(macCursorBeam, 11, 16, 1, 1, 3);
|
||||
}
|
||||
|
||||
void MacWindowManager::pushCrossHairCursor() {
|
||||
CursorMan.pushCursor(macCursorCrossHair, 11, 16, 1, 1, 3);
|
||||
}
|
||||
|
||||
void MacWindowManager::pushCrossBarCursor() {
|
||||
CursorMan.pushCursor(macCursorCrossBar, 11, 16, 1, 1, 3);
|
||||
}
|
||||
|
||||
void MacWindowManager::pushWatchCursor() {
|
||||
CursorMan.pushCursor(macCursorWatch, 11, 16, 1, 1, 3);
|
||||
}
|
||||
|
||||
void MacWindowManager::popCursor() {
|
||||
CursorMan.popCursor();
|
||||
}
|
||||
|
@ -146,6 +146,10 @@ public:
|
||||
void drawFilledRoundRect(ManagedSurface *surface, Common::Rect &rect, int arc, int color);
|
||||
|
||||
void pushArrowCursor();
|
||||
void pushBeamCursor();
|
||||
void pushCrossHairCursor();
|
||||
void pushCrossBarCursor();
|
||||
void pushWatchCursor();
|
||||
void popCursor();
|
||||
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user