From ed876ca64d65d54be4fb7a6d1c6117a8d0c2e67c Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 16 Dec 2020 16:39:06 +0100 Subject: [PATCH] Spectre/Game/GameTime: remove useless m_inLoop variable. --- include/Spectre/Game/GameTime.h | 2 -- source/Game/GameTime.cpp | 9 ++------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/include/Spectre/Game/GameTime.h b/include/Spectre/Game/GameTime.h index aa85f17..39cfcea 100644 --- a/include/Spectre/Game/GameTime.h +++ b/include/Spectre/Game/GameTime.h @@ -42,8 +42,6 @@ protected : // Timeslice. Time m_slice; - - bool m_inLoop; }; } // namespace sp diff --git a/source/Game/GameTime.cpp b/source/Game/GameTime.cpp index fa98d35..c6d8061 100644 --- a/source/Game/GameTime.cpp +++ b/source/Game/GameTime.cpp @@ -29,14 +29,10 @@ Time GameTime::getElapsed() const bool GameTime::beginFrame() { - m_inLoop = false; - accumulateTime(); - if (m_acc > m_slice) { - m_inLoop = true; - } - return m_inLoop; + // Signal if we should tick + return m_acc > m_slice; } bool GameTime::tick() @@ -51,7 +47,6 @@ bool GameTime::tick() void GameTime::reset() { m_watch.restart(); - m_inLoop = false; } void GameTime::accumulateTime()