--- deliantra/server/random_maps/layout.C 2010/07/06 20:00:46 1.26 +++ deliantra/server/random_maps/layout.C 2018/12/01 20:22:13 1.35 @@ -1,31 +1,32 @@ /* * 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 (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team + * 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 +77,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 +93,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 +105,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 +118,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 +131,7 @@ ///////////////////////////////////////////////////////////////////////////// // erode by cellular automata -void noinline +ecb_noinline void layout::erode_1_2 (int c1, int c2, int repeat) { layout neu (w, h); @@ -154,7 +155,7 @@ { 2, -1, 0 }, { 2, 0, 0 }, { 2, 1, 0 }, }; - for (int i = array_length (dds); i--; ) + for (int i = ecb_array_length (dds); i--; ) { int nx = x + dds [i][0]; int ny = y + dds [i][1]; @@ -206,7 +207,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 +278,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 +536,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 +639,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; }