1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2001,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2001,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
… | |
… | |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | */ |
22 | */ |
23 | |
23 | |
24 | #ifndef RANDOM_MAP_H |
24 | #ifndef RANDOM_MAP_H |
25 | #define RANDOM_MAP_H |
25 | #define RANDOM_MAP_H |
|
|
26 | |
|
|
27 | #include "util.h" |
26 | |
28 | |
27 | struct random_map_params |
29 | struct random_map_params |
28 | { |
30 | { |
29 | char wallstyle[512]; |
31 | char wallstyle[512]; |
30 | char wall_name[512]; |
32 | char wall_name[512]; |
… | |
… | |
122 | // 12 has been experimentally :( determined ot be a lot more stable |
124 | // 12 has been experimentally :( determined ot be a lot more stable |
123 | // than 11 or 10, leading to the assumption that something inherently |
125 | // than 11 or 10, leading to the assumption that something inherently |
124 | // needs a minimum size of at least 12 |
126 | // needs a minimum size of at least 12 |
125 | #define MIN_RANDOM_MAP_SIZE 12 |
127 | #define MIN_RANDOM_MAP_SIZE 12 |
126 | |
128 | |
|
|
129 | struct MazeData : zero_initialised |
|
|
130 | { |
|
|
131 | char **col; |
|
|
132 | |
|
|
133 | MazeData (int xsize, int ysize); |
|
|
134 | ~MazeData (); |
|
|
135 | |
|
|
136 | operator char **() |
|
|
137 | { |
|
|
138 | return col; |
|
|
139 | } |
|
|
140 | }; |
|
|
141 | |
|
|
142 | struct Maze |
|
|
143 | { |
|
|
144 | MazeData *ptr; |
|
|
145 | |
|
|
146 | Maze () |
|
|
147 | { |
|
|
148 | } |
|
|
149 | |
|
|
150 | Maze (int xsize, int ysize) |
|
|
151 | : ptr (new MazeData (xsize, ysize)) |
|
|
152 | { |
|
|
153 | } |
|
|
154 | |
|
|
155 | Maze (random_map_params *RP) |
|
|
156 | : ptr (new MazeData (RP->Xsize, RP->Ysize)) |
|
|
157 | { |
|
|
158 | } |
|
|
159 | |
|
|
160 | void free () |
|
|
161 | { |
|
|
162 | delete ptr; |
|
|
163 | } |
|
|
164 | |
|
|
165 | operator char **() |
|
|
166 | { |
|
|
167 | return *ptr; |
|
|
168 | } |
|
|
169 | }; |
|
|
170 | |
127 | #endif |
171 | #endif |
128 | |
172 | |