diff options
author | Gregory Montoir | 2009-06-14 15:07:34 +0000 |
---|---|---|
committer | Gregory Montoir | 2009-06-14 15:07:34 +0000 |
commit | 5a03e5cca1837ecf18b4dde856a0c6d32392e3c3 (patch) | |
tree | cf6574df0a855d3bd8b6faec20d1a17f25cfab9e | |
parent | 7c5d739ba7591c9448d1968b39a8a565b7dee3a2 (diff) | |
download | scummvm-rg350-5a03e5cca1837ecf18b4dde856a0c6d32392e3c3.tar.gz scummvm-rg350-5a03e5cca1837ecf18b4dde856a0c6d32392e3c3.tar.bz2 scummvm-rg350-5a03e5cca1837ecf18b4dde856a0c6d32392e3c3.zip |
simplified .raw/.wav data files handling in introduction sequences
svn-id: r41520
-rw-r--r-- | engines/tucker/locations.cpp | 18 | ||||
-rw-r--r-- | engines/tucker/resource.cpp | 1 | ||||
-rw-r--r-- | engines/tucker/sequences.cpp | 87 | ||||
-rw-r--r-- | engines/tucker/staticres.cpp | 458 | ||||
-rw-r--r-- | engines/tucker/tucker.cpp | 3 | ||||
-rw-r--r-- | engines/tucker/tucker.h | 32 |
6 files changed, 233 insertions, 366 deletions
diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index ec60086abf..9faa2024a6 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -650,21 +650,17 @@ void TuckerEngine::execData3PostUpdate_locationNum8() { if (_execData3Counter > 30) { _updateLocationYPosTable2[0] = 16; _updateLocationXPosTable2[0] = 264; - } } if (_updateLocationYPosTable2[0] > 0) { const int offset = _updateLocationYPosTable2[0] * 640 + _updateLocationXPosTable2[0]; - _locationBackgroundGfxBuf[offset] = 142; - _locationBackgroundGfxBuf[offset + 640 - 1] = 143; - _locationBackgroundGfxBuf[offset + 640] = 143; - _locationBackgroundGfxBuf[offset + 640 + 1] = 144; - _locationBackgroundGfxBuf[offset + 640 * 2 - 1] = 144; - _locationBackgroundGfxBuf[offset + 640 * 2] = 144; - _locationBackgroundGfxBuf[offset + 640 * 2 + 1] = 145; - _locationBackgroundGfxBuf[offset + 640 * 3 - 1] = 147; - _locationBackgroundGfxBuf[offset + 640 * 3] = 143; - _locationBackgroundGfxBuf[offset + 640 * 3 + 1] = 147; + static const int colorsTable[] = { 143, 143, 144, 144, 144, 145, 147, 143, 147 }; + _locationBackgroundGfxBuf[offset] = 142; + for (int j = 1; j <= 3; ++j) { + for (int i = -1; i <= 1; ++i) { + _locationBackgroundGfxBuf[offset + 640 * j + i] = colorsTable[(j - 1) * 3 + i + 1]; + } + } addDirtyRect(_updateLocationXPosTable2[0] - 1, _updateLocationYPosTable2[0], 3, 4); _updateLocationYPosTable2[0] += 2; if (_updateLocationYPosTable2[0] > 120) { diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 1195fe4894..11c1c78133 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -218,6 +218,7 @@ void TuckerEngine::openCompressedSoundFile() { int version = _fCompressedSound.readUint16LE(); if (version == kCurrentCompressedSoundDataVersion) { _compressedSoundType = i; + debug(1, "Using compressed sound file '%s'", compressedSoundFilesTable[i].filename); return; } warning("Unhandled version %d for compressed sound file '%s'", version, compressedSoundFilesTable[i].filename); diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index d977813a31..11a535e54a 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -494,13 +494,9 @@ int TuckerEngine::handleSpecialObjectSelectionSequence() { AnimationSequencePlayer::AnimationSequencePlayer(OSystem *system, Audio::Mixer *mixer, Common::EventManager *event, int num) : _system(system), _mixer(mixer), _event(event), _seqNum(num) { memset(_animationPalette, 0, sizeof(_animationPalette)); - _soundSeqDataOffset = 0; _soundSeqDataCount = 0; _soundSeqDataIndex = 0; - _soundsList1Offset = 0; - _soundsList1Count = 0; - _soundsList2Offset = 0; - _soundsList2Count = 0; + _soundSeqData = 0; _offscreenBuffer = (uint8 *)malloc(kScreenWidth * kScreenHeight); _updateScreenWidth = 0; _updateScreenPicture = false; @@ -589,20 +585,9 @@ void AnimationSequencePlayer::syncTime() { } Audio::AudioStream *AnimationSequencePlayer::loadSoundFileAsStream(int index, AnimationSoundType type) { - const char *name = 0; - switch (type) { - case kAnimationSoundType8BitsRAW: - case kAnimationSoundType16BitsRAW: - name = _musicFileNamesTable[index]; - break; - case kAnimationSoundTypeWAV: - case kAnimationSoundTypeLoopingWAV: - name = _audioFileNamesTable[index]; - break; - } Audio::AudioStream *stream = 0; char fileName[64]; - snprintf(fileName, sizeof(fileName), "audio/%s", name); + snprintf(fileName, sizeof(fileName), "audio/%s", _audioFileNamesTable[index]); Common::File f; if (f.open(fileName)) { int size = 0, rate = 0; @@ -637,88 +622,53 @@ Audio::AudioStream *AnimationSequencePlayer::loadSoundFileAsStream(int index, An return stream; } -enum { - kSoundsList_Seq3_4, - kSoundsList_Seq9_10, - kSoundsList_Seq21_20, - kSoundsList_Seq13_14, - kSoundsList_Seq15_16, - kSoundsList_Seq27_28, - kSoundsList_Seq17_18, - kSoundsList_Seq19_20 -}; - void AnimationSequencePlayer::loadSounds(int num) { - static const int soundsList[][8] = { - { 1, 0, 14, 0, 10, 14, 58, 0 }, - { 1, 0, 14, 24, 5, 38, 60, 58 }, - { 1, 0, 14, 43, 9, 57, 48, 118 }, - { 6, 80, 14, 79, 4, 93, 25, 185 }, - { 7, 80, 13, 97, 9, 110, 43, 210 }, - { 10, 80, 11, 119, 0, 0, 11, 253 }, - { 8, 100, 0, 0, 0, 0, 0, 0 }, - { 0, 100, 4, 146, 0, 0, 7, 300 } - }; - int musicIndex = soundsList[num][0]; - int musicVolume = soundsList[num][1]; - _soundsList1Count = soundsList[num][2]; - _soundsList1Offset = soundsList[num][3]; - _soundsList2Count = soundsList[num][4]; - _soundsList2Offset = soundsList[num][5]; - _soundSeqDataCount = soundsList[num][6]; - _soundSeqDataOffset = soundsList[num][7]; - if (musicVolume != 0) { + if (_soundSeqDataList[num].musicVolume != 0) { Audio::AudioStream *s; - if ((s = loadSoundFileAsStream(musicIndex, kAnimationSoundType8BitsRAW)) != 0) { - _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, s, -1, scaleMixerVolume(musicVolume)); + if ((s = loadSoundFileAsStream(_soundSeqDataList[num].musicIndex, kAnimationSoundType8BitsRAW)) != 0) { + _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, s, -1, scaleMixerVolume(_soundSeqDataList[num].musicVolume)); } } _soundSeqDataIndex = 0; + _soundSeqDataCount = _soundSeqDataList[num].soundSeqDataCount; + _soundSeqData = _soundSeqDataList[num].soundSeqData; } void AnimationSequencePlayer::updateSounds() { Audio::AudioStream *s = 0; - const SoundSequenceData *p = &_soundSeqData[_soundSeqDataOffset + _soundSeqDataIndex]; + const SoundSequenceData *p = &_soundSeqData[_soundSeqDataIndex]; while (_soundSeqDataIndex < _soundSeqDataCount && p->timestamp <= _frameCounter) { switch (p->opcode) { case 0: - if (p->index < _soundsList1Count) { - if ((s = loadSoundFileAsStream(_soundsList1Offset + p->index, kAnimationSoundTypeWAV)) != 0) { - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], s, -1, scaleMixerVolume(p->volume)); - } + if ((s = loadSoundFileAsStream(p->num, kAnimationSoundTypeWAV)) != 0) { + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], s, -1, scaleMixerVolume(p->volume)); } break; case 1: - if (p->index < _soundsList1Count) { - if ((s = loadSoundFileAsStream(_soundsList1Offset + p->index, kAnimationSoundTypeLoopingWAV)) != 0) { - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], s, -1, scaleMixerVolume(p->volume)); - } + if ((s = loadSoundFileAsStream(p->num, kAnimationSoundTypeLoopingWAV)) != 0) { + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], s, -1, scaleMixerVolume(p->volume)); } break; case 2: - if (p->index < _soundsList1Count) { - _mixer->stopHandle(_soundsHandle[p->index]); - } + _mixer->stopHandle(_soundsHandle[p->index]); break; case 3: _mixer->stopHandle(_musicHandle); break; case 4: _mixer->stopHandle(_musicHandle); - if ((s = loadSoundFileAsStream(p->index, kAnimationSoundType8BitsRAW)) != 0) { + if ((s = loadSoundFileAsStream(p->num, kAnimationSoundType8BitsRAW)) != 0) { _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, s, -1, scaleMixerVolume(p->volume)); } break; case 5: - if (p->index < _soundsList2Count) { - if ((s = loadSoundFileAsStream(_soundsList2Offset + p->index, kAnimationSoundTypeWAV)) != 0) { - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, s, -1, scaleMixerVolume(p->volume)); - } + if ((s = loadSoundFileAsStream(p->num, kAnimationSoundTypeWAV)) != 0) { + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, s, -1, scaleMixerVolume(p->volume)); } break; case 6: _mixer->stopHandle(_musicHandle); - if ((s = loadSoundFileAsStream(p->index, kAnimationSoundType16BitsRAW)) != 0) { + if ((s = loadSoundFileAsStream(p->num, kAnimationSoundType16BitsRAW)) != 0) { _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, s, -1, scaleMixerVolume(p->volume)); } break; @@ -796,8 +746,7 @@ uint8 *AnimationSequencePlayer::loadPicture(const char *fileName) { } void AnimationSequencePlayer::getRGBPalette(int index) { - byte rgbPalette[3 * 256]; - memcpy(rgbPalette, _flicPlayer[index].getPalette(), 3 * 256); + const byte *rgbPalette = _flicPlayer[index].getPalette(); for (int i = 0; i < 256; i++) { _animationPalette[i * 4 + 0] = rgbPalette[i * 3 + 0]; _animationPalette[i * 4 + 1] = rgbPalette[i * 3 + 1]; diff --git a/engines/tucker/staticres.cpp b/engines/tucker/staticres.cpp index 62472e2704..b663fb38da 100644 --- a/engines/tucker/staticres.cpp +++ b/engines/tucker/staticres.cpp @@ -246,138 +246,181 @@ const uint8 TuckerEngine::_charWidthCharset2[58] = { 0x13, 0x12, 0x10, 0x11, 0x13, 0x14, 0x14, 0x10, 0x13, 0x10, }; -const SoundSequenceData AnimationSequencePlayer::_soundSeqData[] = { - { 16, 3, 1, 100 }, { 18, 5, 1, 100 }, { 26, 9, 5, 100 }, { 74, 9, 0, 100 }, - { 118, 10, 0, 100 }, { 139, 9, 0, 100 }, { 140, 10, 2, 100 }, { 144, 5, 2, 100 }, - { 146, 3, 2, 100 }, { 147, 9, 2, 100 }, { 148, 2, 1, 100 }, { 156, 0, 1, 50 }, - { 158, 4, 5, 100 }, { 188, 4, 5, 100 }, { 212, 2, 2, 100 }, { 223, 1, 0, 100 }, - { 230, 1, 2, 100 }, { 234, 1, 0, 100 }, { 251, 1, 0, 100 }, { 265, 11, 6, 80 }, - { 293, 5, 1, 80 }, { 295, 12, 6, 80 }, { 343, 13, 6, 110 }, { 373, 14, 6, 80 }, - { 429, 5, 2, 100 }, { 431, 15, 6, 80 }, { 456, 2, 1, 100 }, { 457, 1, 5, 100 }, - { 463, 0, 5, 100 }, { 482, 2, 2, 100 }, { 483, 8, 1, 100 }, { 494, 8, 5, 100 }, - { 507, 7, 5, 100 }, { 511, 7, 5, 100 }, { 522, 13, 1, 100 }, { 547, 6, 5, 100 }, - { 548, 11, 0, 100 }, { 556, 12, 0, 100 }, { 557, 2, 5, 100 }, { 599, 7, 1, 100 }, - { 639, 7, 2, 100 }, { 641, 12, 0, 100 }, { 642, 7, 5, 100 }, { 718, 14, 2, 100 }, - { 719, 1, 2, 100 }, { 720, 2, 2, 100 }, { 721, 3, 2, 100 }, { 722, 4, 2, 100 }, - { 723, 5, 2, 100 }, { 724, 6, 2, 100 }, { 725, 7, 2, 100 }, { 726, 8, 2, 100 }, - { 727, 9, 2, 100 }, { 728, 10, 2, 100 }, { 729, 11, 2, 100 }, { 730, 12, 2, 100 }, - { 731, 0, 2, 100 }, { 732, 13, 2, 100 }, - // count 2,58 - // offset 3,58 - { 2, 0, 3, 100 }, { 3, 2, 0, 100 }, { 3, 5, 1, 20 }, { 6, 25, 6, 80 }, - { 22, 1, 5, 100 }, { 37, 29, 6, 80 }, { 59, 30, 6, 80 }, { 69, 26, 6, 80 }, - { 124, 27, 6, 80 }, { 163, 28, 6, 80 }, { 197, 31, 6, 80 }, { 224, 32, 6, 80 }, - { 306, 33, 6, 80 }, { 350, 34, 6, 80 }, { 388, 8, 0, 100 }, { 389, 6, 1, 100 }, - { 390, 9, 1, 100 }, { 395, 10, 0, 100 }, { 398, 3, 0, 100 }, { 408, 3, 0, 100 }, - { 413, 4, 0, 100 }, { 418, 3, 0, 100 }, { 426, 6, 2, 100 }, { 427, 9, 2, 100 }, - { 430, 35, 6, 80 }, { 472, 36, 6, 80 }, { 514, 9, 1, 100 }, { 515, 7, 0, 100 }, - { 516, 6, 1, 100 }, { 517, 4, 0, 100 }, { 520, 11, 0, 100 }, { 523, 3, 0, 100 }, - { 531, 7, 2, 100 }, { 532, 9, 2, 100 }, { 533, 6, 2, 100 }, { 534, 3, 0, 100 }, - { 535, 37, 6, 80 }, { 553, 38, 6, 80 }, { 569, 39, 6, 80 }, { 588, 40, 6, 80 }, - { 662, 41, 6, 80 }, { 777, 42, 6, 80 }, { 978, 1, 0, 100 }, { 1008, 12, 0, 100 }, - { 1011, 4, 5, 100 }, { 1022, 52, 6, 80 }, { 1039, 3, 5, 100 }, { 1045, 3, 5, 100 }, - { 1051, 3, 5, 100 }, { 1057, 3, 5, 100 }, { 1063, 3, 5, 100 }, { 1066, 3, 5, 40 }, - { 1074, 43, 6, 80 }, { 1256, 44, 6, 80 }, { 1322, 45, 6, 80 }, { 1373, 46, 6, 80 }, - { 1419, 47, 6, 80 }, { 1792, 13, 0, 100 }, { 1793, 0, 5, 100 }, { 1895, 51, 6, 80 }, - // count 3,60 - // offset 4,118 - { 2, 0, 3, 100 }, { 4, 3, 1, 40 }, { 5, 7, 1, 20 }, { 7, 3, 5, 100 }, - { 62, 3, 2, 100 }, { 63, 48, 6, 80 }, { 198, 7, 2, 100 }, { 202, 5, 1, 100 }, - { 203, 16, 6, 80 }, { 211, 1, 5, 100 }, { 216, 0, 1, 40 }, { 217, 5, 2, 100 }, - { 218, 6, 1, 100 }, { 224, 2, 5, 100 }, { 229, 17, 6, 80 }, { 273, 6, 2, 100 }, - { 274, 4, 1, 100 }, { 275, 4, 5, 100 }, { 335, 1, 1, 100 }, { 336, 13, 0, 100 }, - { 339, 11, 0, 100 }, { 358, 0, 5, 100 }, { 364, 24, 4, 100 }, { 397, 7, 5, 100 }, - { 399, 6, 5, 100 }, { 433, 5, 5, 100 }, { 451, 13, 0, 100 }, { 459, 1, 2, 100 }, - { 508, 4, 2, 100 }, { 509, 1, 1, 100 }, { 521, 11, 0, 100 }, { 530, 8, 0, 100 }, - { 537, 9, 0, 100 }, { 557, 8, 5, 100 }, { 578, 5, 5, 100 }, { 602, 13, 0, 100 }, - { 609, 1, 2, 100 }, { 626, 12, 0, 100 }, { 628, 10, 0, 100 }, { 670, 6, 5, 100 }, - { 690, 10, 0, 100 }, { 692, 3, 5, 100 }, { 705, 11, 0, 100 }, { 710, 2, 5, 100 }, - { 714, 9, 0, 100 }, { 720, 9, 2, 100 }, { 721, 7, 5, 100 }, { 725, 0, 5, 100 }, - // count 4,48 - // offset 5,166 - { 3, 8, 0, 100 }, { 43, 11, 0, 100 }, { 68, 5, 1, 100 }, { 100, 5, 2, 100 }, - { 104, 6, 0, 100 }, { 139, 7, 0, 100 }, { 192, 3, 0, 100 }, { 199, 4, 0, 100 }, - { 207, 4, 0, 100 }, { 208, 2, 0, 100 }, { 254, 0, 0, 100 }, { 260, 0, 0, 100 }, - { 266, 0, 0, 100 }, { 272, 0, 0, 100 }, { 276, 0, 0, 100 }, { 282, 1, 0, 100 }, - { 303, 10, 0, 100 }, { 319, 12, 0, 100 }, { 355, 9, 0, 100 }, - // count 5,19 - // offset 6,185 - { 3, 0, 1, 100 }, { 34, 0, 2, 100 }, { 57, 0, 5, 100 }, { 77, 0, 5, 100 }, - { 84, 9, 0, 100 }, { 100, 9, 0, 100 }, { 140, 3, 5, 100 }, { 157, 2, 5, 100 }, - { 158, 1, 0, 100 }, { 204, 1, 5, 100 }, { 220, 2, 1, 100 }, { 235, 7, 0, 100 }, - { 236, 2, 2, 100 }, { 248, 12, 0, 100 }, { 251, 13, 0, 100 }, { 265, 11, 0, 100 }, - { 276, 11, 0, 100 }, { 310, 5, 0, 100 }, { 335, 6, 0, 100 }, { 370, 4, 0, 100 }, - { 373, 8, 0, 100 }, { 378, 8, 0, 100 }, { 434, 10, 0, 100 }, { 453, 3, 0, 100 }, - { 484, 3, 2, 100 }, - // count 6,25 - // offset 7,210 - { 3, 4, 5, 100 }, { 10, 5, 5, 100 }, { 22, 6, 5, 100 }, { 32, 7, 5, 100 }, - { 39, 6, 5, 100 }, { 48, 7, 5, 100 }, { 57, 6, 5, 100 }, { 65, 3, 0, 50 }, - { 102, 4, 0, 50 }, { 151, 2, 5, 50 }, { 205, 3, 5, 100 }, { 218, 0, 5, 100 }, - { 227, 0, 5, 100 }, { 236, 0, 5, 100 }, { 245, 0, 5, 100 }, { 254, 0, 5, 100 }, - { 263, 0, 5, 100 }, { 272, 0, 5, 100 }, { 291, 1, 1, 40 }, { 309, 8, 5, 100 }, - { 360, 8, 5, 100 }, { 384, 2, 1, 60 }, { 398, 10, 0, 100 }, { 440, 2, 2, 100 }, - { 441, 1, 2, 100 }, { 452, 11, 0, 100 }, { 466, 1, 5, 100 }, { 470, 8, 0, 100 }, - { 503, 6, 0, 100 }, { 519, 7, 0, 100 }, { 536, 8, 0, 100 }, { 538, 4, 5, 100 }, - { 549, 5, 5, 100 }, { 558, 4, 5, 100 }, { 568, 5, 5, 100 }, { 578, 4, 5, 100 }, - { 586, 5, 5, 100 }, { 593, 4, 5, 100 }, { 600, 5, 5, 100 }, { 606, 4, 5, 100 }, - { 613, 5, 5, 100 }, { 620, 9, 0, 100 }, { 630, 12, 0, 100 }, - // count 7,43 - // offset 8,253 - { 17, 2, 0, 100 }, { 57, 8, 0, 100 }, { 62, 10, 0, 100 }, { 67, 9, 0, 100 }, - { 74, 3, 1, 100 }, { 87, 3, 2, 100 }, { 85, 0, 0, 100 }, { 138, 5, 0, 100 }, - { 196, 7, 0, 100 }, { 222, 6, 0, 100 }, { 228, 1, 0, 100 }, - // count 8,11 - // offset 9,264 - { 20, 4, 0, 100 }, { 132, 0, 0, 100 }, { 145, 0, 2, 100 }, { 171, 1, 0, 100 }, - { 315, 2, 0, 50 }, { 334, 3, 0, 100 }, { 602, 5, 0, 50 }, { 631, 5, 0, 50 }, - { 660, 5, 0, 50 }, { 767, 5, 0, 50 }, { 795, 5, 0, 50 }, { 824, 5, 0, 50 }, - // count 9,12 - // offset 10,276 - { 4, 8, 1, 100 }, { 5, 6, 0, 100 }, { 47, 8, 2, 100 }, { 125, 8, 1, 100 }, - { 126, 6, 0, 100 }, { 156, 8, 2, 100 }, { 168, 2, 0, 100 }, { 174, 2, 0, 100 }, - { 180, 2, 0, 100 }, { 186, 2, 0, 100 }, { 192, 2, 0, 100 }, { 267, 2, 0, 100 }, - { 273, 2, 0, 100 }, { 279, 2, 0, 100 }, { 285, 2, 0, 100 }, { 291, 2, 0, 100 }, - { 297, 2, 0, 100 }, { 302, 0, 0, 100 }, { 417, 1, 0, 100 }, { 472, 5, 0, 100 }, - { 600, 5, 0, 100 }, { 623, 3, 0, 100 }, { 643, 9, 0, 100 }, { 781, 4, 0, 80 }, - // count 10,24 - // offset 11,300 - { 2, 0, 3, 100 }, { 3, 0, 1, 100 }, { 33, 0, 2, 100 }, { 33, 1, 0, 100 }, - { 53, 2, 1, 100 }, { 78, 2, 2, 100 }, { 80, 0, 4, 100 } - // count 11,7 +static const SoundSequenceData _soundDataSeq3_4[] = { + { 16, 3, 33, 100, 1 }, { 18, 5, 34, 100, 1 }, { 26, 9, 16, 100, 5 }, { 74, 9, 35, 100, 0 }, + { 118, 10, 36, 100, 0 }, { 139, 9, 35, 100, 0 }, { 140, 10, 0, 100, 2 }, { 144, 5, 0, 100, 2 }, + { 146, 3, 0, 100, 2 }, { 147, 9, 0, 100, 2 }, { 148, 2, 30, 100, 1 }, { 156, 0, 103, 50, 1 }, + { 158, 4, 31, 100, 5 }, { 188, 4, 31, 100, 5 }, { 212, 2, 0, 100, 2 }, { 223, 1, 20, 100, 0 }, + { 230, 1, 0, 100, 2 }, { 234, 1, 20, 100, 0 }, { 251, 1, 20, 100, 0 }, { 265, 11, 69, 80, 6 }, + { 293, 5, 34, 80, 1 }, { 295, 12, 76, 80, 6 }, { 343, 13, 87, 110, 6 }, { 373, 14, 97, 80, 6 }, + { 429, 5, 0, 100, 2 }, { 431, 15, 100, 80, 6 }, { 456, 2, 30, 100, 1 }, { 457, 1, 19, 100, 5 }, + { 463, 0, 18, 100, 5 }, { 482, 2, 0, 100, 2 }, { 483, 8, 40, 100, 1 }, { 494, 8, 37, 100, 5 }, + { 507, 7, 17, 100, 5 }, { 511, 7, 17, 100, 5 }, { 522, 13, 21, 100, 1 }, { 547, 6, 49, 100, 5 }, + { 548, 11, 48, 100, 0 }, { 556, 12, 38, 100, 0 }, { 557, 2, 23, 100, 5 }, { 599, 7, 39, 100, 1 }, + { 639, 7, 0, 100, 2 }, { 641, 12, 38, 100, 0 }, { 642, 7, 17, 100, 5 }, { 718, 14, 0, 100, 2 }, + { 719, 1, 0, 100, 2 }, { 720, 2, 0, 100, 2 }, { 721, 3, 0, 100, 2 }, { 722, 4, 0, 100, 2 }, + { 723, 5, 0, 100, 2 }, { 724, 6, 0, 100, 2 }, { 725, 7, 0, 100, 2 }, { 726, 8, 0, 100, 2 }, + { 727, 9, 0, 100, 2 }, { 728, 10, 0, 100, 2 }, { 729, 11, 0, 100, 2 }, { 730, 12, 0, 100, 2 }, + { 731, 0, 0, 100, 2 }, { 732, 13, 0, 100, 2 }, }; -const char *AnimationSequencePlayer::_musicFileNamesTable[] = { +static const SoundSequenceData _soundDataSeq9_10[] = { + { 2, 0, 0, 100, 3 }, { 3, 2, 32, 100, 0 }, { 3, 5, 54, 20, 1 }, { 6, 25, 71, 80, 6 }, + { 22, 1, 18, 100, 5 }, { 37, 29, 75, 80, 6 }, { 59, 30, 77, 80, 6 }, { 69, 26, 72, 80, 6 }, + { 124, 27, 73, 80, 6 }, { 163, 28, 74, 80, 6 }, { 197, 31, 78, 80, 6 }, { 224, 32, 79, 80, 6 }, + { 306, 33, 80, 80, 6 }, { 350, 34, 81, 80, 6 }, { 388, 8, 57, 100, 0 }, { 389, 6, 55, 100, 1 }, + { 390, 9, 58, 100, 1 }, { 395, 10, 59, 100, 0 }, { 398, 3, 52, 100, 0 }, { 408, 3, 52, 100, 0 }, + { 413, 4, 53, 100, 0 }, { 418, 3, 52, 100, 0 }, { 426, 6, 0, 100, 2 }, { 427, 9, 0, 100, 2 }, + { 430, 35, 82, 80, 6 }, { 472, 36, 83, 80, 6 }, { 514, 9, 58, 100, 1 }, { 515, 7, 56, 100, 0 }, + { 516, 6, 55, 100, 1 }, { 517, 4, 53, 100, 0 }, { 520, 11, 60, 100, 0 }, { 523, 3, 52, 100, 0 }, + { 531, 7, 0, 100, 2 }, { 532, 9, 0, 100, 2 }, { 533, 6, 0, 100, 2 }, { 534, 3, 52, 100, 0 }, + { 535, 37, 84, 80, 6 }, { 553, 38, 85, 80, 6 }, { 569, 39, 86, 80, 6 }, { 588, 40, 88, 80, 6 }, + { 662, 41, 89, 80, 6 }, { 777, 42, 90, 80, 6 }, { 978, 1, 22, 100, 0 }, { 1008, 12, 61, 100, 0 }, + { 1011, 4, 15, 100, 5 }, { 1022, 52, 99, 80, 6 }, { 1039, 3, 63, 100, 5 }, { 1045, 3, 63, 100, 5 }, + { 1051, 3, 63, 100, 5 }, { 1057, 3, 63, 100, 5 }, { 1063, 3, 63, 100, 5 }, { 1066, 3, 63, 40, 5 }, + { 1074, 43, 91, 80, 6 }, { 1256, 44, 92, 80, 6 }, { 1322, 45, 93, 80, 6 }, { 1373, 46, 94, 80, 6 }, + { 1419, 47, 95, 80, 6 }, { 1792, 13, 62, 100, 0 }, { 1793, 0, 50, 100, 5 }, { 1895, 51, 98, 80, 6 }, +}; + +static const SoundSequenceData _soundDataSeq21_20[] = { + { 2, 0, 0, 100, 3 }, { 4, 3, 34, 40, 1 }, { 5, 7, 54, 20, 1 }, { 7, 3, 51, 100, 5 }, + { 62, 3, 0, 100, 2 }, { 63, 48, 96, 80, 6 }, { 198, 7, 0, 100, 2 }, { 202, 5, 46, 100, 1 }, + { 203, 16, 101, 80, 6 }, { 211, 1, 41, 100, 5 }, { 216, 0, 103, 40, 1 }, { 217, 5, 0, 100, 2 }, + { 218, 6, 47, 100, 1 }, { 224, 2, 43, 100, 5 }, { 229, 17, 102, 80, 6 }, { 273, 6, 0, 100, 2 }, + { 274, 4, 40, 100, 1 }, { 275, 4, 44, 100, 5 }, { 335, 1, 21, 100, 1 }, { 336, 13, 42, 100, 0 }, + { 339, 11, 28, 100, 0 }, { 358, 0, 25, 100, 5 }, { 364, 24, 70, 100, 4 }, { 397, 7, 49, 100, 5 }, + { 399, 6, 48, 100, 5 }, { 433, 5, 45, 100, 5 }, { 451, 13, 42, 100, 0 }, { 459, 1, 0, 100, 2 }, + { 508, 4, 0, 100, 2 }, { 509, 1, 21, 100, 1 }, { 521, 11, 28, 100, 0 }, { 530, 8, 118, 100, 0 }, + { 537, 9, 26, 100, 0 }, { 557, 8, 106, 100, 5 }, { 578, 5, 45, 100, 5 }, { 602, 13, 42, 100, 0 }, + { 609, 1, 0, 100, 2 }, { 626, 12, 29, 100, 0 }, { 628, 10, 27, 100, 0 }, { 670, 6, 48, 100, 5 }, + { 690, 10, 27, 100, 0 }, { 692, 3, 51, 100, 5 }, { 705, 11, 28, 100, 0 }, { 710, 2, 43, 100, 5 }, + { 714, 9, 26, 100, 0 }, { 720, 9, 0, 100, 2 }, { 721, 7, 49, 100, 5 }, { 725, 0, 25, 100, 5 }, +}; + +static const SoundSequenceData _soundDataSeq13_14[] = { + { 3, 0, 128, 100, 1 }, { 34, 0, 0, 100, 2 }, { 57, 0, 123, 100, 5 }, { 77, 0, 123, 100, 5 }, + { 84, 9, 24, 100, 0 }, { 100, 9, 24, 100, 0 }, { 140, 3, 19, 100, 5 }, { 157, 2, 109, 100, 5 }, + { 158, 1, 129, 100, 0 }, { 204, 1, 114, 100, 5 }, { 220, 2, 107, 100, 1 }, { 235, 7, 113, 100, 0 }, + { 236, 2, 0, 100, 2 }, { 248, 12, 118, 100, 0 }, { 251, 13, 119, 100, 0 }, { 265, 11, 117, 100, 0 }, + { 276, 11, 117, 100, 0 }, { 310, 5, 110, 100, 0 }, { 335, 6, 112, 100, 0 }, { 370, 4, 124, 100, 0 }, + { 373, 8, 127, 100, 0 }, { 378, 8, 127, 100, 0 }, { 434, 10, 120, 100, 0 }, { 453, 3, 108, 100, 0 }, + { 484, 3, 0, 100, 2 }, +}; + +static const SoundSequenceData _soundDataSeq15_16[] = { + { 3, 4, 3, 100, 5 }, { 10, 5, 4, 100, 5 }, { 22, 6, 64, 100, 5 }, { 32, 7, 65, 100, 5 }, + { 39, 6, 64, 100, 5 }, { 48, 7, 65, 100, 5 }, { 57, 6, 64, 100, 5 }, { 65, 3, 67, 50, 0 }, + { 102, 4, 68, 50, 0 }, { 151, 2, 12, 50, 5 }, { 205, 3, 5, 100, 5 }, { 218, 0, 63, 100, 5 }, + { 227, 0, 63, 100, 5 }, { 236, 0, 63, 100, 5 }, { 245, 0, 63, 100, 5 }, { 254, 0, 63, 100, 5 }, + { 263, 0, 63, 100, 5 }, { 272, 0, 63, 100, 5 }, { 291, 1, 54, 40, 1 }, { 309, 8, 6, 100, 5 }, + { 360, 8, 6, 100, 5 }, { 384, 2, 55, 60, 1 }, { 398, 10, 66, 100, 0 }, { 440, 2, 0, 100, 2 }, + { 441, 1, 0, 100, 2 }, { 452, 11, 62, 100, 0 }, { 466, 1, 2, 100, 5 }, { 470, 8, 9, 100, 0 }, + { 503, 6, 7, 100, 0 }, { 519, 7, 8, 100, 0 }, { 536, 8, 9, 100, 0 }, { 538, 4, 3, 100, 5 }, + { 549, 5, 4, 100, 5 }, { 558, 4, 3, 100, 5 }, { 568, 5, 4, 100, 5 }, { 578, 4, 3, 100, 5 }, + { 586, 5, 4, 100, 5 }, { 593, 4, 3, 100, 5 }, { 600, 5, 4, 100, 5 }, { 606, 4, 3, 100, 5 }, + { 613, 5, 4, 100, 5 }, { 620, 9, 10, 100, 0 }, { 630, 12, 11, 100, 0 }, +}; + +static const SoundSequenceData _soundDataSeq27_28[] = { + { 17, 2, 111, 100, 0 }, { 57, 8, 105, 100, 0 }, { 62, 10, 126, 100, 0 }, { 67, 9, 110, 100, 0 }, + { 74, 3, 115, 100, 1 }, { 87, 3, 0, 100, 2 }, { 85, 0, 121, 100, 0 }, { 138, 5, 116, 100, 0 }, + { 196, 7, 125, 100, 0 }, { 222, 6, 122, 100, 0 }, { 228, 1, 129, 100, 0 }, +}; + +static const SoundSequenceData _soundDataSeq19_20[] = { + { 2, 0, 0, 100, 3 }, { 3, 0, 115, 100, 1 }, { 33, 0, 0, 100, 2 }, { 33, 1, 13, 100, 0 }, + { 53, 2, 14, 100, 1 }, { 78, 2, 0, 100, 2 }, { 80, 0, 0, 100, 4 }, +}; + +const SoundSequenceDataList AnimationSequencePlayer::_soundSeqDataList[] = { + { 0, 0, 14, 10, 58, _soundDataSeq3_4 }, + { 0, 0, 14, 5, 60, _soundDataSeq9_10 }, + { 0, 0, 14, 9, 48, _soundDataSeq21_20 }, + { 1, 80, 14, 4, 25, _soundDataSeq13_14 }, + { 1, 80, 13, 9, 43, _soundDataSeq15_16 }, + { 1, 80, 11, 0, 11, _soundDataSeq27_28 }, + { 104, 100, 0, 0, 0, 0 }, + { 0, 100, 4, 0, 7, _soundDataSeq19_20 } +}; + +const char *AnimationSequencePlayer::_audioFileNamesTable[] = { "demomenu.raw", - "introdub.raw", - "introdua.raw", - "demorola.raw", - "democha1.raw", - "icrmusic.raw", - "demorolc.raw", - "demorolc.raw", - "merilogo.raw", - "democha2.raw", "demorolc.raw", + "fx101.wav", + "fx102.wav", + "fx103.wav", + "fx104.wav", + "fx105.wav", + "fx107.wav", + "fx108.wav", + "fx109.wav", + "fx110.wav", + "fx111.wav", + "fx112.wav", + "fx113.wav", + "fx114.wav", + "fx116.wav", + "fx117.wav", + "fx32.wav", + "fx33.wav", + "fx34.wav", + "fx35.wav", + "fx36.wav", + "fx37.wav", + "fx38.wav", + "fx39.wav", + "fx40.wav", + "fx42.wav", + "fx43.wav", + "fx44.wav", + "fx45.wav", + "fx47.wav", + "fx48.wav", + "fx49.wav", + "fx50.wav", + "fx52.wav", + "fx53.wav", + "fx55.wav", + "fx56.wav", + "fx57.wav", + "fx58.wav", + "fx59.wav", + "fx60.wav", + "fx61.wav", + "fx62.wav", + "fx63.wav", + "fx64.wav", + "fx66.wav", + "fx67.wav", + "fx68.wav", + "fx69.wav", + "fx70.wav", + "fx71.wav", + "fx72.wav", + "fx73.wav", + "fx74.wav", + "fx75.wav", + "fx76.wav", + "fx77.wav", + "fx78.wav", + "fx79.wav", + "fx80.wav", + "fx81.wav", + "fx83.wav", + "fx86.wav", + "fx91.wav", + "fx92.wav", + "fx93.wav", + "fx97.wav", + "fx98.wav", "int1.raw", - "int2.raw", - "int3.raw", - "int4.raw", - "int5.raw", - "int6.raw", - "int7.raw", - "int8.raw", - "int9.raw", - "int10.raw", - "int11.raw", - "int12.raw", - "int13.raw", "int14.raw", "int15.raw", "int16.raw", "int17.raw", "int18.raw", "int19.raw", + "int2.raw", "int20.raw", "int21.raw", "int22.raw", @@ -388,6 +431,7 @@ const char *AnimationSequencePlayer::_musicFileNamesTable[] = { "int27.raw", "int28.raw", "int29.raw", + "int3.raw", "int30.raw", "int31.raw", "int32.raw", @@ -397,177 +441,39 @@ const char *AnimationSequencePlayer::_musicFileNamesTable[] = { "int36.raw", "int37.raw", "int38.raw", - "int39.raw", - "int40.raw", + "int4.raw", "int41.raw", - "int42.raw" -}; - -const char *AnimationSequencePlayer::_audioFileNamesTable[] = { - "introdua.wav", - "fx35.wav", - "fx47.wav", - "fx50.wav", - "fx51.wav", - "fx52.wav", - "fx54.wav", - "fx58.wav", - "fx59.wav", - "fx53.wav", - "fx55.wav", - "fx68.wav", - "fx57.wav", - "fx36.wav", - // offset 2,14 - "fx33.wav", - "fx34.wav", - "fx38.wav", - "fx39.wav", - "fx48.wav", - "fx49.wav", - "fx69.wav", - "fx32.wav", - "fx56.wav", - "fx117.wav", - // offset 3,24 - "introdua.wav", - "fx37.wav", - "fx49.wav", - "fx72.wav", - "fx73.wav", - "fx74.wav", - "fx75.wav", - "fx76.wav", - "fx77.wav", - "fx78.wav", - "fx79.wav", - "fx80.wav", - "fx81.wav", - "fx83.wav", - // offset 4,38 - "fx70.wav", - "fx33.wav", - "rdfx12.wav", - "fx86.wav", - "fx116.wav", - // offset 5,43 + "int42.raw", + "int5.raw", + "int6.raw", + "int7.raw", "introdua.wav", - "fx36.wav", - "fx46.wav", - "fx52.wav", - "fx59.wav", - "fx66.wav", - "fx67.wav", - "fx74.wav", - "rdfx26.wav", - "fx42.wav", - "fx43.wav", - "fx44.wav", - "fx45.wav", - "fx61.wav", - // offset 6,57 - "fx40.wav", - "fx60.wav", - "fx62.wav", - "fx71.wav", - "fx63.wav", - "fx64.wav", - "fx68.wav", - "fx69.wav", - "rdfx12.wav", - // offset 7,66 + "merilogo.raw", "rdfx1.wav", - "rdfx2.wav", - "rdfx4.wav", - "rdfx5.wav", - "rdfx6.wav", - "rdfx7.wav", - "rdfx10.wav", - "rdfx11.wav", "rdfx12.wav", - "rdfx19.wav", - "rdfx29.wav", - "rdfx32.wav", - "rdfx35.wav", - // offset 8,79 - "rdfx8.wav", - "rdfx9.wav", "rdfx13.wav", "rdfx14.wav", - "rdfx33.wav", + "rdfx15.wav", "rdfx16.wav", + "rdfx17.wav", "rdfx18.wav", "rdfx20.wav", - "rdfx38.wav", - "fx39.wav", - "rdfx28.wav", + "rdfx21.wav", + "rdfx22.wav", + "rdfx24.wav", "rdfx25.wav", "rdfx26.wav", "rdfx27.wav", - // offset 9,93 - "rdfx31.wav", - "rdfx21.wav", - "rdfx15.wav", - "fx34.wav", - // offset 10,97 - "fx96.wav", - "fx74.wav", - "fx75.wav", - "fx97.wav", - "fx98.wav", - "fx106.wav", - "fx107.wav", - "fx108.wav", - "fx109.wav", - "fx110.wav", - "fx93.wav", - "fx83.wav", - "fx111.wav", - // offset 11,110 - "fx86.wav", - "fx101.wav", - "fx112.wav", - "fx104.wav", - "fx102.wav", - "fx103.wav", - "fx91.wav", - "fx92.wav", - "fx105.wav", - // offset 12,119 + "rdfx28.wav", "rdfx3.wav", - "rdfx9.wav", - "rdfx17.wav", - "rdfx22.wav", - "rdfx23.wav", - "rdfx24.wav", "rdfx30.wav", + "rdfx31.wav", + "rdfx33.wav", "rdfx36.wav", - "rdfx1.wav", - "rdfx16.wav", "rdfx37.wav", - // offset 13,130 - "fx82.wav", - "fx80.wav", - "fx89.wav", - "fx90.wav", - "fx83.wav", - "fx84.wav", - // offset 14,136 - "rdfx2.wav", - "fx85.wav", - "fx86.wav", - "fx87.wav", - "fx88.wav", - "fx99.wav", - "fx98.wav", - "fx97.wav", - "fx96.wav", - "fx100.wav", - // offset 15,146 - "rdfx22.wav", - "fx113.wav", - "fx114.wav", - "fx115.wav" + "rdfx38.wav", + "rdfx8.wav", + "rdfx9.wav", }; } // namespace Tucker diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index cedd9ec723..692335d5ef 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -304,7 +304,7 @@ void TuckerEngine::restart() { _currentGfxBackgroundCounter = 0; _currentGfxBackground = 0; _fadePaletteCounter = 0; - memset(&_currentPalette, 0, sizeof(_currentPalette)); + memset(_currentPalette, 0, sizeof(_currentPalette)); _fullRedrawCounter = 0; _dirtyRectsPrevCount = _dirtyRectsCount = 0; @@ -3395,7 +3395,6 @@ void TuckerEngine::setSelectedObjectKey() { _selectedObject.locationObject_toY2 = _locationObjectsTable[_selectedCharacterNum].toY2; _selectedObject.locationObject_toWalkX2 = _locationObjectsTable[_selectedCharacterNum].toWalkX2; _selectedObject.locationObject_toWalkY2 = _locationObjectsTable[_selectedCharacterNum].toWalkY2; - } } } else { diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 966900c923..6afccdc4da 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -848,11 +848,32 @@ enum AnimationSoundType { kAnimationSoundTypeLoopingWAV }; +enum { + kSoundsList_Seq3_4, + kSoundsList_Seq9_10, + kSoundsList_Seq21_20, + kSoundsList_Seq13_14, + kSoundsList_Seq15_16, + kSoundsList_Seq27_28, + kSoundsList_Seq17_18, + kSoundsList_Seq19_20 +}; + struct SoundSequenceData { int timestamp; int index; - int opcode; + int num; int volume; + int opcode; +}; + +struct SoundSequenceDataList { + int musicIndex; + int musicVolume; + int soundList1Count; + int soundList2Count; + int soundSeqDataCount; + const SoundSequenceData *soundSeqData; }; class AnimationSequencePlayer { @@ -919,13 +940,9 @@ private: int _updateFuncIndex; ::Graphics::FlicDecoder _flicPlayer[2]; uint8 _animationPalette[256 * 4]; - int _soundsList1Offset; - int _soundsList1Count; - int _soundsList2Offset; - int _soundsList2Count; - int _soundSeqDataOffset; int _soundSeqDataCount; int _soundSeqDataIndex; + const SoundSequenceData *_soundSeqData; uint8 *_offscreenBuffer; int _updateScreenWidth; int _updateScreenPicture; @@ -938,8 +955,7 @@ private: Audio::SoundHandle _sfxHandle; Audio::SoundHandle _musicHandle; - static const SoundSequenceData _soundSeqData[]; - static const char *_musicFileNamesTable[]; + static const SoundSequenceDataList _soundSeqDataList[]; static const char *_audioFileNamesTable[]; }; |