Lines 1-67
Link Here
|
1 |
diff -ru game.c bastet-0.41/game.c |
|
|
2 |
--- game.c Sat Dec 18 00:28:00 2004 |
3 |
+++ bastet-0.41/game.c Sat Dec 18 00:56:26 2004 |
4 |
@@ -12,6 +12,9 @@ |
5 |
#include "game.h" |
6 |
#include "main.h" |
7 |
#include "bast.h" |
8 |
+#include <sys/select.h> |
9 |
+ |
10 |
+void bast_clear(); |
11 |
|
12 |
const DOT block_data[BLOCK_TYPES][BLOCK_ORIENTS][BLOCK_DOTS] = |
13 |
{ |
14 |
@@ -66,7 +70,7 @@ |
15 |
|
16 |
/* Delay before block drop one step down (usec). |
17 |
We start at one sec. and then decreases the delay by 23% at each level. */ |
18 |
-const int delay[NO_LEVELS] = {1000000, 770000, 593000, 457000, 352000, 271000, 208000, 160000, 124000, 95000}; |
19 |
+const int delay[NO_LEVELS] = {999999, 770000, 593000, 457000, 352000, 271000, 208000, 160000, 124000, 95000}; |
20 |
|
21 |
/* Window in which the action takes place. */ |
22 |
WINDOW *well_win; |
23 |
@@ -278,6 +282,7 @@ |
24 |
refresh(); |
25 |
} |
26 |
|
27 |
+struct timeval mytimeout; |
28 |
/* Drop a block in the well. When done return y-cord. of where block |
29 |
ended. If it's not possible to even start with a new block return -1. */ |
30 |
int drop_block(int type, int level) |
31 |
@@ -288,14 +293,13 @@ |
32 |
int orient = 0; |
33 |
int ch; |
34 |
fd_set inputs, test_fds; |
35 |
- struct timeval timeout; |
36 |
int sel_ret; |
37 |
|
38 |
if (0 == check_block_pos(y, x, type, orient)) |
39 |
return -1; /* Oh no, game over. */ |
40 |
|
41 |
- timeout.tv_sec = 0; |
42 |
- timeout.tv_usec = delay[level]; |
43 |
+ mytimeout.tv_sec = 0; |
44 |
+ mytimeout.tv_usec = delay[level]; |
45 |
|
46 |
FD_ZERO(&inputs); |
47 |
FD_SET(0, &inputs); |
48 |
@@ -308,7 +312,7 @@ |
49 |
while(1) { |
50 |
test_fds = inputs; |
51 |
|
52 |
- sel_ret = select(FD_SETSIZE, &test_fds, (fd_set *) 0, (fd_set *) 0, &timeout); |
53 |
+ sel_ret = select(FD_SETSIZE, &test_fds, (fd_set *) 0, (fd_set *) 0, &mytimeout); |
54 |
|
55 |
ch = getch(); |
56 |
|
57 |
@@ -391,8 +402,8 @@ |
58 |
set_block(y, x, type, orient); |
59 |
return y; |
60 |
} |
61 |
- timeout.tv_sec = 0; |
62 |
- timeout.tv_usec = delay[level]; |
63 |
+ mytimeout.tv_sec = 0; |
64 |
+ mytimeout.tv_usec = delay[level]; |
65 |
} |
66 |
} |
67 |
} |