diff --git a/stepmania/src/RageTimer.cpp b/stepmania/src/RageTimer.cpp index 15ee941f83..1a81e54fc7 100644 --- a/stepmania/src/RageTimer.cpp +++ b/stepmania/src/RageTimer.cpp @@ -9,7 +9,7 @@ /* We only actually get 1000 using SDL. */ #define TIMESTAMP_RESOLUTION 1000000 -const RageZeroTimer_t RageZeroTimer; +const RageTimer RageZeroTimer(0,0); void mySDL_GetTicks( unsigned &secs, unsigned &us ) { @@ -17,8 +17,13 @@ void mySDL_GetTicks( unsigned &secs, unsigned &us ) if( !bInitialized ) { bInitialized = true; - if( !SDL_WasInit(SDL_INIT_TIMER) ) - SDL_InitSubSystem( SDL_INIT_TIMER ); + /* We don't want the timer system; it starts a thread, and we never use it. */ + // if( !SDL_WasInit(SDL_INIT_TIMER) ) + // SDL_InitSubSystem( SDL_INIT_TIMER ); + + /* Calling this will still initialize the hidden "ticks" system, so we can + * use SDL_GetTicks. */ + SDL_InitSubSystem( 0 ); } /* Ticks may be less than last for at least two reasons: the time may have wrapped (after diff --git a/stepmania/src/RageTimer.h b/stepmania/src/RageTimer.h index d3f143f042..f17f273f92 100644 --- a/stepmania/src/RageTimer.h +++ b/stepmania/src/RageTimer.h @@ -27,6 +27,7 @@ class RageTimer { public: RageTimer() { Touch(); } + RageTimer( int secs, int us ): m_secs(secs), m_us(us) { } /* Time ago this RageTimer represents. */ float Ago() const; @@ -62,11 +63,7 @@ private: static float Difference(const RageTimer &lhs, const RageTimer &rhs); }; -struct RageZeroTimer_t: public RageTimer -{ - RageZeroTimer_t() { SetZero(); } -}; -extern const RageZeroTimer_t RageZeroTimer; +extern const RageTimer RageZeroTimer; #endif