Mercurial > hg > old > magoroku_racing.bad
diff mytype.c @ 96:0b65ca27f113
compile on Mac OS X 2
author | Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 02 Jun 2011 14:56:11 +0900 |
parents | 8edae89a3877 |
children |
line wrap: on
line diff
--- a/mytype.c Thu May 26 18:13:40 2011 +0900 +++ b/mytype.c Thu Jun 02 14:56:11 2011 +0900 @@ -1,11 +1,10 @@ -/* - * $Id$ - */ +/* mytype.c */ + #include <time.h> #include <stdio.h> #include <stdbool.h> -//#include "libps2.h" -//#include "ps2util.h" +#include "libps2.h" +#include "ps2util.h" #include "mytype.h" static clock_t start; @@ -14,7 +13,7 @@ void wait_init() { - start = clock(); + start = clock(); } /* @@ -24,32 +23,32 @@ bool wait(double time) { - clock_t t; - double a; + clock_t t; + double a; - t = clock(); - a = (t-start)/(double)CLOCKS_PER_SEC; - if (a > time) { - return true; - } + t = clock(); + a = (t-start)/(double)CLOCKS_PER_SEC; + if (a > time) { + return true; + } - return false; + return false; } void time_RaceStart() { - race_start = clock(); + race_start = clock(); } double time_RaceTime() { - clock_t t; - double a; + clock_t t; + double a; - t = clock(); - a = (t-race_start)/(double)CLOCKS_PER_SEC; + t = clock(); + a = (t-race_start)/(double)CLOCKS_PER_SEC; - return a; + return a; }