diff options
-rw-r--r-- | engines/gob/sound/sounddesc.cpp | 13 | ||||
-rw-r--r-- | engines/gob/sound/sounddesc.h | 8 |
2 files changed, 18 insertions, 3 deletions
diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp index 9df8bbb4bc..8903597bb0 100644 --- a/engines/gob/sound/sounddesc.cpp +++ b/engines/gob/sound/sounddesc.cpp @@ -53,6 +53,19 @@ SoundDesc::~SoundDesc() { free(); } +void SoundDesc::swap(SoundDesc &desc) { + SWAP(_repCount , desc._repCount); + SWAP(_frequency , desc._frequency); + SWAP(_flag , desc._flag); + SWAP(_id , desc._id); + SWAP(_mixerFlags, desc._mixerFlags); + SWAP(_resource , desc._resource); + SWAP(_data , desc._data); + SWAP(_dataPtr , desc._dataPtr); + SWAP(_size , desc._size); + SWAP(_type , desc._type); +} + void SoundDesc::set(SoundType type, byte *data, uint32 dSize) { free(); diff --git a/engines/gob/sound/sounddesc.h b/engines/gob/sound/sounddesc.h index 9e5d20e138..07eb73e7c8 100644 --- a/engines/gob/sound/sounddesc.h +++ b/engines/gob/sound/sounddesc.h @@ -46,6 +46,11 @@ public: int16 _id; byte _mixerFlags; + SoundDesc(); + ~SoundDesc(); + + void swap(SoundDesc &desc); + byte *getData() { return _dataPtr; } uint32 size() const { return _size; } @@ -66,9 +71,6 @@ public: int16 calcFadeOutLength(int16 frequency); uint32 calcLength(int16 repCount, int16 frequency, bool fade); - SoundDesc(); - ~SoundDesc(); - private: Resource *_resource; byte *_data; |