diff options
| author | Ray <[email protected]> | 2016-12-22 11:47:59 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-12-22 11:47:59 +0100 |
| commit | 4419ee9802d7a45929fb4ecae2163d12fb44f2a7 (patch) | |
| tree | 54862a2fe85937766ca753e32a05642898ca6852 /src/physac.h | |
| parent | 060d501cd1a8b591d38b3169ee98c416314261a7 (diff) | |
| parent | aaea2eb9a64ad97c54fe115f6fd132d6a00f76ef (diff) | |
| download | raylib-4419ee9802d7a45929fb4ecae2163d12fb44f2a7.tar.gz raylib-4419ee9802d7a45929fb4ecae2163d12fb44f2a7.zip | |
Merge pull request #210 from ficoos/fixes
Fixes
Diffstat (limited to 'src/physac.h')
| -rw-r--r-- | src/physac.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/physac.h b/src/physac.h index e807ffa6..d958c701 100644 --- a/src/physac.h +++ b/src/physac.h @@ -239,9 +239,10 @@ PHYSACDEF void ClosePhysics(void); // Functions required to query time on Windows int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); -#elif defined(__linux) +#elif defined(__linux) || defined(PLATFORM_WEB) #include <sys/time.h> // Required for: timespec #include <time.h> // Required for: clock_gettime() + #include <stdint.h> #endif //---------------------------------------------------------------------------------- @@ -266,7 +267,7 @@ PHYSACDEF void ClosePhysics(void); static unsigned int usedMemory = 0; // Total allocated dynamic memory static bool physicsThreadEnabled = false; // Physics thread enabled state static double currentTime = 0; // Current time in milliseconds -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(__linux) || defined(PLATFORM_WEB) static double baseTime = 0; // Android and RPI platforms base time #endif static double startTime = 0; // Start time in milliseconds @@ -1942,7 +1943,7 @@ static double GetCurrentTime(void) { double time = 0; - #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + #if defined(_WIN32) unsigned long long int clockFrequency, currentTime; QueryPerformanceFrequency(&clockFrequency); @@ -1951,7 +1952,7 @@ static double GetCurrentTime(void) time = (double)((double)currentTime/clockFrequency)*1000; #endif - #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(__linux) || defined(PLATFORM_WEB) struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); uint64_t temp = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; |
