… | |
… | |
110 | void |
110 | void |
111 | layout::fill_rand (int percent) |
111 | layout::fill_rand (int percent) |
112 | { |
112 | { |
113 | percent = lerp (percent, 0, 100, 0, 256); |
113 | percent = lerp (percent, 0, 100, 0, 256); |
114 | |
114 | |
115 | for (int x = w - 1; --x > 0; ) |
115 | for (int x = 0; x < w; ++x) |
116 | for (int y = h - 1; --y > 0; ) |
116 | for (int y = 0; y < h; ++y) |
117 | data [x][y] = rmg_rndm (256) > percent ? 0 : '#'; |
117 | data [x][y] = rmg_rndm (256) > percent ? 0 : '#'; |
118 | } |
118 | } |
119 | |
119 | |
120 | ///////////////////////////////////////////////////////////////////////////// |
120 | ///////////////////////////////////////////////////////////////////////////// |
121 | |
121 | |
… | |
… | |
701 | |
701 | |
702 | return -1; |
702 | return -1; |
703 | } |
703 | } |
704 | |
704 | |
705 | int |
705 | int |
706 | make_wall (char **maze, int x, int y, int dir) |
706 | make_wall (layout &maze, int x, int y, int dir) |
707 | { |
707 | { |
708 | maze[x][y] = 'D'; /* mark a door */ |
708 | maze[x][y] = 'D'; /* mark a door */ |
709 | |
709 | |
710 | switch (dir) |
710 | switch (dir) |
711 | { |
711 | { |