summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-04 06:53:25 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-04 06:53:25 +0000
commita75a924ca5f67336d9e065ab307d976c4cd8fabc (patch)
tree052710fb2cac216521e398e8774426092426bf41 /crawl-ref/source/player.cc
parentb53b7421dc0bda8dc3a4713cad64a6275132261c (diff)
downloadcrawl-ref-a75a924ca5f67336d9e065ab307d976c4cd8fabc.tar.gz
crawl-ref-a75a924ca5f67336d9e065ab307d976c4cd8fabc.zip
[1699948] Allow changing the viewport size if you're using a larger terminal
than 80x24. Also allow moving the PC around the viewport without scrolling the viewport if the viewport is large enough. This is not tested on DOS and Windows yet. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1524 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 2542bf2da0..175db38a74 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -221,8 +221,7 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
}
// have to move now so fall_into_a_pool will work
- you.x_pos = x;
- you.y_pos = y;
+ you.moveto(x, y);
viewwindow( true, false );
@@ -271,8 +270,7 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
}
// move the player to location
- you.x_pos = x;
- you.y_pos = y;
+ you.moveto(x, y);
viewwindow( true, false );
@@ -3248,7 +3246,7 @@ void redraw_skill(const char your_name[kNameLen], const char class_name[80])
print_it[40] = 0;
- gotoxy(40, 1);
+ gotoxy(crawl_view.hudp.x, 1);
textcolor( LIGHTGREY );
cprintf( "%s", print_it );
@@ -5253,3 +5251,17 @@ bool player::is_icy() const
{
return (attribute[ATTR_TRANSFORMATION] == TRAN_ICE_BEAST);
}
+
+void player::moveto(int x, int y)
+{
+ x_pos = x;
+ y_pos = y;
+ crawl_view.set_player_at(coord_def(x, y));
+}
+
+void player::moveto(const coord_def &c)
+{
+ x_pos = c.x;
+ y_pos = c.y;
+ crawl_view.set_player_at(c);
+}