mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Moved #ifdef LOVE_WINDOWS to Timer.cpp.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user