summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-16 17:08:25 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-16 17:08:25 +0000
commitd9c3bbc745678ed811c87f0c8b28b9ee385ba406 (patch)
treee9e7db158fdd8d2a328ade37cb0ca223b87113ae /crawl-ref/source/directn.cc
parentd43e71a2423bb56d0ffe71d14093414e57e89ecb (diff)
downloadcrawl-ref-d9c3bbc745678ed811c87f0c8b28b9ee385ba406.tar.gz
crawl-ref-d9c3bbc745678ed811c87f0c8b28b9ee385ba406.zip
Speed up mouse movements when targeting. It's still on the slowish side
but now the cursor might actually win that slug race. :p I hope I haven't inadvertently broken anything else. Tested for a variety of cases, and everything worked fine. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@9985 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index eaeb19075f..15a174c59a 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -1027,7 +1027,8 @@ void direction(dist& moves, targeting_type restricts,
}
cursor_control con(!Options.use_fake_cursor);
- mouse_control mc(MOUSE_MODE_TARGET);
+ mouse_control mc(needs_path && !just_looking ? MOUSE_MODE_TARGET_PATH
+ : MOUSE_MODE_TARGET);
range_view_annotator rva(range);
int dir = 0;
@@ -1130,18 +1131,19 @@ void direction(dist& moves, targeting_type restricts,
if (key_command == CMD_TARGET_MOUSE_SELECT)
{
key_command = CMD_TARGET_SELECT;
-
+// Do we really need this? (jpeg)
+// Looks like the redrawing routine already handles it.
+#if 0
if (needs_path && range > 0)
{
ray_def raycopy = ray;
int l = 0;
- while (raycopy.pos() != moves.target && l < range)
- {
- l++;
+ while (raycopy.pos() != moves.target && range > l++)
raycopy.advance_through(moves.target);
- }
+
moves.target = raycopy.pos();
}
+#endif
}
}
else
@@ -1176,8 +1178,8 @@ void direction(dist& moves, targeting_type restricts,
}
bool need_beam_redraw = false;
- bool force_redraw = false;
- bool loop_done = false;
+ bool force_redraw = false;
+ bool loop_done = false;
coord_def old_target = moves.target;
if (skip_iter)