Moved #ifdef LOVE_WINDOWS to Timer.cpp.

This commit is contained in:
rude
2009-11-22 14:36:00 +01:00
parent 267547b6c0
commit 16f6219957
2 changed files with 15 additions and 9 deletions
+15 -3
View File
@@ -18,6 +18,15 @@
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
**/ **/
#include <common/config.h>
#ifdef LOVE_WINDOWS
# include <windows.h>
# include <time.h>
#else
# include <sys/time.h>
#endif
#include "Timer.h" #include "Timer.h"
namespace love namespace love
@@ -92,18 +101,21 @@ namespace sdl
float Timer::getMicroTime() const float Timer::getMicroTime() const
{ {
#ifdef LOVE_WINDOWS #ifdef LOVE_WINDOWS
/*
long ticks, freq; long ticks, freq;
QueryPeformanceCounter(&ticks); QueryPeformanceCounter(&ticks);
QueryPeformanceFrequency(&freq); QueryPeformanceFrequency(&freq);
long secs = ticks/freq; long secs = ticks/freq;
long usecs = (ticks%freq)/(freq/1000000.0f); long usecs = (ticks%freq)/(freq/1000000.0f);
return secs%86400 + usecs/1000000.0f; return secs%86400 + usecs/1000000.0f;
#else */
return 0;
#else
timeval t; timeval t;
gettimeofday(&t, NULL); gettimeofday(&t, NULL);
return t.tv_sec%86400 + t.tv_usec/1000000.0f; return t.tv_sec%86400 + t.tv_usec/1000000.0f;
#endif #endif
} }
} // sdl } // sdl
-6
View File
@@ -24,12 +24,6 @@
// SDL // SDL
#include <SDL.h> #include <SDL.h>
#ifdef LOVE_WINDOWS
#include <time.h>
#else
#include <sys/time.h>
#endif
// LOVE // LOVE
#include <common/Module.h> #include <common/Module.h>