X-Git-Url: http://git.shiar.nl/netris.git/blobdiff_plain/67c063ab72ebe37d99e036c7a9d3fcecf1e168aa..HEAD:/util.c diff --git a/util.c b/util.c index e94f526..92a8908 100644 --- a/util.c +++ b/util.c @@ -81,31 +81,6 @@ void DistInfo(void) ); } -void Rules(void) -{ - Header(); - fprintf(stderr, - "One player mode\n" - "---------------\n" - "Good old Tetris. Scoring is like on the GameBoy version (so try to\n" - "remove as many lines at once as you can). After removing ten lines\n" - "you go to the next level, which will be faster thus making the game\n" - "harder to play.\n" - "\n" - "Two player mode\n" - "---------------\n" - "It's just like normal T*tris except that when you clear more than\n" - "one row with a single piece, the other player receives penalty lines\n" - "For clearing 2, 3 or 4 rows, respectively 1, 2 or 4 junk rows will\n" - "be added to the bottom of your opponent's board respectively.\n" - "The junk rows have exactly one empty column, which will line up for\n" - "multiple rows.\n" - "\n" - "The longest surviving player wins the game.\n" - "\n" - ); -} - ///////////// RANDOM ///////////// /* @@ -160,6 +135,24 @@ int MyWrite(int fd, void *data, int len) return len; } +///////////// CONFIG ///////////// + +void WriteConf(void) +{ + FILE *file_out; + + file_out = fopen(CONFIG_FILE, "w"); + if (file_out == NULL) { + perror("Error writing config file"); + exit(1); + } + + fprintf(file_out, "### NETRIS %s Config file ###\n\n", version_string); + + fclose(file_out); + fprintf(stderr, "Wrote new game configuration to %s\n", CONFIG_FILE); +} + ///////////// TIME ///////////// void NormalizeTime(struct timeval *tv) @@ -219,10 +212,7 @@ void ResumeTime(void) long CurTimeval(void) { - struct timeval tv; - - gettimeofday(&tv, NULL); - return GetTimeval(&tv) - baseTimeval; + return AbsTimeval() - baseTimeval; } static long SetITimer1(long interval, long value)