simplify; make data public

This commit is contained in:
Glenn Maynard
2003-07-14 06:22:08 +00:00
parent 7483a249b4
commit 649f1a81c5
2 changed files with 6 additions and 7 deletions
+1 -2
View File
@@ -11,8 +11,7 @@
float RageTimer::GetTimeSinceStart()
{
static RageTimer g_Start;
return g_Start.Ago();
return SDL_GetTicks() / 1000.0f;
}
void RageTimer::Touch()
+5 -5
View File
@@ -30,7 +30,6 @@ public:
/* Time ago this RageTimer represents. */
float Ago() const;
// inline void Touch();
void Touch();
inline bool IsZero() const { return m_secs == 0 && m_us == 0; }
inline void SetZero() { m_secs = m_us = 0; }
@@ -49,15 +48,16 @@ public:
/* Find the amount of time between two timestamps. The result is a duration. */
float operator-(const RageTimer &rhs) const;
private:
static RageTimer Sum(const RageTimer &lhs, float tm);
static float Difference(const RageTimer &lhs, const RageTimer &rhs);
/* "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
* everywhere, since it's slow. I'd rather not use double just for RageTimers, since
* it's too easy to get a type wrong and end up with obscure resolution problems. */
unsigned m_secs, m_us;
private:
static RageTimer Sum(const RageTimer &lhs, float tm);
static float Difference(const RageTimer &lhs, const RageTimer &rhs);
};
#endif