summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-24 04:00:10 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-24 04:00:10 +0000
commitcc6d8cbcbc57396500d87731f6742fb6317aa1c2 (patch)
tree09acb6b707a0216dfaa78642850052e7e76c2fc9
parent4bc8fa481841a89bd2b6880f7570824478048ca1 (diff)
downloadcrawl-ref-cc6d8cbcbc57396500d87731f6742fb6317aa1c2.tar.gz
crawl-ref-cc6d8cbcbc57396500d87731f6742fb6317aa1c2.zip
Fixing Tiles targeting and mouse cursor behavior.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6658 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/cio.cc7
-rw-r--r--crawl-ref/source/cmd-keys.h2
-rw-r--r--crawl-ref/source/cmd-name.h4
-rw-r--r--crawl-ref/source/directn.cc4
-rw-r--r--crawl-ref/source/enum.h6
-rw-r--r--crawl-ref/source/tilesdl.cc6
6 files changed, 12 insertions, 17 deletions
diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc
index 64ec293350..fe4bbf23ac 100644
--- a/crawl-ref/source/cio.cc
+++ b/crawl-ref/source/cio.cc
@@ -173,10 +173,9 @@ int c_getch()
void cursorxy(int x, int y)
{
#if defined(USE_TILE)
-#if 0
- // TODO enne - handle this old use of place cursor
- tile_place_cursor(x-1, y-1, true);
-#endif
+ coord_def ep(x, y);
+ coord_def gc = view2grid(ep);
+ tiles.place_cursor(CURSOR_MOUSE, gc);
#elif defined(UNIX)
if (Options.use_fake_cursor)
fakecursorxy(x, y);
diff --git a/crawl-ref/source/cmd-keys.h b/crawl-ref/source/cmd-keys.h
index cfeb71b1c9..abe9c486ff 100644
--- a/crawl-ref/source/cmd-keys.h
+++ b/crawl-ref/source/cmd-keys.h
@@ -157,9 +157,7 @@
{CK_MOUSE_MOVE, CMD_MOUSE_MOVE},
{CK_MOUSE_CLICK, CMD_MOUSE_CLICK},
-#ifdef USE_TILE
{CK_MOUSE_MOVE, CMD_TARGET_MOUSE_MOVE},
{CK_MOUSE_CLICK, CMD_TARGET_MOUSE_SELECT},
-#endif
{'\0', CMD_NO_CMD}
diff --git a/crawl-ref/source/cmd-name.h b/crawl-ref/source/cmd-name.h
index a044f5152a..5ed02439ba 100644
--- a/crawl-ref/source/cmd-name.h
+++ b/crawl-ref/source/cmd-name.h
@@ -184,10 +184,10 @@
{CMD_TARGET_WIZARD_GIVE_ITEM, "CMD_TARGET_WIZARD_GIVE_ITEM"},
{CMD_TARGET_WIZARD_MOVE, "CMD_TARGET_WIZARD_MOVE"},
{CMD_TARGET_WIZARD_PATHFIND, "CMD_TARGET_WIZARD_PATHFIND"},
-{CMD_TARGET_HELP, "CMD_TARGET_HELP"},
-#ifdef USE_TILE
{CMD_TARGET_MOUSE_MOVE, "CMD_TARGET_MOUSE_MOVE"},
{CMD_TARGET_MOUSE_SELECT, "CMD_TARGET_MOUSE_SELECT"},
+{CMD_TARGET_HELP, "CMD_TARGET_HELP"},
+#ifdef USE_TILE
{CMD_EDIT_PLAYER_TILE, "CMD_EDIT_PLAYER_TILE"},
#endif
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 31ea6df734..4e9ce1daf3 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -561,6 +561,7 @@ void direction(dist& moves, targeting_type restricts,
}
cursor_control con(!Options.use_fake_cursor);
+ mouse_control mc(MOUSE_MODE_TARGET);
int dir = 0;
bool show_beam = Options.show_beam && !just_looking && needs_path;
@@ -642,7 +643,6 @@ void direction(dist& moves, targeting_type restricts,
}
else
{
- mouse_control mc(MOUSE_MODE_TARGET);
key_command = beh->get_command();
}
@@ -2733,8 +2733,6 @@ targeting_behaviour::~targeting_behaviour()
int targeting_behaviour::get_key()
{
- mouse_control mc(MOUSE_MODE_TARGET_DIR);
-
if (!crawl_state.is_replaying_keys())
flush_input_buffer(FLUSH_BEFORE_COMMAND);
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 099cd925fd..c68cc8d488 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -619,14 +619,14 @@ enum command_type
CMD_TARGET_WIZARD_GIVE_ITEM,
CMD_TARGET_WIZARD_MOVE,
CMD_TARGET_WIZARD_PATHFIND,
+ CMD_TARGET_MOUSE_MOVE,
+ CMD_TARGET_MOUSE_SELECT,
CMD_TARGET_HELP,
CMD_MAX_TARGET = CMD_TARGET_HELP,
#ifdef USE_TILE
- CMD_TARGET_MOUSE_MOVE,
- CMD_MIN_TILE = CMD_TARGET_MOUSE_MOVE,
- CMD_TARGET_MOUSE_SELECT,
CMD_EDIT_PLAYER_TILE,
+ CMD_MIN_TILE = CMD_EDIT_PLAYER_TILE,
CMD_MAX_TILE = CMD_EDIT_PLAYER_TILE,
#endif
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index a78f6bbf60..5b97e4d4b5 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -580,9 +580,9 @@ int TilesFramework::getch_ck()
}
}
- bool show_tooltip =
- ((ticks - m_last_tick_moved > Options.tile_tooltip_ms)
- && ticks > m_last_tick_moved);
+ bool show_tooltip = ((ticks - m_last_tick_moved
+ > (unsigned int)Options.tile_tooltip_ms)
+ && ticks > m_last_tick_moved);
if (show_tooltip)
{