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.
**/
#include <common/config.h>
#ifdef LOVE_WINDOWS
# include <windows.h>
# include <time.h>
#else
# include <sys/time.h>
#endif
#include "Timer.h"
namespace love
@@ -92,18 +101,21 @@ namespace sdl
float Timer::getMicroTime() const
{
#ifdef LOVE_WINDOWS
#ifdef LOVE_WINDOWS
/*
long ticks, freq;
QueryPeformanceCounter(&ticks);
QueryPeformanceFrequency(&freq);
long secs = ticks/freq;
long usecs = (ticks%freq)/(freq/1000000.0f);
return secs%86400 + usecs/1000000.0f;
#else
*/
return 0;
#else
timeval t;
gettimeofday(&t, NULL);
return t.tv_sec%86400 + t.tv_usec/1000000.0f;
#endif
#endif
}
} // sdl
-6
View File
@@ -24,12 +24,6 @@
// SDL
#include <SDL.h>
#ifdef LOVE_WINDOWS
#include <time.h>
#else
#include <sys/time.h>
#endif
// LOVE
#include <common/Module.h>