mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 22:13:27 +02:00
some optimizations
This commit is contained in:
@@ -77,7 +77,7 @@ void SoundManager::terminate()
|
||||
void SoundManager::poll()
|
||||
{
|
||||
static ticks_t lastUpdate = 0;
|
||||
ticks_t now = g_clock.ticks();
|
||||
ticks_t now = g_clock.millis();
|
||||
|
||||
if(now - lastUpdate < POLL_DELAY)
|
||||
return;
|
||||
|
@@ -114,7 +114,7 @@ void SoundSource::setVelocity(const Point& velocity)
|
||||
|
||||
void SoundSource::setFading(FadeState state, float fadeTime)
|
||||
{
|
||||
float now = g_clock.time();
|
||||
float now = g_clock.seconds();
|
||||
if(m_fadeState != NoFading) {
|
||||
float elapsed = now - m_fadeStartTime;
|
||||
float add;
|
||||
@@ -132,7 +132,7 @@ void SoundSource::setFading(FadeState state, float fadeTime)
|
||||
|
||||
void SoundSource::update()
|
||||
{
|
||||
float now = g_clock.time();
|
||||
float now = g_clock.seconds();
|
||||
if(m_fadeState == FadingOn) {
|
||||
float elapsed = now - m_fadeStartTime;
|
||||
if(elapsed >= m_fadeTime) {
|
||||
|
Reference in New Issue
Block a user