comparison xrogue/outside.c @ 220:f54901b9c39b

XRogue: convert to ANSI-style function declarations.
author John "Elwin" Edwards
date Wed, 02 Mar 2016 21:13:26 -0500
parents e6179860cb76
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
219:f9ef86cf22b2 220:f54901b9c39b
13 */ 13 */
14 14
15 #include <curses.h> 15 #include <curses.h>
16 #include "rogue.h" 16 #include "rogue.h"
17 17
18 extern char rnd_terrain(), get_terrain(); 18 char rnd_terrain(void);
19 char get_terrain(char one, char two, char three, char four);
19 20
20 /* 21 /*
21 * init_terrain: 22 * init_terrain:
22 * Get the single "outside room" set up correctly 23 * Get the single "outside room" set up correctly
23 */ 24 */
24 25
25 void 26 void
26 init_terrain() 27 init_terrain(void)
27 { 28 {
28 register struct room *rp; 29 register struct room *rp;
29 30
30 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) { 31 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) {
31 rp->r_flags = ISGONE; /* kill all rooms */ 32 rp->r_flags = ISGONE; /* kill all rooms */
38 rp->r_max.x = cols; 39 rp->r_max.x = cols;
39 rp->r_max.y = lines - 3; 40 rp->r_max.y = lines - 3;
40 } 41 }
41 42
42 void 43 void
43 do_terrain(basey, basex, deltay, deltax, fresh) 44 do_terrain(int basey, int basex, int deltay, int deltax, bool fresh)
44 int basey, basex, deltay, deltax;
45 bool fresh;
46 { 45 {
47 register int cury, curx; /* Current y and x positions */ 46 register int cury, curx; /* Current y and x positions */
48 47
49 /* Lay out the boundary */ 48 /* Lay out the boundary */
50 for (cury=1; cury<lines-2; cury++) { /* Vertical "walls" */ 49 for (cury=1; cury<lines-2; cury++) { /* Vertical "walls" */
138 * rnd_terrain: 137 * rnd_terrain:
139 * return a weighted, random type of outside terrain 138 * return a weighted, random type of outside terrain
140 */ 139 */
141 140
142 char 141 char
143 rnd_terrain() 142 rnd_terrain(void)
144 { 143 {
145 int chance = rnd(100); 144 int chance = rnd(100);
146 145
147 /* Meadow is most likely */ 146 /* Meadow is most likely */
148 if (chance < 40) return(FLOOR); 147 if (chance < 40) return(FLOOR);
162 * get_terrain: 161 * get_terrain:
163 * return a terrain weighted by what is surrounding 162 * return a terrain weighted by what is surrounding
164 */ 163 */
165 164
166 char 165 char
167 get_terrain(one, two, three, four) 166 get_terrain(char one, char two, char three, char four)
168 char one, two, three, four;
169 { 167 {
170 register int i; 168 register int i;
171 int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0; 169 int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0;
172 char surrounding[4]; 170 char surrounding[4];
173 171