Mercurial > hg > early-roguelike
comparison rogue4/passages.c @ 225:4f6e056438eb
Merge the GCC5 and build fix branches.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:28:34 -0500 |
parents | 1b73a8641b37 |
children | 0250220d8cdd |
comparison
equal
deleted
inserted
replaced
224:4d0f53998e8a | 225:4f6e056438eb |
---|---|
8 * All rights reserved. | 8 * All rights reserved. |
9 * | 9 * |
10 * See the file LICENSE.TXT for full copyright and licensing information. | 10 * See the file LICENSE.TXT for full copyright and licensing information. |
11 */ | 11 */ |
12 | 12 |
13 #include <stdlib.h> | |
13 #include <curses.h> | 14 #include <curses.h> |
14 #include "rogue.h" | 15 #include "rogue.h" |
15 | 16 |
17 void conn(int r1, int r2); | |
18 void door(struct room *rm, coord *cp); | |
19 void passnum(void); | |
20 void numpass(int y, int x); | |
21 | |
16 /* | 22 /* |
17 * do_passages: | 23 * do_passages: |
18 * Draw all the passages on a level. | 24 * Draw all the passages on a level. |
19 */ | 25 */ |
20 do_passages() | 26 void |
27 do_passages(void) | |
21 { | 28 { |
22 register struct rdes *r1, *r2 = NULL; | 29 register struct rdes *r1, *r2 = NULL; |
23 register int i, j; | 30 register int i, j; |
24 register int roomcount; | 31 register int roomcount; |
25 static struct rdes | 32 static struct rdes |
123 | 130 |
124 /* | 131 /* |
125 * conn: | 132 * conn: |
126 * Draw a corridor from a room in a certain direction. | 133 * Draw a corridor from a room in a certain direction. |
127 */ | 134 */ |
128 conn(r1, r2) | 135 void |
129 int r1, r2; | 136 conn(int r1, int r2) |
130 { | 137 { |
131 register struct room *rpf, *rpt = NULL; | 138 register struct room *rpf, *rpt = NULL; |
132 register char rmt; | 139 register char rmt; |
133 register int distance = 0, turn_spot = 0, turn_distance = 0, index; | 140 register int distance = 0, turn_spot = 0, turn_distance = 0, index; |
134 register int rm; | 141 register int rm; |
267 /* | 274 /* |
268 * door: | 275 * door: |
269 * Add a door or possibly a secret door. Also enters the door in | 276 * Add a door or possibly a secret door. Also enters the door in |
270 * the exits array of the room. | 277 * the exits array of the room. |
271 */ | 278 */ |
272 door(rm, cp) | 279 void |
273 register struct room *rm; | 280 door(struct room *rm, coord *cp) |
274 register coord *cp; | |
275 { | 281 { |
276 register int index; | 282 register int index; |
277 | 283 |
278 index = INDEX(cp->y, cp->x); | 284 index = INDEX(cp->y, cp->x); |
279 if (rnd(10) + 1 < level && rnd(5) == 0) | 285 if (rnd(10) + 1 < level && rnd(5) == 0) |
289 #ifdef WIZARD | 295 #ifdef WIZARD |
290 /* | 296 /* |
291 * add_pass: | 297 * add_pass: |
292 * Add the passages to the current window (wizard command) | 298 * Add the passages to the current window (wizard command) |
293 */ | 299 */ |
294 add_pass() | 300 void |
301 add_pass(void) | |
295 { | 302 { |
296 register int y, x, ch; | 303 register int y, x, ch; |
297 | 304 |
298 for (y = 1; y < LINES - 1; y++) | 305 for (y = 1; y < LINES - 1; y++) |
299 for (x = 0; x < COLS; x++) | 306 for (x = 0; x < COLS; x++) |
307 * Assign a number to each passageway | 314 * Assign a number to each passageway |
308 */ | 315 */ |
309 static int pnum; | 316 static int pnum; |
310 static bool newpnum; | 317 static bool newpnum; |
311 | 318 |
312 passnum() | 319 void |
320 passnum(void) | |
313 { | 321 { |
314 register struct room *rp; | 322 register struct room *rp; |
315 register int i; | 323 register int i; |
316 | 324 |
317 pnum = 0; | 325 pnum = 0; |
328 | 336 |
329 /* | 337 /* |
330 * numpass: | 338 * numpass: |
331 * Number a passageway square and its brethren | 339 * Number a passageway square and its brethren |
332 */ | 340 */ |
333 numpass(y, x) | 341 void |
334 register int y, x; | 342 numpass(int y, int x) |
335 { | 343 { |
336 register char *fp; | 344 register char *fp; |
337 register struct room *rp; | 345 register struct room *rp; |
338 register char ch; | 346 register char ch; |
339 | 347 |