mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-11-18 13:56:00 +00:00
Detour/Recast/Demo: Removed GCC reorder warnings (enabled -Wreorder under xcode).
Recast: RecastTimer should compile with null implementation under Linux now.
This commit is contained in:
@@ -1,30 +1,31 @@
|
||||
#include "RecastTimer.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32)
|
||||
|
||||
// Win32
|
||||
#include <windows.h>
|
||||
|
||||
rcTimeVal rcGetPerformanceTimer()
|
||||
{
|
||||
__int64 count;
|
||||
QueryPerformanceCounter((LARGE_INTEGER*)&count);
|
||||
return count;
|
||||
__int64 count;
|
||||
QueryPerformanceCounter((LARGE_INTEGER*)&count);
|
||||
return count;
|
||||
}
|
||||
|
||||
int rcGetDeltaTimeUsec(rcTimeVal start, rcTimeVal end)
|
||||
{
|
||||
static __int64 freq = 0;
|
||||
if (freq == 0)
|
||||
QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
|
||||
static __int64 freq = 0;
|
||||
if (freq == 0)
|
||||
QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
|
||||
__int64 elapsed = end - start;
|
||||
return (int)(elapsed*1000000 / freq);
|
||||
}
|
||||
|
||||
#else
|
||||
#elif defined(__MACH__)
|
||||
|
||||
// OSX
|
||||
#include <mach/mach_time.h>
|
||||
|
||||
|
||||
rcTimeVal rcGetPerformanceTimer()
|
||||
{
|
||||
return mach_absolute_time();
|
||||
@@ -40,4 +41,18 @@ int rcGetDeltaTimeUsec(rcTimeVal start, rcTimeVal end)
|
||||
return (int)(nanosec / 1000);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// TODO: Linux, etc
|
||||
|
||||
rcTimeVal rcGetPerformanceTimer()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rcGetDeltaTimeUsec(rcTimeVal start, rcTimeVal end)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user