Added beep sound to Nippon Safes for Amiga.

svn-id: r29171
This commit is contained in:
Nicola Mettifogo 2007-10-07 19:18:41 +00:00
parent 205b65ba11
commit 8a73ce38bb
6 changed files with 33 additions and 8 deletions

View File

@ -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)

View File

@ -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);
}

View File

@ -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;

View File

@ -407,4 +407,5 @@ JobOpcode* Parallaction_ns::createJobOpcode(uint functionId, Job *job) {
return new OpcodeImpl2<Parallaction_ns>(this, _jobsFn[functionId], job);
}
} // namespace Parallaction

View File

@ -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) {

View File

@ -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();