Ticket #8351: cdsound.diff

File cdsound.diff, 2.8 KB (added by eriktorbjorn, 20 years ago)

Patch against a July 28 CVS snapshot

  • scumm/saveload.cpp

    diff -ur ScummVM-cvs20040728/scumm/saveload.cpp ScummVM-cvs20040728+hack/scumm/saveload.cpp
    old new  
    383383        };
    384384
    385385        const SaveLoadEntry *actorEntries = Actor::getSaveLoadEntries();
     386        const SaveLoadEntry *soundEntries = _sound->getSaveLoadEntries();
    386387
    387388        const SaveLoadEntry verbEntries[] = {
    388389                MKLINE(VerbSlot, curRect.left, sleInt16, VER(8)),
     
    672673        }
    673674
    674675        s->saveLoadArrayOf(_actors, _numActors, sizeof(_actors[0]), actorEntries);
     676        s->saveLoadEntries(_sound, soundEntries);
    675677
    676678        if (savegameVersion < VER(9))
    677679                s->saveLoadArrayOf(vm.slot, 25, sizeof(vm.slot[0]), scriptSlotEntries);
  • scumm/saveload.h

    diff -ur ScummVM-cvs20040728/scumm/saveload.h ScummVM-cvs20040728+hack/scumm/saveload.h
    old new  
    3232// Can be useful for other ports too :)
    3333
    3434#define VER(x) x
    35 #define CURRENT_VER 34
     35#define CURRENT_VER 35
    3636
    3737// To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,
    3838// we use a small trick: instead of 0 we use 42. Why? Well, it seems newer GCC
  • scumm/sound.cpp

    diff -ur ScummVM-cvs20040728/scumm/sound.cpp ScummVM-cvs20040728+hack/scumm/sound.cpp
    old new  
    2525#include "scumm/imuse.h"
    2626#include "scumm/imuse_digi/dimuse.h"
    2727#include "scumm/scumm.h"
     28#include "scumm/saveload.h"
    2829#include "scumm/sound.h"
    2930
    3031#include "common/config-manager.h"
     
    11201121        AudioCD.updateCD();
    11211122}
    11221123
     1124const SaveLoadEntry *Sound::getSaveLoadEntries() {
     1125        static const SaveLoadEntry soundEntries[] = {
     1126                MKLINE(Sound, _currentCDSound, sleInt16, VER(35)),
     1127                MKEND()
     1128        };
     1129
     1130        return soundEntries;
     1131}
     1132
    11231133} // End of namespace Scumm
  • scumm/sound.h

    diff -ur ScummVM-cvs20040728/scumm/sound.h ScummVM-cvs20040728+hack/scumm/sound.h
    old new  
    3232class ScummFile;
    3333
    3434struct MP3OffsetTable;
     35struct SaveLoadEntry;
    3536
    3637enum {
    3738        kTalkSoundID = 10000
     
    7273
    7374        int _overrideFreq;
    7475
    75         int _currentCDSound;
     76        int16 _currentCDSound;
    7677        int _currentMusic;
    7778public:
    7879        PlayingSoundHandle _talkChannelHandle;  // Handle of mixer channel actor is talking on
     
    110111        void updateCD();
    111112        int getCurrentCDSound() const { return _currentCDSound; }
    112113
     114        // Used by the save/load system:
     115        const SaveLoadEntry *getSaveLoadEntries();
     116
    113117protected:
    114118        ScummFile *openSfxFile();
    115119        void startSfxSound(File *file, int file_size, PlayingSoundHandle *handle, int id = -1);