Mercurial > hg > early-roguelike
diff xrogue/maze.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 | 0250220d8cdd |
line wrap: on
line diff
--- a/xrogue/maze.c Fri Feb 19 21:02:28 2016 -0500 +++ b/xrogue/maze.c Wed Mar 02 21:13:26 2016 -0500 @@ -27,8 +27,11 @@ static char *maze_frontier, *maze_bits; static int maze_lines, maze_cols; -static char *moffset(), *foffset(); -static int rmwall(),findcells(),crankout(),draw_maze(); +static char *moffset(int y, int x); +static char *foffset(int y, int x); +static void rmwall(int newy, int newx, int oldy, int oldx); +static void draw_maze(void); +static int findcells(int y, int x); /* * crankout: @@ -36,7 +39,8 @@ */ static -crankout() +void +crankout(void) { reg int x, y; @@ -70,7 +74,8 @@ * Draw the maze on this level. */ -do_maze() +void +do_maze(void) { reg int least; reg struct room *rp; @@ -94,7 +99,7 @@ /* * add some gold to make it worth looking for */ - item = spec_item(GOLD, NULL, NULL, NULL); + item = spec_item(GOLD, 0, 0, 0); obj = OBJPTR(item); obj->o_count *= (rnd(50) + 50); /* add in one large hunk */ attach(lvl_obj, item); @@ -107,7 +112,7 @@ /* * add in some food to make sure he has enough */ - item = spec_item(FOOD, NULL, NULL, NULL); + item = spec_item(FOOD, 0, 0, 0); obj = OBJPTR(item); attach(lvl_obj, item); do { @@ -146,7 +151,8 @@ */ static -draw_maze() +void +draw_maze(void) { reg int i, j, more; reg char *ptr; @@ -183,8 +189,8 @@ * Figure out cells to open up */ -static findcells(y,x) -reg int x, y; +static int +findcells(int y, int x) { reg int rtpos, i; @@ -236,8 +242,7 @@ */ static char * -foffset(y, x) -int y, x; +foffset(int y, int x) { return (maze_frontier + (y * maze_cols) + x); @@ -251,8 +256,7 @@ */ bool -maze_view(y, x) -int y, x; +maze_view(int y, int x) { register int start, goal, delta, ycheck = 0, xcheck = 0, absy, absx, see_radius; register bool row; @@ -360,8 +364,7 @@ */ static char * -moffset(y, x) -int y, x; +moffset(int y, int x) { return (maze_bits + (y * (cols - 1)) + x); } @@ -371,8 +374,8 @@ * Removes appropriate walls from the maze */ static -rmwall(newy, newx, oldy, oldx) -int newy, newx, oldy, oldx; +void +rmwall(int newy, int newx, int oldy, int oldx) { reg int xdif,ydif;