Ticket #8524: kyra-multimidi.diff
File kyra-multimidi.diff, 4.0 KB (added by , 18 years ago) |
---|
-
engines/kyra/kyra.cpp
330 330 _system->initSize(320, 200); 331 331 _system->endGFXTransaction(); 332 332 333 // for now we prefer MIDI-to-Adlib conversion over native midi333 // for now we prefer Adlib over native MIDI 334 334 int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/); 335 335 336 _adlibSound = NULL; 337 336 338 if (midiDriver == MD_ADLIB) { 337 339 _sound = new SoundAdlibPC(_mixer, this); 338 340 assert(_sound); … … 349 351 _sound = soundMidiPc; 350 352 assert(_sound); 351 353 soundMidiPc->hasNativeMT32(native_mt32); 354 355 // Unlike some SCUMM games, it's not that the MIDI sounds are 356 // missing. It's just that at least at the time of writing they 357 // decidedly inferior to the Adlib ones. 358 359 if (ConfMan.getBool("multi_midi")) { 360 _adlibSound = new SoundAdlibPC(_mixer, this); 361 assert(_adlibSound); 362 _adlibSound->setVolume(255); 363 } 352 364 } 353 365 if (!_sound->init()) { 354 366 error("Couldn't init sound"); … … 512 524 delete _screen; 513 525 delete _res; 514 526 delete _sound; 527 delete _adlibSound; 515 528 delete _saveFileMan; 516 529 delete _seq; 517 530 delete _scriptInterpreter; … … 713 726 _handleInput = false; 714 727 715 728 _sound->process(); 729 if (_adlibSound) 730 _adlibSound->process(); 716 731 } 717 732 } 718 733 -
engines/kyra/sound_adlib.cpp
584 584 585 585 void AdlibDriver::callback() { 586 586 lock(); 587 --_flagTrigger; 588 if (_flagTrigger < 0) 589 _flags &= ~8; 590 setupPrograms(); 591 executePrograms(); 587 if (_soundData) { 588 --_flagTrigger; 589 if (_flagTrigger < 0) 590 _flags &= ~8; 591 setupPrograms(); 592 executePrograms(); 592 593 593 uint8 temp = _unkValue3; 594 _unkValue3 += _tempo; 595 if (_unkValue3 < temp) { 596 if (!(--_unkValue2)) { 597 _unkValue2 = _unkValue1; 598 ++_unkValue4; 594 uint8 temp = _unkValue3; 595 _unkValue3 += _tempo; 596 if (_unkValue3 < temp) { 597 if (!(--_unkValue2)) { 598 _unkValue2 = _unkValue1; 599 ++_unkValue4; 600 } 599 601 } 600 602 } 601 603 unlock(); -
engines/kyra/seqplayer.cpp
375 375 void SeqPlayer::s1_playEffect() { 376 376 uint8 track = *_seqData++; 377 377 _vm->delay(3 * _vm->tickLength()); 378 _ sound->playSoundEffect(track);378 _vm->snd_playSoundEffect(track); 379 379 } 380 380 381 381 void SeqPlayer::s1_playTrack() { -
engines/kyra/kyra.h
256 256 ScreenAnimator *animator() { return _animator; } 257 257 TextDisplayer *text() { return _text; } 258 258 Sound *sound() { return _sound; } 259 Sound *adlibSound() { return _adlibSound; } 259 260 StaticResource *staticres() { return _staticres; } 260 261 uint32 tickLength() const { return _tickLength; } 261 262 Movie *createWSAMovie(); … … 791 792 Screen *_screen; 792 793 ScreenAnimator *_animator; 793 794 Sound *_sound; 795 Sound *_adlibSound; 794 796 SeqPlayer *_seq; 795 797 Sprites *_sprites; 796 798 TextDisplayer *_text; -
engines/kyra/sound.cpp
402 402 _curMusicTheme = _newMusicTheme = file; 403 403 _sound->loadMusicFile(_musicFiles[file]); 404 404 _sound->playTrack(track); 405 if (_adlibSound) 406 _adlibSound->loadMusicFile(_musicFiles[file]); 405 407 } 406 408 407 409 void KyraEngine::snd_playSoundEffect(int track) { 408 410 debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_playSoundEffect(%d)", track); 409 _sound->playSoundEffect(track); 411 if (_adlibSound) 412 _adlibSound->playSoundEffect(track); 413 else 414 _sound->playSoundEffect(track); 410 415 } 411 416 412 417 void KyraEngine::snd_playWanderScoreViaMap(int command, int restart) {