ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/snake.C
(Generate patch)

Comparing deliantra/server/random_maps/snake.C (file contents):
Revision 1.10 by root, Sun May 4 14:12:37 2008 UTC vs.
Revision 1.19 by root, Sat Nov 17 23:40:02 2018 UTC

1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 *
4 * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team
5 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
6 * Copyright (©) 1994-2004 Crossfire Development Team (restored, original file without copyright notice)
7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the Affero GNU General Public License
19 * and the GNU General Public License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
21 *
22 * The authors can be reached via e-mail to <support@deliantra.net>
23 */
1 24
2/* peterm@langmuir.eecs.berkeley.edu: this function generates a random 25/* peterm@langmuir.eecs.berkeley.edu: this function generates a random
3snake-type layout. 26snake-type maze.
4 27
5input: xsize, ysize; 28input: xsize, ysize;
6output: a char** array with # and . for closed and open respectively. 29output: a char** array with # and . for closed and open respectively.
7 30
8a char value of 0 represents a blank space: a '#' is 31a char value of 0 represents a blank space: a '#' is
9a wall. 32a wall.
10 33
11*/ 34*/
12 35
13#include <global.h> 36#include <global.h>
14#include "random_map.h" 37#include <rmg.h>
15#include "rproto.h" 38#include "rproto.h"
16 39
17void 40void
18make_snake_layout (Layout maze, int options) 41make_snake_layout (layout &maze, int options)
19{ 42{
20 int i, j; 43 int i, j;
21 44
22 maze->clear (); 45 maze.clear ();
23 maze->border (); 46 maze.border ();
24 47
25 int xsize = maze->w; 48 int xsize = maze.w;
26 int ysize = maze->h; 49 int ysize = maze.h;
27 50
28 /* Bail out if the size is too small to make a snake. */ 51 /* Bail out if the size is too small to make a snake. */
29 if (xsize < 8 || ysize < 8) 52 if (xsize < 8 || ysize < 8)
30 return; 53 return;
31 54

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines