X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=main.c;h=b7332c5beb00b665ecc65f118c8ee847ed847ef7;hp=2bf77152e5b9c305ce4d0ed6d6d442b58d0f8683;hb=96d01a50f7d3949ea598c404f1a26a8b909207f2;hpb=c1db302b3620bf4e0314867cddf094402d76d2d6 diff --git a/main.c b/main.c index 2bf7715..b7332c5 100644 --- a/main.c +++ b/main.c @@ -26,12 +26,13 @@ #include #include #include +#include #include "font.h" #include "args.h" #include "common.h" -#include "config.h" +#include "vorconfig.h" #include "dust.h" #include "file.h" #include "float.h" @@ -68,6 +69,8 @@ struct dot { int heat; // heat multiplier (color). }; +void draw(void); + struct dot edot[MAXENGINEDOTS], *dotptr = edot; struct dot bdot[MAXBANGDOTS]; @@ -134,6 +137,18 @@ extern int optind, opterr, optopt; // ************************************* FUNCS +#ifdef nanosleep +void +tiny_sleep() { + struct timespec t; + t.tv_sec = 0; + t.tv_nsec = 1; + nanosleep(&t, 0); +} +#else +#define tiny_sleep() +#endif + void init_engine_dots() { int i; @@ -362,6 +377,9 @@ void toggle_fullscreen() { opt_fullscreen = 1 - opt_fullscreen; set_video_mode(); + if(paused) { + draw(); + } } @@ -830,6 +848,8 @@ gameloop() { state = HIGH_SCORE_DISPLAY; state_timeout = 400; } + + tiny_sleep(); } }