dungeon.cc autopads one square around labyrinth minivaults.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1618 c06c8d41-db1a-0410-9941-cceddc491573
ITUTGFJ56GR7FWMC5Y7XKUJJ4Z35I6BMOHCPCW3W5MKDQGVOGM4AC
56C44YMFHZ62GXAAOLYSLLGBVGRWXB53W2VI37Q26ZECEK2XG5SQC
JDM27QE4HR52AYFSQE763BFF57ANOTF5MXKMO377PP5EXMN7SAOAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
MSQI3TH6T62JAXQGLL52QZCWAMC372TGB6ZNNRDGUGMJKBNNV2VAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
EOMCPVNQLX3IMLC46EAO67DPBH5KEG2FQTPBLGU62HIRWA3UQ7XQC
GVCGKTH5IJ4VSQEIN4CRC7ZFVZW26JPIYNCPTO7GY66CSZZEW3ZQC
static void pad_region(const dgn_region ®, int pad_depth,
dungeon_feature_type feat)
{
const coord_def pstart = reg.pos - pad_depth;
const coord_def pend = reg.pos + reg.size + pad_depth;
const coord_def end = reg.pos + reg.size - 1;
for (int y = pstart.y; y < pend.y; ++y)
{
for (int x = 1; x <= pad_depth; ++x)
{
const coord_def c1(x + end.x, y);
safe_set_feature(c1, feat);
const coord_def c2(reg.pos.x - x, y);
safe_set_feature(c2, feat);
}
}
for (int x = end.x; x >= reg.pos.x; --x)
{
for (int y = 1; y <= pad_depth; ++y)
{
const coord_def c1(x, y + end.y);
safe_set_feature(c1, feat);
const coord_def c2(x, reg.pos.y - y);
safe_set_feature(c2, feat);
}
}
}