diff options
author | Nicola Mettifogo | 2007-10-07 19:18:41 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-10-07 19:18:41 +0000 |
commit | 8a73ce38bbc2c205fb67e274d0c3304b460b9a53 (patch) | |
tree | c03524371f8862fb2bd64b1b424a921aa7974cb4 /engines | |
parent | 205b65ba115581b54e38c1ae8aef10c76fbdab65 (diff) | |
download | scummvm-rg350-8a73ce38bbc2c205fb67e274d0c3304b460b9a53.tar.gz scummvm-rg350-8a73ce38bbc2c205fb67e274d0c3304b460b9a53.tar.bz2 scummvm-rg350-8a73ce38bbc2c205fb67e274d0c3304b460b9a53.zip |
Added beep sound to Nippon Safes for Amiga.
svn-id: r29171
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/menu.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 5 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 1 | ||||
-rw-r--r-- | engines/parallaction/sound.cpp | 27 | ||||
-rw-r--r-- | engines/parallaction/sound.h | 2 |
6 files changed, 33 insertions, 8 deletions
diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp index d0c18bd43b..62f9bd98e5 100644 --- a/engines/parallaction/menu.cpp +++ b/engines/parallaction/menu.cpp @@ -212,7 +212,7 @@ uint16 Menu::chooseLanguage() { if (128 + _si * 49 <= _vm->_mousePos.x) continue; if (180 - _si * 25 <= _vm->_mousePos.y) continue; -// beep(); + _vm->beep(); switch (_si) { case 0: @@ -368,7 +368,7 @@ void Menu::selectCharacter() { if (_si != -1) { _vm->_gfx->grabRect((byte*)v14.pixels, r, Gfx::kBitFront, BLOCK_WIDTH); _vm->_gfx->flatBlitCnv(&v14, _di * SLOT_WIDTH + SLOT_X, SLOT_Y, Gfx::kBitFront); -// beep(); + _vm->beep(); if (_vm->getPlatform() == Common::kPlatformAmiga && (_vm->getFeatures() & GF_LANG_MULT)) { if (_amigaDinoKey[_di] == _si) diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 2399a7b2dc..e1e66d3b83 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -547,7 +547,7 @@ Parallaction::InputData *Parallaction::translateInput() { } } -// beep(); + beep(); setArrowCursor(); return &_input; } @@ -1142,6 +1142,9 @@ const char *Character::getFullName() const { } +void Parallaction::beep() { + _soundMan->playSfx("beep", 3, false); +} diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 9173e143b3..4b6022b39a 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -580,6 +580,7 @@ public: virtual void jobEraseLabel(void *parm, Job *j) = 0; virtual void jobWaitRemoveJob(void *parm, Job *j) = 0; + void beep(); public: const char **_zoneFlagNamesRes; @@ -789,7 +790,6 @@ protected: void initOpcodes(); void initParsers(); - // program parser OpcodeSet _instructionParsers; Table *_instructionNames; diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 6df2172557..c2c2f2b0a4 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -407,4 +407,5 @@ JobOpcode* Parallaction_ns::createJobOpcode(uint functionId, Job *job) { return new OpcodeImpl2<Parallaction_ns>(this, _jobsFn[functionId], job); } + } // namespace Parallaction diff --git a/engines/parallaction/sound.cpp b/engines/parallaction/sound.cpp index 605a71bbdd..4d4386b642 100644 --- a/engines/parallaction/sound.cpp +++ b/engines/parallaction/sound.cpp @@ -318,6 +318,28 @@ AmigaSoundMan::~AmigaSoundMan() { stopSfx(3); } +static byte res_amigaBeep[] = { + 0, 20, 40, 60, 80, 60, 40, 20, 0, 236, 216, 196, 176, 196, 216, 236 +}; + +void AmigaSoundMan::loadChannelData(const char *filename, Channel *ch) { + if (!scumm_stricmp("beep", filename)) { + ch->header.oneShotHiSamples = 0; + ch->header.repeatHiSamples = 0; + ch->header.samplesPerHiCycle = 0; + ch->header.samplesPerSec = 12000; + ch->header.volume = 255; + ch->data = res_amigaBeep; + ch->dataSize = 16; + return; + } + + Common::ReadStream *stream = _vm->_disk->loadSound(filename); + Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize); + decoder.decode(); + delete stream; +} + void AmigaSoundMan::playSfx(const char *filename, uint channel, bool looping, int volume, int rate) { if (channel >= NUM_AMIGA_CHANNELS) { warning("unknown sfx channel"); @@ -327,10 +349,7 @@ void AmigaSoundMan::playSfx(const char *filename, uint channel, bool looping, in debugC(1, kDebugAudio, "AmigaSoundMan::playSfx(%s, %i)", filename, channel); Channel *ch = &_channels[channel]; - Common::ReadStream *stream = _vm->_disk->loadSound(filename); - Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize); - decoder.decode(); - delete stream; + loadChannelData(filename, ch); uint32 loopStart, loopEnd, flags; if (looping) { diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h index f8f1a9e6b0..051cb25995 100644 --- a/engines/parallaction/sound.h +++ b/engines/parallaction/sound.h @@ -95,6 +95,8 @@ class AmigaSoundMan : public SoundMan { uint32 flags; } _channels[NUM_AMIGA_CHANNELS]; + void loadChannelData(const char *filename, Channel *ch); + public: AmigaSoundMan(Parallaction *vm); ~AmigaSoundMan(); |