From d508be4b887934845b34152022dad7ab8e1fdb88 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 6 Nov 2005 02:41:26 +0000 Subject: [PATCH] fix RageTimer::Half averaging backwards cleanup comment --- stepmania/src/RageTimer.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/stepmania/src/RageTimer.cpp b/stepmania/src/RageTimer.cpp index f493e59bb5..dc907a1f4d 100644 --- a/stepmania/src/RageTimer.cpp +++ b/stepmania/src/RageTimer.cpp @@ -73,20 +73,19 @@ float RageTimer::GetDeltaTime() return diff; } -/* Get a timer representing half of the time ago as this one. This is +/* + * Get a timer representing half of the time ago as this one. This is * useful for averaging time. For example, * * RageTimer tm; * ... do stuff ... * RageTimer AverageTime = tm.Half(); - * printf("Something happened between now and tm; the average time is %f.\n", tm.Ago()); - * tm.Touch(); + * printf( "Something happened approximately %f seconds ago.\n", tm.Ago() ); */ RageTimer RageTimer::Half() const { - const RageTimer now; - const float ProbableDelay = -(now - *this) / 2; - return *this + ProbableDelay; + const float fProbableDelay = Ago() / 2; + return *this + fProbableDelay; }