From 34d7dcf3be24de04b2b9c64edb2666439b353a5b Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 12 Sep 2012 23:43:04 +0200 Subject: Simulation timestamps and input bindings - added new simulation time calculations in CApplication - added simulation frame updates - rewritten old input binding code and input state tracking --- src/graphics/engine/engine.cpp | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'src/graphics/engine/engine.cpp') diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 068687a..d368aa6 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -357,22 +357,22 @@ bool Gfx::CEngine::ProcessEvent(const Event &event) } } } - else if (event.type == EVENT_FRAME) - { - m_highlightTime += event.rTime; - } // By default, pass on all events return true; } -void Gfx::CEngine::FrameMove(float rTime) +void Gfx::CEngine::FrameUpdate() { + float rTime = m_app->GetRelTime(); + m_lightMan->UpdateProgression(rTime); m_particle->FrameParticle(rTime); ComputeDistance(); UpdateGeometry(); + m_highlightTime = m_app->GetAbsTime(); + if (m_groundMark.draw) { if (m_groundMark.phase == Gfx::ENG_GR_MARK_PHASE_INC) // growing? @@ -402,16 +402,6 @@ void Gfx::CEngine::FrameMove(float rTime) } } } - - if (m_sound == nullptr) - m_sound = static_cast( m_iMan->SearchInstance(CLASS_SOUND) ); - - m_sound->FrameMove(rTime); -} - -void Gfx::CEngine::StepSimulation(float rTime) -{ - m_app->StepSimulation(rTime); } bool Gfx::CEngine::WriteScreenShot(const std::string& fileName, int width, int height) @@ -2726,16 +2716,6 @@ int Gfx::CEngine::GetEditIndentValue() return m_editIndentValue; } -void Gfx::CEngine::SetSpeed(float speed) -{ - m_speed = speed; -} - -float Gfx::CEngine::GetSpeed() -{ - return m_speed; -} - void Gfx::CEngine::SetTracePrecision(float factor) { m_tracePrecision = factor; -- cgit v1.2.3-1-g7c22