diff options
author | Max Horn | 2003-12-24 00:25:18 +0000 |
---|---|---|
committer | Max Horn | 2003-12-24 00:25:18 +0000 |
commit | e9269257f3da947eca3fb167b279fbe91650157a (patch) | |
tree | 62784e4ce6a708398f018855b6d672de6b0345db /scumm/smush | |
parent | 3f77642948a824e6e198c93a455fbf3fbab7e507 (diff) | |
download | scummvm-rg350-e9269257f3da947eca3fb167b279fbe91650157a.tar.gz scummvm-rg350-e9269257f3da947eca3fb167b279fbe91650157a.tar.bz2 scummvm-rg350-e9269257f3da947eca3fb167b279fbe91650157a.zip |
turned PlayingSoundHandle into an 'opaque' (well not really :-) data type, mainly because people kept (accidentally and sometimes on purpose :-) misusing them
svn-id: r11881
Diffstat (limited to 'scumm/smush')
-rw-r--r-- | scumm/smush/smush_mixer.cpp | 11 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 3 |
2 files changed, 5 insertions, 9 deletions
diff --git a/scumm/smush/smush_mixer.cpp b/scumm/smush/smush_mixer.cpp index 10bc983960..3c9b831d78 100644 --- a/scumm/smush/smush_mixer.cpp +++ b/scumm/smush/smush_mixer.cpp @@ -39,7 +39,6 @@ SmushMixer::SmushMixer(SoundMixer *m) : for (int32 i = 0; i < NUM_CHANNELS; i++) { _channels[i].id = -1; _channels[i].chan = NULL; - _channels[i].handle = 0; } } @@ -70,19 +69,17 @@ void SmushMixer::addChannel(SmushChannel *c) { } for (i = 0; i < NUM_CHANNELS; i++) { - if ((_channels[i].chan == NULL || _channels[i].id == -1) && _channels[i].handle == 0) { + if ((_channels[i].chan == NULL || _channels[i].id == -1) && !_channels[i].handle.isActive()) { _channels[i].chan = c; _channels[i].id = track; - _channels[i].handle = 0; return; } } for (i = 0; i < NUM_CHANNELS; i++) { - warning("channel %d : %p(%d, %d) %d %d", i, (void *)_channels[i].chan, + warning("channel %d : %p(%d, %d) %d", i, (void *)_channels[i].chan, _channels[i].chan ? _channels[i].chan->getTrackIdentifier() : -1, - _channels[i].chan ? _channels[i].chan->isTerminated() : 1, - _channels[i].handle); + _channels[i].chan ? _channels[i].chan->isTerminated() : 1); } error("SmushMixer::addChannel(%d): no channel available", track); @@ -122,7 +119,7 @@ bool SmushMixer::handleFrame() { } if (_silentMixer == false) { - if (_channels[i].handle == 0) + if (!_channels[i].handle.isActive()) _mixer->newStream(&_channels[i].handle, rate, flags, 500000); _mixer->appendStream(_channels[i].handle, data, size); } diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index 1935ccff96..aa23b1f15e 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -229,7 +229,6 @@ SmushPlayer::SmushPlayer(ScummEngine *scumm, int speed, bool subtitles) { _storeFrame = false; _width = 0; _height = 0; - _IACTchannel = 0; _IACTpos = 0; _soundFrequency = 22050; _speed = speed; @@ -461,7 +460,7 @@ void SmushPlayer::handleIACT(Chunk &b) { } } while (--count); - if (_IACTchannel == 0) + if (!_IACTchannel.isActive()) _scumm->_mixer->newStream(&_IACTchannel, 22050, SoundMixer::FLAG_STEREO | SoundMixer::FLAG_16BITS, 200000); _scumm->_mixer->appendStream(_IACTchannel, output_data, 0x1000); |