Mercurial > hg > early-roguelike
comparison arogue5/outside.c @ 218:56e748983fa8
Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
author | John "Elwin" Edwards |
---|---|
date | Sun, 07 Feb 2016 14:39:21 -0500 |
parents | 0ed67132cf10 |
children |
comparison
equal
deleted
inserted
replaced
217:94a0d9dd5ce1 | 218:56e748983fa8 |
---|---|
9 */ | 9 */ |
10 | 10 |
11 #include "curses.h" | 11 #include "curses.h" |
12 #include "rogue.h" | 12 #include "rogue.h" |
13 | 13 |
14 extern char rnd_terrain(), get_terrain(); | 14 char rnd_terrain(void); |
15 char get_terrain(char one, char two, char three, char four); | |
15 | 16 |
16 /* | 17 /* |
17 * init_terrain: | 18 * init_terrain: |
18 * Get the single "outside room" set up correctly | 19 * Get the single "outside room" set up correctly |
19 */ | 20 */ |
20 | 21 |
21 void | 22 void |
22 init_terrain() | 23 init_terrain(void) |
23 { | 24 { |
24 register struct room *rp; | 25 register struct room *rp; |
25 | 26 |
26 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) { | 27 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) { |
27 rp->r_flags = ISGONE; /* kill all rooms */ | 28 rp->r_flags = ISGONE; /* kill all rooms */ |
36 } | 37 } |
37 | 38 |
38 | 39 |
39 | 40 |
40 void | 41 void |
41 do_terrain(basey, basex, deltay, deltax, fresh) | 42 do_terrain(int basey, int basex, int deltay, int deltax, bool fresh) |
42 int basey, basex, deltay, deltax; | 43 { |
43 bool fresh; | 44 int cury, curx; /* Current y and x positions */ |
44 { | |
45 register cury, curx; /* Current y and x positions */ | |
46 | 45 |
47 /* Lay out the boundary */ | 46 /* Lay out the boundary */ |
48 for (cury=1; cury<LINES-2; cury++) { /* Vertical "walls" */ | 47 for (cury=1; cury<LINES-2; cury++) { /* Vertical "walls" */ |
49 mvaddch(cury, 0, '|'); | 48 mvaddch(cury, 0, '|'); |
50 mvaddch(cury, COLS-1, '|'); | 49 mvaddch(cury, COLS-1, '|'); |
123 * rnd_terrain: | 122 * rnd_terrain: |
124 * return a weighted, random type of outside terrain | 123 * return a weighted, random type of outside terrain |
125 */ | 124 */ |
126 | 125 |
127 char | 126 char |
128 rnd_terrain() | 127 rnd_terrain(void) |
129 { | 128 { |
130 int chance = rnd(100); | 129 int chance = rnd(100); |
131 | 130 |
132 /* Forest is most likely */ | 131 /* Forest is most likely */ |
133 if (chance < 60) return(FOREST); | 132 if (chance < 60) return(FOREST); |
147 * get_terrain: | 146 * get_terrain: |
148 * return a terrain weighted by what is surrounding | 147 * return a terrain weighted by what is surrounding |
149 */ | 148 */ |
150 | 149 |
151 char | 150 char |
152 get_terrain(one, two, three, four) | 151 get_terrain(char one, char two, char three, char four) |
153 char one, two, three, four; | |
154 { | 152 { |
155 register int i; | 153 register int i; |
156 int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0; | 154 int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0; |
157 char surrounding[4]; | 155 char surrounding[4]; |
158 | 156 |
201 * lake_check: | 199 * lake_check: |
202 * Determine if the player would drown | 200 * Determine if the player would drown |
203 */ | 201 */ |
204 | 202 |
205 void | 203 void |
206 lake_check(place) | 204 lake_check(coord *place) |
207 coord *place; | |
208 { | 205 { |
209 NOOP(place); | 206 NOOP(place); |
210 } | 207 } |