From: Jason Woofenden Date: Mon, 2 Nov 2009 01:58:36 +0000 (-0500) Subject: Added a 1ns sleep after every frame X-Git-Tag: 0.5.5~9 X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=commitdiff_plain;h=647f72d2ed554c7e2b1923d485e99d89f3a17825 Added a 1ns sleep after every frame This made the game run much smoother on Josh's debian box. --- diff --git a/main.c b/main.c index 794ff8d..4a482fc 100644 --- a/main.c +++ b/main.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "font.h" @@ -137,6 +138,14 @@ extern int optind, opterr, optopt; // ************************************* FUNCS void +tiny_sleep() { + struct timespec t; + t.tv_sec = 0; + t.tv_nsec = 1; + nanosleep(&t, 0); +} + +void init_engine_dots() { int i; for(i = 0; i