diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/main.c b/src/main.c index 4886523..6f2e96e 100644 --- a/src/main.c +++ b/src/main.c @@ -51,28 +51,10 @@ static int internal_clock() { const struct timespec Delay = { 0, 16666666 }; - struct timespec Remaining = { - 0, 0 - }; - bool Lock = true; + struct timespec Remaining; while(GameGoing == true) { SDL_AtomicAdd(&Ticks, 1); nanosleep(&Delay, &Remaining); - if (Remaining.tv_nsec != 0 && Remaining.tv_sec != 0) { - Lock = true; - double InitialTime = GetTime(); - double TotalRemainingTime = (Remaining.tv_sec/1000000000.0f)+(Remaining.tv_nsec*1000000000.0f); - while(Lock == true) { - double CurrentTime = GetTime() - InitialTime; - TotalRemainingTime -= CurrentTime; - if(TotalRemainingTime <= 0) { - Lock = false; - } - } - } else { - Lock = false; - } - } return(0); } |