Ticket #8253: sky-intro-music.diff

File sky-intro-music.diff, 4.8 KB (added by eriktorbjorn, 21 years ago)

Patch against a July 5 CVS snapshot

  • scummvm/sky/intro.cpp

    diff -ur ScummVM-cvs20030705/scummvm/sky/intro.cpp ScummVM-cvs20030705+hack/scummvm/sky/intro.cpp
    old new  
    3232            _mixer->stopAll();
    3333#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); REMOVE_INTRO return false; }
    3434#define WAIT_SEQUENCE while (_skyScreen->sequenceRunning()) { checkCommands(commandPtr); delay(50); CHECK_ESC }
     35#define WAIT_MUSIC while (_skyMusic->musicIsPlaying()) { delay(50); CHECK_ESC }
    3536
    3637#define INTRO_TEXT_WIDTH    128
    3738
     
    349350                commandPtr = (uint32 *)anim5Commands;
    350351               
    351352                WAIT_SEQUENCE;
     353
     354                // There is no synchronization mechanism between the music and
     355                // the graphics. Which means that there is no guarantee that
     356                // they both end at the same time. So just to be safe, wait
     357                // for the music to stop before continuing with the final part.
     358                //
     359                // This part of the intro looks pretty nice even as a static
     360                // image, so it makes sense to do the waiting before fading
     361                // down the palette.
     362
     363                WAIT_MUSIC;
     364               
    352365                _skyDisk->prefetchFile(FN_6_PAL);
    353366                _skyDisk->prefetchFile(FN_6_LOG);
    354367                _skyDisk->prefetchFile(FN_6A);
  • scummvm/sky/music/adlibchannel.cpp

    diff -ur ScummVM-cvs20030705/scummvm/sky/music/adlibchannel.cpp ScummVM-cvs20030705+hack/scummvm/sky/music/adlibchannel.cpp
    old new  
    6161        _musicVolume = 0x100;
    6262}
    6363
     64bool SkyAdlibChannel::isActive(void) {
     65
     66        return _channelData.channelActive != 0;
     67}
     68
    6469void SkyAdlibChannel::updateVolume(uint16 pVolume) {
    6570
    6671        _musicVolume = pVolume;
  • scummvm/sky/music/adlibchannel.h

    diff -ur ScummVM-cvs20030705/scummvm/sky/music/adlibchannel.h ScummVM-cvs20030705+hack/scummvm/sky/music/adlibchannel.h
    old new  
    6464        virtual void stopNote(void);
    6565        virtual uint8 process(uint16 aktTime);
    6666        virtual void updateVolume(uint16 pVolume);
     67        virtual bool isActive(void);
    6768private:
    6869        uint8 *_musicData;
    6970        uint16 _musicVolume;
  • scummvm/sky/music/gmchannel.cpp

    diff -ur ScummVM-cvs20030705/scummvm/sky/music/gmchannel.cpp ScummVM-cvs20030705+hack/scummvm/sky/music/gmchannel.cpp
    old new  
    6363        _musicVolume = 0x100;
    6464}
    6565
     66bool SkyGmChannel::isActive(void) {
     67
     68        return _channelData.channelActive != 0;
     69}
     70
    6671void SkyGmChannel::updateVolume(uint16 pVolume) {
    6772
    6873        _musicVolume = pVolume;
  • scummvm/sky/music/gmchannel.h

    diff -ur ScummVM-cvs20030705/scummvm/sky/music/gmchannel.h ScummVM-cvs20030705+hack/scummvm/sky/music/gmchannel.h
    old new  
    4242        virtual void stopNote(void);
    4343        virtual uint8 process(uint16 aktTime);
    4444        virtual void updateVolume(uint16 pVolume);
     45        virtual bool isActive(void);
    4546private:
    4647        byte *_mt32_to_gm;
    4748        static uint8 _veloTab[128];
  • scummvm/sky/music/musicbase.cpp

    diff -ur ScummVM-cvs20030705/scummvm/sky/music/musicbase.cpp ScummVM-cvs20030705+hack/scummvm/sky/music/musicbase.cpp
    old new  
    5757        _system->unlock_mutex(_mutex);
    5858}
    5959
     60bool SkyMusicBase::musicIsPlaying(void)
     61{
     62        for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
     63                if (_channels[cnt]->isActive())
     64                        return true;
     65        return false;
     66}
     67
    6068void SkyMusicBase::musicCommand(uint16 command)
    6169{
    6270        if (_musicData == NULL) {
  • scummvm/sky/music/musicbase.h

    diff -ur ScummVM-cvs20030705/scummvm/sky/music/musicbase.h ScummVM-cvs20030705+hack/scummvm/sky/music/musicbase.h
    old new  
    3838        virtual void stopNote(void) = 0;
    3939        virtual uint8 process(uint16 aktTime) = 0;
    4040        virtual void updateVolume(uint16 pVolume) = 0;
     41        virtual bool isActive(void) = 0;
    4142private:
    4243};
    4344
     
    4849        void loadSection(uint8 pSection);
    4950        void musicCommand(uint16 command);
    5051        void startMusic(uint16 param) { _onNextPoll.musicToProcess = param & 0xF; }; // 4
     52        bool musicIsPlaying(void);
    5153        virtual void setVolume(uint8 volume) = 0;
    5254        uint8 giveVolume(void) { return (uint8)_musicVolume; };
    5355        uint8 giveCurrentMusic(void) { return _currentMusic; };