Ticket #3323: audiocdsave.diff

File audiocdsave.diff, 2.5 KB (added by eriktorbjorn, 17 years ago)

Patch against current SVN

  • engines/scumm/sound.cpp

     
    3737#include "common/util.h"
    3838
    3939#include "sound/adpcm.h"
    40 #include "sound/audiocd.h"
    4140#include "sound/flac.h"
    4241#include "sound/mididrv.h"
    4342#include "sound/mixer.h"
  • engines/scumm/scumm.h

     
    3838#include "scumm/detection.h"
    3939#include "scumm/script.h"
    4040
     41#include "sound/audiocd.h"
    4142#include "sound/mididrv.h"
    4243
    4344namespace GUI {
     
    608609        uint32 _lastSaveTime;
    609610        bool _saveTemporaryState;
    610611        char _saveLoadName[32];
     612        Audio::AudioCDManager::Status _audioCDStatus;
    611613
    612614        bool saveState(int slot, bool compat);
    613615        bool loadState(int slot, bool compat);
  • engines/scumm/saveload.cpp

     
    4343#include "scumm/he/sprite_he.h"
    4444#include "scumm/verbs.h"
    4545
    46 #include "sound/audiocd.h"
    4746#include "sound/mixer.h"
    4847
    4948namespace Scumm {
     
    376375
    377376        _sound->pauseSounds(false);
    378377
     378        // If we are loading, and the music being loaded was supposed to loop
     379        // forever, then resume playing it. This helps a lot when the audio CD
     380        // is used to provide ambient music (see bug #788195).
     381        if (_audioCDStatus.playing && _audioCDStatus.numLoops < 0) {
     382                AudioCD.play(_audioCDStatus.track, _audioCDStatus.numLoops, _audioCDStatus.start, _audioCDStatus.duration);
     383        }
     384
    379385        return true;
    380386}
    381387
     
    11311137        // Save/load the Audio CD status
    11321138        //
    11331139        if (s->getVersion() >= VER(24)) {
    1134                 Audio::AudioCDManager::Status info;
    11351140                if (s->isSaving())
    1136                         info = AudioCD.getStatus();
    1137                 s->saveLoadArrayOf(&info, 1, sizeof(info), audioCDEntries);
    1138                 // If we are loading, and the music being loaded was supposed to loop
    1139                 // forever, then resume playing it. This helps a lot when the audio CD
    1140                 // is used to provide ambient music (see bug #788195).
    1141                 if (s->isLoading() && info.playing && info.numLoops < 0)
    1142                         AudioCD.play(info.track, info.numLoops, info.start, info.duration);
     1141                        _audioCDStatus = AudioCD.getStatus();
     1142                s->saveLoadArrayOf(&_audioCDStatus, 1, sizeof(_audioCDStatus), audioCDEntries);
     1143                // We may want to resume CD playing, but we can't do this until
     1144                // all sounds have been unpaused (see bug #1756381).
    11431145        }
    11441146
    11451147