|
|
1 | /* |
|
|
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
|
|
3 | * |
|
|
4 | * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
|
|
5 | * Copyright (©) Crossfire Development Team (restored, original file without copyright notice) |
|
|
6 | * |
|
|
7 | * Deliantra is free software: you can redistribute it and/or modify it under |
|
|
8 | * the terms of the Affero GNU General Public License as published by the |
|
|
9 | * Free Software Foundation, either version 3 of the License, or (at your |
|
|
10 | * option) any later version. |
|
|
11 | * |
|
|
12 | * This program is distributed in the hope that it will be useful, |
|
|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
15 | * GNU General Public License for more details. |
|
|
16 | * |
|
|
17 | * You should have received a copy of the Affero GNU General Public License |
|
|
18 | * and the GNU General Public License along with this program. If not, see |
|
|
19 | * <http://www.gnu.org/licenses/>. |
|
|
20 | * |
|
|
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
|
|
22 | */ |
1 | |
23 | |
2 | /* peterm@langmuir.eecs.berkeley.edu: this function generates a random |
24 | /* peterm@langmuir.eecs.berkeley.edu: this function generates a random |
3 | blocked maze with the property that there is only one path from one spot |
25 | blocked maze with the property that there is only one path from one spot |
4 | to any other, and there is always a path from one spot to any other. |
26 | to any other, and there is always a path from one spot to any other. |
5 | |
27 | |
… | |
… | |
23 | /* global variables that everyone needs: don't want to pass them in |
45 | /* global variables that everyone needs: don't want to pass them in |
24 | as parameters every time. */ |
46 | as parameters every time. */ |
25 | static int *wall_x_list = 0; |
47 | static int *wall_x_list = 0; |
26 | static int *wall_y_list = 0; |
48 | static int *wall_y_list = 0; |
27 | static int wall_free_size = 0; |
49 | static int wall_free_size = 0; |
28 | |
|
|
29 | /* heuristically, we need to change wall_chance based on the size of |
|
|
30 | the maze. */ |
|
|
31 | |
|
|
32 | static int wall_chance; |
|
|
33 | |
50 | |
34 | /* the free wall points are those outer points which aren't corners or |
51 | /* the free wall points are those outer points which aren't corners or |
35 | near corners, and don't have a maze wall growing out of them already. */ |
52 | near corners, and don't have a maze wall growing out of them already. */ |
36 | static void |
53 | static void |
37 | make_wall_free_list (int xsize, int ysize) |
54 | make_wall_free_list (int xsize, int ysize) |