Mercurial > hg > early-roguelike
comparison arogue5/rooms.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 | c49f7927b0fa |
children |
comparison
equal
deleted
inserted
replaced
217:94a0d9dd5ce1 | 218:56e748983fa8 |
---|---|
14 | 14 |
15 #include "curses.h" | 15 #include "curses.h" |
16 #include "rogue.h" | 16 #include "rogue.h" |
17 #include <stdlib.h> | 17 #include <stdlib.h> |
18 | 18 |
19 do_rooms() | 19 void horiz(int cnt); |
20 void vert(int cnt); | |
21 | |
22 void | |
23 do_rooms(void) | |
20 { | 24 { |
21 register int i; | 25 register int i; |
22 register struct room *rp; | 26 register struct room *rp; |
23 register struct linked_list *item; | 27 register struct linked_list *item; |
24 register struct thing *tp; | 28 register struct thing *tp; |
97 register struct object *cur; | 101 register struct object *cur; |
98 coord tp; | 102 coord tp; |
99 | 103 |
100 has_gold = TRUE; /* This room has gold in it */ | 104 has_gold = TRUE; /* This room has gold in it */ |
101 | 105 |
102 item = spec_item(GOLD, NULL, NULL, NULL); | 106 item = spec_item(GOLD, 0, 0, 0); |
103 cur = OBJPTR(item); | 107 cur = OBJPTR(item); |
104 | 108 |
105 /* Put the gold into the level list of items */ | 109 /* Put the gold into the level list of items */ |
106 attach(lvl_obj, item); | 110 attach(lvl_obj, item); |
107 | 111 |
151 | 155 |
152 /* | 156 /* |
153 * Draw a box around a room | 157 * Draw a box around a room |
154 */ | 158 */ |
155 | 159 |
156 draw_room(rp) | 160 void |
157 register struct room *rp; | 161 draw_room(struct room *rp) |
158 { | 162 { |
159 register int j, k; | 163 register int j, k; |
160 | 164 |
161 move(rp->r_pos.y, rp->r_pos.x+1); | 165 move(rp->r_pos.y, rp->r_pos.x+1); |
162 vert(rp->r_max.y-2); /* Draw left side */ | 166 vert(rp->r_max.y-2); /* Draw left side */ |
179 /* | 183 /* |
180 * horiz: | 184 * horiz: |
181 * draw a horizontal line | 185 * draw a horizontal line |
182 */ | 186 */ |
183 | 187 |
184 horiz(cnt) | 188 void |
185 register int cnt; | 189 horiz(int cnt) |
186 { | 190 { |
187 while (cnt--) | 191 while (cnt--) |
188 addch('-'); | 192 addch('-'); |
189 } | 193 } |
190 | 194 |
191 /* | 195 /* |
192 * rnd_pos: | 196 * rnd_pos: |
193 * pick a random spot in a room | 197 * pick a random spot in a room |
194 */ | 198 */ |
195 | 199 |
196 rnd_pos(rp, cp) | 200 void |
197 register struct room *rp; | 201 rnd_pos(struct room *rp, coord *cp) |
198 register coord *cp; | |
199 { | 202 { |
200 cp->x = rp->r_pos.x + rnd(rp->r_max.x-2) + 1; | 203 cp->x = rp->r_pos.x + rnd(rp->r_max.x-2) + 1; |
201 cp->y = rp->r_pos.y + rnd(rp->r_max.y-2) + 1; | 204 cp->y = rp->r_pos.y + rnd(rp->r_max.y-2) + 1; |
202 } | 205 } |
203 | 206 |
208 * Find what room some coordinates are in. NULL means they aren't | 211 * Find what room some coordinates are in. NULL means they aren't |
209 * in any room. | 212 * in any room. |
210 */ | 213 */ |
211 | 214 |
212 struct room * | 215 struct room * |
213 roomin(cp) | 216 roomin(coord *cp) |
214 register coord *cp; | |
215 { | 217 { |
216 register struct room *rp; | 218 register struct room *rp; |
217 | 219 |
218 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) | 220 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) |
219 if (inroom(rp, cp)) | 221 if (inroom(rp, cp)) |
224 /* | 226 /* |
225 * vert: | 227 * vert: |
226 * draw a vertical line | 228 * draw a vertical line |
227 */ | 229 */ |
228 | 230 |
229 vert(cnt) | 231 void |
230 register int cnt; | 232 vert(int cnt) |
231 { | 233 { |
232 register int x, y; | 234 register int x, y; |
233 | 235 |
234 getyx(stdscr, y, x); | 236 getyx(stdscr, y, x); |
235 x--; | 237 x--; |