summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-27 12:33:29 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-27 12:33:29 +0000
commitd6a80fc099249eb2e9d759b92e0e248e5a925256 (patch)
tree829bc3e9d7f3b52fa0c48f5ae9b63ca62e7fb6a1 /crawl-ref/source/mapdef.cc
parentc0a429f1bbb20357589acce9fba2b85306927bca (diff)
downloadcrawl-ref-d6a80fc099249eb2e9d759b92e0e248e5a925256.tar.gz
crawl-ref-d6a80fc099249eb2e9d759b92e0e248e5a925256.zip
remember_name was broken, fixed.
Colour overlays were not being rotated/mirrored, fixed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2231 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r--crawl-ref/source/mapdef.cc30
1 files changed, 29 insertions, 1 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index 7fdd14cb08..f56b6dbe05 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -508,9 +508,9 @@ std::string map_lines::parse_weighted_colours(const std::string &cspec,
lowercase(col);
int weight = find_weight(col);
-
if (weight == TAG_UNFOUND)
{
+ weight = 10;
// :number suffix?
std::string::size_type cpos = col.find(':');
if (cpos != std::string::npos)
@@ -973,6 +973,16 @@ void map_lines::rotate(bool clockwise)
newlines.push_back(line);
}
+ if (colour_overlay.get())
+ {
+ std::auto_ptr< Matrix<int> > new_overlay(
+ new Matrix<int>( lines.size(), map_width ) );
+ for (int i = xs, y = 0; i != xe; i += xi, ++y)
+ for (int j = ys, x = 0; j != ye; j += yi, ++x)
+ (*new_overlay)(x, y) = (*colour_overlay)(i, j);
+ colour_overlay = new_overlay;
+ }
+
map_width = lines.size();
lines = newlines;
rotate_markers(clockwise);
@@ -1032,6 +1042,15 @@ void map_lines::vmirror()
lines[i] = lines[size - 1 - i];
lines[size - 1 - i] = temp;
}
+
+ if (colour_overlay.get())
+ {
+ for (int i = 0; i < midpoint; ++i)
+ for (int j = 0, wide = width(); j < wide; ++j)
+ std::swap( (*colour_overlay)(j, i),
+ (*colour_overlay)(j, size - 1 - i) );
+ }
+
vmirror_markers();
solid_checked = false;
}
@@ -1049,6 +1068,15 @@ void map_lines::hmirror()
s[map_width - 1 - j] = c;
}
}
+
+ if (colour_overlay.get())
+ {
+ for (int i = 0, size = lines.size(); i < size; ++i)
+ for (int j = 0; j < midpoint; ++j)
+ std::swap( (*colour_overlay)(j, i),
+ (*colour_overlay)(map_width - 1 - j, i) );
+ }
+
hmirror_markers();
solid_checked = false;
}