summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libw32c.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/libw32c.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/libw32c.cc')
-rw-r--r--crawl-ref/source/libw32c.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc
index c111aa5251..2797568046 100644
--- a/crawl-ref/source/libw32c.cc
+++ b/crawl-ref/source/libw32c.cc
@@ -559,11 +559,12 @@ void textcolor(int c)
void clear_message_window()
{
- PCHAR_INFO pci = screen + SCREENINDEX(0, VIEW_EY);
+ PCHAR_INFO pci = screen + SCREENINDEX(crawl_view.msgp.x - 1,
+ crawl_view.msgp.y - 1);
const int ncols = get_number_of_cols();
for (int x = 0; x < ncols; x++)
{
- for (int y = 0; y < get_message_window_height(); y++)
+ for (int y = 0; y < crawl_view.msgsz.y; y++)
{
pci->Char.AsciiChar = ' ';
pci->Attributes = 0;
@@ -574,39 +575,37 @@ void clear_message_window()
COORD source;
SMALL_RECT target;
- source.X = 0;
- source.Y = VIEW_EY;
- target.Left = 0;
- target.Top = VIEW_EY;
+ source.X = crawl_view.msgp.x - 1;
+ source.Y = crawl_view.msgp.y - 1;
+ target.Left = crawl_view.msgp.x - 1;
+ target.Top = crawl_view.msgp.y - 1;
target.Right = get_number_of_cols() - 1;
target.Bottom = get_number_of_lines() - 1;
WriteConsoleOutput(outbuf, screen, screensize, source, &target);
}
-extern int get_message_window_height();
static void scroll_message_buffer()
{
- memmove( screen + SCREENINDEX(0, VIEW_EY),
- screen + SCREENINDEX(0, VIEW_EY + 1),
- get_message_window_height() * get_number_of_cols()
- * sizeof(*screen) );
+ memmove( screen + SCREENINDEX(crawl_view.msgp.x - 1, crawl_view.msgp.y - 1),
+ screen + SCREENINDEX(crawl_view.msgp.x - 1, crawl_view.msgp.y),
+ crawl_view.msgsz.y * get_number_of_cols() * sizeof(*screen) );
}
static void scroll_message_window()
{
SMALL_RECT scroll_rectangle, clip_rectangle;
- scroll_rectangle.Left = 0;
- scroll_rectangle.Top = VIEW_EY + 1;
+ scroll_rectangle.Left = crawl_view.msgp.x - 1;
+ scroll_rectangle.Top = crawl_view.msgp.y;
scroll_rectangle.Right = get_number_of_cols() - 1;
scroll_rectangle.Bottom = get_number_of_lines() - 1;
clip_rectangle = scroll_rectangle;
- clip_rectangle.Top = VIEW_EY;
+ clip_rectangle.Top = crawl_view.msgp.y - 1;
COORD new_origin;
- new_origin.X = 0;
- new_origin.Y = VIEW_EY;
+ new_origin.X = crawl_view.msgp.x;
+ new_origin.Y = crawl_view.msgp.y - 1;
CHAR_INFO fill;
fill.Char.AsciiChar = ' ';
@@ -629,7 +628,8 @@ void message_out(int which_line, int colour, const char *s, int firstcol,
if (!firstcol)
firstcol = Options.delay_message_clear? 2 : 1;
- gotoxy(firstcol, which_line + VIEW_EY + 1);
+ gotoxy(firstcol - 1 + crawl_view.viewp.x,
+ which_line + crawl_view.viewp.y);
textcolor(colour);
cprintf("%s", s);