--- deliantra/server/random_maps/layout.C 2010/07/05 01:57:55 1.25 +++ deliantra/server/random_maps/layout.C 2018/11/17 23:33:18 1.33 @@ -1,31 +1,31 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. - * - * Copyright (©) 2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * Copyright (©) Crossfire Development Team (restored, original file without copyright notice) - * + * + * Copyright (©) 2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 1994-2004 Crossfire Development Team (restored, original file without copyright notice) + * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the Affero GNU General Public License * and the GNU General Public License along with this program. If not, see * . - * + * * The authors can be reached via e-mail to */ #include -#include +#include #include -void noinline +ecb_noinline void layout::alloc (int w, int h) { assert (sizeof (cell) == 1); @@ -76,14 +76,14 @@ sfree ((char *)data, size); } -void noinline +ecb_noinline void layout::fill (char fill) { //memset (data [0], fill, w * h); // only when contiguous :/ fill_rect (0, 0, w, h, fill); } -void noinline +ecb_noinline void layout::replace (char from, char to) { for (int x = 0; x < w; ++x) @@ -92,7 +92,7 @@ data [x][y] = to; } -void noinline +ecb_noinline void layout::rect (int x1, int y1, int x2, int y2, char fill) { --x2; @@ -104,7 +104,7 @@ data [x1][y1] = data [x1][y2 - 1] = fill; } -void noinline +ecb_noinline void layout::fill_rect (int x1, int y1, int x2, int y2, char fill) { for (; x1 < x2; ++x1) @@ -117,7 +117,7 @@ rect (0, 0, w, h, fill); } -void noinline +ecb_noinline void layout::fill_rand (int percent) { percent = lerp (percent, 0, 100, 0, 256); @@ -130,7 +130,7 @@ ///////////////////////////////////////////////////////////////////////////// // erode by cellular automata -void noinline +ecb_noinline void layout::erode_1_2 (int c1, int c2, int repeat) { layout neu (w, h); @@ -206,7 +206,7 @@ typedef fixed_stack pointlist; -static void noinline +ecb_noinline static void push_flood_fill (layout &dist, pointlist &seeds, int x, int y) { if (dist [x][y]) @@ -277,7 +277,7 @@ // isolation remover, works on a "distance" map // the map must be initialised with 0 == rooms, 255 = walls -static void noinline +ecb_noinline static void isolation_remover (layout &dist, unsigned int perturb = 2) { // dist contains @@ -535,7 +535,7 @@ * 4 match on (i+1, j+1) * and the possible combinations thereof. */ -static int noinline +ecb_noinline static int calc_pattern (char ch, layout &maze, int i, int j) { int pattern = 0; @@ -638,8 +638,8 @@ for (int j = 0; j < h; j++) switch (data [i][j]) { - case '#': expand_wall (new_layout, i, j, *this); break; - case 'D': expand_door (new_layout, i, j, *this); break; + case '#': expand_wall (new_layout, i, j, *this); break; + case 'D': expand_door (new_layout, i, j, *this); break; default: expand_misc (new_layout, i, j, *this); break; } @@ -1015,6 +1015,7 @@ demo () { rmg_rndm.seed (time (0)); + extern void hack();hack (); for(int i=1;i<100;i++) {