summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--crawl-ref/source/AppHdr.h2
-rw-r--r--crawl-ref/source/acr.cc8
-rw-r--r--crawl-ref/source/initfile.cc2
-rw-r--r--crawl-ref/source/mapdef.cc30
4 files changed, 36 insertions, 6 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index 6a67709cc7..115a51186d 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -219,7 +219,9 @@
// Startup preferences are saved by player name rather than uid,
// since all players use the same uid in dgamelaunch.
+ #ifndef DGL_NO_STARTUP_PREFS_BY_NAME
#define DGL_STARTUP_PREFS_BY_NAME
+ #endif
// Increase the size of the topscores file for public servers.
#define SCORE_FILE_ENTRIES 1000
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 1419e6348b..2d35510bb4 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -224,10 +224,6 @@ int main( int argc, char *argv[] )
// now parse the args again, looking for everything else.
parse_args( argc, argv, false );
- // read the options the player used last time they created a new
- // character.
- read_startup_prefs();
-
if (Options.sc_entries != 0 || !SysEnv.scorefile.empty())
{
hiscores_print_all( Options.sc_entries, Options.sc_format );
@@ -3298,6 +3294,10 @@ static bool initialise(void)
{
Options.fixup_options();
+ // read the options the player used last time they created a new
+ // character.
+ read_startup_prefs();
+
you.symbol = '@';
you.colour = LIGHTGREY;
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 3a32320755..69598807d7 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -1582,7 +1582,7 @@ void game_options::read_option_line(const std::string &str, bool runscript)
}
}
}
-#ifndef DGAMELAUNCH
+#if !defined(DGAMELAUNCH) || defined(DGL_REMEMBER_NAME)
else if (key == "name")
{
// field is already cleaned up from trim_string()
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;
}