Commit 480e1b33 authored by Georg Schäfer's avatar Georg Schäfer
Browse files

Add audio and vidoe latency to game engine.

parent d1bd74c5
Pipeline #3331 failed with stage
in 3 minutes and 53 seconds
...@@ -40,6 +40,10 @@ namespace phase_shifter { ...@@ -40,6 +40,10 @@ namespace phase_shifter {
auto global_render() noexcept -> auto& { return *_global_render; } auto global_render() noexcept -> auto& { return *_global_render; }
auto render_pass_mask() noexcept -> auto& { return _render_pass_mask; } auto render_pass_mask() noexcept -> auto& { return _render_pass_mask; }
auto audio() noexcept -> auto& { return _audio; } auto audio() noexcept -> auto& { return _audio; }
auto audio_latency() const noexcept { return _audio_latency; }
auto audio_latency(float latency) noexcept { _audio_latency = latency; }
auto video_latency() const noexcept { return _video_latency; }
auto video_latency(float latency) noexcept { _video_latency = latency; }
protected: protected:
void _on_post_frame(mirrage::util::Time) override; void _on_post_frame(mirrage::util::Time) override;
...@@ -50,6 +54,8 @@ namespace phase_shifter { ...@@ -50,6 +54,8 @@ namespace phase_shifter {
std::unique_ptr<mirrage::renderer::Deferred_renderer> _global_render; std::unique_ptr<mirrage::renderer::Deferred_renderer> _global_render;
mirrage::renderer::Render_pass_mask _render_pass_mask; mirrage::renderer::Render_pass_mask _render_pass_mask;
eam::audio _audio; eam::audio _audio;
}; float _audio_latency = 0.f;
float _video_latency = 0.f;
}; // namespace phase_shifter
} // namespace phase_shifter } // namespace phase_shifter
...@@ -111,6 +111,8 @@ namespace phase_shifter { ...@@ -111,6 +111,8 @@ namespace phase_shifter {
_video_latency = _video_latency =
std::accumulate(_video_latencies.begin() + 1, _video_latencies.end() - 1, 0.f) std::accumulate(_video_latencies.begin() + 1, _video_latencies.end() - 1, 0.f)
/ 3.f; / 3.f;
static_cast<Game_engine&>(_engine).audio_latency(_audio_latency);
static_cast<Game_engine&>(_engine).video_latency(_video_latency);
_engine.screens().enter<Intro_screen>(); _engine.screens().enter<Intro_screen>();
} }
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment