[Scummvm-cvs-logs] CVS: scummvm/sword2/driver d_draw.cpp,1.49,1.50 d_sound.cpp,1.89,1.90 d_sound.h,1.35,1.36
Max Horn
fingolfin at users.sourceforge.net
Tue Dec 23 16:26:10 CET 2003
Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv23172/sword2/driver
Modified Files:
d_draw.cpp d_sound.cpp d_sound.h
Log Message:
turned PlayingSoundHandle into an 'opaque' (well not really :-) data type, mainly because people kept (accidentally and sometimes on purpose :-) misusing them
Index: d_draw.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_draw.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- d_draw.cpp 17 Dec 2003 11:52:05 -0000 1.49
+++ d_draw.cpp 24 Dec 2003 00:25:18 -0000 1.50
@@ -173,7 +173,7 @@
tmpPal[255 * 4 + 2] = 255;
_vm->_graphics->setPalette(0, 256, tmpPal, RDPAL_INSTANT);
- PlayingSoundHandle handle = 0;
+ PlayingSoundHandle handle;
bool skipCutscene = false;
@@ -226,7 +226,7 @@
// more importantly - that we don't free the sound buffer while
// it's in use.
- while (handle) {
+ while (handle.isActive()) {
_vm->_system->delay_msecs(100);
};
Index: d_sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_sound.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- d_sound.cpp 19 Dec 2003 17:07:37 -0000 1.89
+++ d_sound.cpp 24 Dec 2003 00:25:18 -0000 1.90
@@ -35,6 +35,7 @@
#include "common/stdafx.h"
#include "common/file.h"
#include "sword2/sword2.h"
+#include "sound/rate.h"
namespace Sword2 {
@@ -132,7 +133,6 @@
memset(_fx, 0, sizeof(_fx));
- _soundHandleSpeech = 0;
_soundOn = true;
_converter = makeRateConverter(_music[0].getRate(), _vm->_mixer->getOutputRate(), _music[0].isStereo(), false);
@@ -243,7 +243,7 @@
return;
}
- while (_fx[i]._handle) {
+ while (_fx[i]._handle.isActive()) {
_vm->_graphics->updateDisplay();
_vm->_system->delay_msecs(30);
}
@@ -284,7 +284,7 @@
*/
int32 Sound::amISpeaking() {
- if (!_speechMuted && !_speechPaused && _soundHandleSpeech != 0)
+ if (!_speechMuted && !_speechPaused && _soundHandleSpeech.isActive())
return RDSE_SPEAKING;
return RDSE_QUIET;
@@ -441,7 +441,7 @@
if (_speechPaused)
return RDSE_SAMPLEPLAYING;
- if (!_soundHandleSpeech) {
+ if (!_soundHandleSpeech.isActive()) {
_speechStatus = false;
return RDSE_SAMPLEFINISHED;
}
@@ -459,7 +459,7 @@
_speechVol = volume;
- if (_soundHandleSpeech != 0 && !_speechMuted && getSpeechStatus() == RDSE_SAMPLEPLAYING) {
+ if (_soundHandleSpeech.isActive() && !_speechMuted && getSpeechStatus() == RDSE_SAMPLEPLAYING) {
_vm->_mixer->setChannelVolume(_soundHandleSpeech, 16 * _speechVol);
}
}
@@ -558,7 +558,7 @@
// between rooms.
for (fxi = 0; fxi < MAXFX; fxi++) {
- if (!_fx[fxi]._handle)
+ if (!_fx[fxi]._handle.isActive())
break;
}
Index: d_sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_sound.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- d_sound.h 19 Dec 2003 01:30:19 -0000 1.35
+++ d_sound.h 24 Dec 2003 00:25:18 -0000 1.36
@@ -22,7 +22,8 @@
#include "sound/audiostream.h"
#include "sound/mixer.h"
-#include "sound/rate.h"
+
+class RateConverter;
namespace Sword2 {
More information about the Scummvm-git-logs
mailing list