summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libunix.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/libunix.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/libunix.cc')
-rw-r--r--crawl-ref/source/libunix.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc
index 79f91d17b7..b9d9342e92 100644
--- a/crawl-ref/source/libunix.cc
+++ b/crawl-ref/source/libunix.cc
@@ -234,10 +234,8 @@ static void handle_hangup(int)
static WINDOW *Message_Window;
static void setup_message_window()
{
- extern int get_message_window_height();
-
- Message_Window = newwin( get_message_window_height(), get_number_of_cols(),
- VIEW_EY, 0 );
+ Message_Window = newwin( crawl_view.msgsz.y, crawl_view.msgsz.x,
+ crawl_view.msgp.y - 1, crawl_view.msgp.x - 1 );
if (!Message_Window)
{
fprintf(stderr, "Unable to create message window!");
@@ -258,8 +256,6 @@ void clear_message_window()
void message_out(int which_line, int color, const char *s, int firstcol,
bool newline)
{
- extern int get_message_window_height();
-
wattrset( Message_Window, curs_fg_attr(color) );
if (!firstcol)
@@ -269,7 +265,7 @@ void message_out(int which_line, int color, const char *s, int firstcol,
mvwaddstr(Message_Window, which_line, firstcol, s);
- if (newline && which_line == get_message_window_height() - 1)
+ if (newline && which_line == crawl_view.msgsz.y - 1)
{
int x, y;
getyx(Message_Window, y, x);
@@ -282,7 +278,7 @@ void message_out(int which_line, int color, const char *s, int firstcol,
{
int x, y;
getyx(Message_Window, y, x);
- move(y + VIEW_EY, x);
+ move(y + crawl_view.msgp.y - 1, crawl_view.msgp.x - 1 + x);
}
wrefresh(Message_Window);
@@ -327,6 +323,7 @@ void unixcurses_startup( void )
scrollok(stdscr, TRUE);
+ crawl_view.init_geometry();
setup_message_window();
}