From 4757f00abaf83cfe6f457fd05e1fe99b953b51ef Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 26 Jan 2005 20:53:21 +0000 Subject: [PATCH] add RageTimer::operator+= cleanup --- stepmania/src/RageTimer.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageTimer.h b/stepmania/src/RageTimer.h index 6edfabe8b8..bace417374 100644 --- a/stepmania/src/RageTimer.h +++ b/stepmania/src/RageTimer.h @@ -47,10 +47,11 @@ public: RageTimer Half() const; /* Add (or subtract) a duration from a timestamp. The result is another timestamp. */ - RageTimer operator+(float tm) const; + RageTimer operator+( float tm ) const; + void operator+=( float tm ) { *this = *this + tm; } /* Find the amount of time between two timestamps. The result is a duration. */ - float operator-(const RageTimer &rhs) const; + float operator-( const RageTimer &rhs ) const; /* "float" is bad for a "time since start" RageTimer. If the game is running for * several days, we'll lose a lot of resolution. I don't want to use double @@ -59,8 +60,8 @@ public: unsigned m_secs, m_us; private: - static RageTimer Sum(const RageTimer &lhs, float tm); - static float Difference(const RageTimer &lhs, const RageTimer &rhs); + static RageTimer Sum( const RageTimer &lhs, float tm ); + static float Difference( const RageTimer &lhs, const RageTimer &rhs ); }; extern const RageTimer RageZeroTimer;