Set correct volume for last lap music
This commit is contained in:
parent
84a84b6776
commit
91d042da31
@ -35,7 +35,6 @@ public:
|
|||||||
virtual bool pauseMusic () = 0;
|
virtual bool pauseMusic () = 0;
|
||||||
virtual bool resumeMusic () = 0;
|
virtual bool resumeMusic () = 0;
|
||||||
virtual void setVolume (float volume) = 0;
|
virtual void setVolume (float volume) = 0;
|
||||||
virtual void updateFading(float percent) = 0;
|
|
||||||
virtual void updateFaster(float percent, float pitch) = 0;
|
virtual void updateFaster(float percent, float pitch) = 0;
|
||||||
virtual void update () = 0;
|
virtual void update () = 0;
|
||||||
virtual bool isPlaying () = 0;
|
virtual bool isPlaying () = 0;
|
||||||
|
@ -35,7 +35,6 @@ public:
|
|||||||
virtual bool pauseMusic () { return true; }
|
virtual bool pauseMusic () { return true; }
|
||||||
virtual bool resumeMusic () { return true; }
|
virtual bool resumeMusic () { return true; }
|
||||||
virtual void setVolume (float volume) {}
|
virtual void setVolume (float volume) {}
|
||||||
virtual void updateFading(float percent) {}
|
|
||||||
virtual void updateFaster(float percent, float pitch) {}
|
virtual void updateFaster(float percent, float pitch) {}
|
||||||
virtual void update () {}
|
virtual void update () {}
|
||||||
virtual bool isPlaying () { return false; }
|
virtual bool isPlaying () { return false; }
|
||||||
|
@ -223,8 +223,8 @@ void MusicInformation::update(float dt)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
float fraction=m_time_since_faster/m_faster_time;
|
float fraction=m_time_since_faster/m_faster_time;
|
||||||
m_normal_music->updateFading(1-fraction);
|
m_normal_music->setVolume(1-fraction);
|
||||||
m_fast_music->updateFading(fraction);
|
m_fast_music->setVolume(fraction);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SOUND_FASTER: {
|
case SOUND_FASTER: {
|
||||||
@ -322,6 +322,7 @@ void MusicInformation::switchToFastMusic()
|
|||||||
{
|
{
|
||||||
m_mode = SOUND_FADING;
|
m_mode = SOUND_FADING;
|
||||||
m_fast_music->playMusic();
|
m_fast_music->playMusic();
|
||||||
|
m_fast_music->setVolume(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -257,13 +257,6 @@ void MusicOggStream::setVolume(float volume)
|
|||||||
check("volume music"); // clear errors
|
check("volume music"); // clear errors
|
||||||
} // setVolume
|
} // setVolume
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
void MusicOggStream::updateFading(float percent)
|
|
||||||
{
|
|
||||||
alSourcef(m_soundSource,AL_GAIN,percent);
|
|
||||||
update();
|
|
||||||
} // updateFading
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MusicOggStream::updateFaster(float percent, float max_pitch)
|
void MusicOggStream::updateFaster(float percent, float max_pitch)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +51,6 @@ public:
|
|||||||
virtual ~MusicOggStream();
|
virtual ~MusicOggStream();
|
||||||
|
|
||||||
virtual void update();
|
virtual void update();
|
||||||
virtual void updateFading(float percent);
|
|
||||||
virtual void updateFaster(float percent, float max_pitch);
|
virtual void updateFaster(float percent, float max_pitch);
|
||||||
|
|
||||||
virtual bool load(const std::string& filename);
|
virtual bool load(const std::string& filename);
|
||||||
|
@ -873,7 +873,7 @@ void SFXManager::positionListener(const Vec3 &position, const Vec3 &front,
|
|||||||
void SFXManager::reallyPositionListenerNow()
|
void SFXManager::reallyPositionListenerNow()
|
||||||
{
|
{
|
||||||
#if HAVE_OGGVORBIS
|
#if HAVE_OGGVORBIS
|
||||||
if (!UserConfigParams::m_sfx || !m_initialized) return;
|
if (!sfxAllowed()) return;
|
||||||
|
|
||||||
m_listener_position.lock();
|
m_listener_position.lock();
|
||||||
{
|
{
|
||||||
@ -926,4 +926,3 @@ SFXBase* SFXManager::quickSound(const std::string &sound_type)
|
|||||||
}
|
}
|
||||||
} // quickSound
|
} // quickSound
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user