mirror of
https://github.com/glest/glest-source.git
synced 2025-08-23 16:32:53 +02:00
@@ -97,7 +97,7 @@ public:
|
||||
virtual ~SoundPlayerOpenAL();
|
||||
virtual bool init(const SoundPlayerParams *params);
|
||||
virtual void end();
|
||||
virtual void play(StaticSound *staticSound);
|
||||
virtual void play(StaticSound *staticSound, bool force=false);
|
||||
virtual void play(StrSound *strSound, int64 fadeOn=0);
|
||||
virtual void stop(StrSound *strSound, int64 fadeOff=0);
|
||||
virtual void stopAllSounds(int64 fadeOff=0);
|
||||
|
@@ -51,7 +51,7 @@ public:
|
||||
};
|
||||
virtual bool init(const SoundPlayerParams *params)= 0;
|
||||
virtual void end()= 0;
|
||||
virtual void play(StaticSound *staticSound)= 0;
|
||||
virtual void play(StaticSound *staticSound, bool force=false)= 0;
|
||||
virtual void play(StrSound *strSound, int64 fadeOn=0)= 0; //delay and fade in miliseconds
|
||||
virtual void stop(StrSound *strSound, int64 fadeOff=0)= 0;
|
||||
virtual void stopAllSounds(int64 fadeOff=0)= 0;
|
||||
|
@@ -516,7 +516,7 @@ void SoundPlayerOpenAL::end() {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
void SoundPlayerOpenAL::play(StaticSound* staticSound) {
|
||||
void SoundPlayerOpenAL::play(StaticSound* staticSound, bool force ) {
|
||||
assert(staticSound != 0);
|
||||
|
||||
if(initOk == false) return;
|
||||
@@ -524,8 +524,14 @@ void SoundPlayerOpenAL::play(StaticSound* staticSound) {
|
||||
try {
|
||||
StaticSoundSource* source = findStaticSoundSource();
|
||||
|
||||
if(source == 0) {
|
||||
return;
|
||||
if(source == 0 ) {
|
||||
if( force == false )
|
||||
return;
|
||||
else {
|
||||
// force usage of first StaticSoundSource
|
||||
source = staticSources.front();
|
||||
source->stop();
|
||||
}
|
||||
}
|
||||
source->play(staticSound);
|
||||
}
|
||||
|
Reference in New Issue
Block a user