right of each pane. The HUD bits are overwritten by the hud display, but as the comment notes:
// Doesn't work for HUD because print_stats() overwrites it.
// To debug HUD, add viewwindow(false,false) at end of _prep_input.
Add checks that no panes extend beyond the term size, or all the way to the term bottom. (Bottom line is not available unless we can keep the screen from scrolling when we write to it)
Fix a bunch of off-by-one errors. Using a point vs vector metaphor seems to flush them out nicely (hooray for affine math!)
There are still problems with the monster list resizing too big and squishing the main map view – didn't address any of that.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3959 c06c8d41-db1a-0410-9941-cceddc491573
QJR4HINDRTZC7FMV6V27HBPBSLCAKBGPSMH34WPVNPRPKWXVVEOAC
24IYVB5D2PTO6RJHVWDRSIYRVNDWDGGWI4YCYVUDIXY5MRZ4OJEQC
5BJPWUPLJFS34FUTFJVKA4A52YMIGV6EWDXLNSDCWBJWBGVSQFGQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
WT66JDIRTLLP37SHTV4GI3V64JFJ4D25LNRLGCHFG6CLEFKJ3QGQC
EOMCPVNQLX3IMLC46EAO67DPBH5KEG2FQTPBLGU62HIRWA3UQ7XQC
4UQBOVCMAMNCCF6PPX222H6JJO7MPYOKKC2NBKMVYIT5R5FOACNAC
FWVE7KM7BGEZUFQVM7H7UFGM3QMMPT7QHLNXSP62HG3SMBIPZBSQC
W6IY6LF3MREPXC23AAKA2BJNUCJYCSOWY55DIWJWFLUEE2Y3LGNQC
}
static void _debug_pane_bounds()
{
#if DEBUG_PANE_BOUNDS
// Doesn't work for HUD because print_stats() overwrites it.
// To debug HUD, add viewwindow(false,false) at end of _prep_input.
cgotoxy(1,1, GOTO_MLIST);
cprintf("+ L");
cgotoxy(crawl_view.mlistsz.x-4, crawl_view.mlistsz.y, GOTO_MLIST);
cprintf("L +");
cgotoxy(1,1, GOTO_STAT);
cprintf("+ H");
cgotoxy(crawl_view.hudsz.x-3, crawl_view.hudsz.y, GOTO_STAT);
cprintf("H +");
cgotoxy(1,1, GOTO_MSG);
cprintf("+ M");
cgotoxy(crawl_view.msgsz.x-2, crawl_view.msgsz.y, GOTO_MSG);
cprintf("M +");
cgotoxy(crawl_view.viewp.x, crawl_view.viewp.y);
cprintf("+V");
cgotoxy(crawl_view.viewp.x+crawl_view.viewsz.x-2,
crawl_view.viewp.y+crawl_view.viewsz.y-1);
cprintf("V+");
#endif
mlistp = coord_def(1, 1);
mlistsz = coord_def(mlist_max_width, viewsz.y);
mlistsz.x = std::min(mlist_min_width + freewidth, mlistsz.x);
mlistp = termp;
const int _mlist_max_width = mlist_max_width; // work around link problem?
mlistsz.x = std::min(mlist_min_width + freewidth, _mlist_max_width);
mlistsz.y = viewsz.y;
msgp = coord_def(1, viewsz.y + 1);
msgsz = coord_def(termsz.x, termsz.y - viewsz.y);
// Always from lhs of term to rhs of term
msgp.x = termp.x;
msgsz.x = termsz.x;
// From bottom of mlist or view, whichever is lower, to bottom of term
msgp.y = std::max((mlistp+mlistsz).y, (viewp+viewsz).y);
msgsz.y = termsz.y - (msgp-termp).y;
// Well, actually not to the very bottom. Drawing the last line causes
// the screen to scroll. If this is fixed, we get another line of message.
msgsz.y -= 1;
#ifndef USE_TILE
// Check that all the panes fit in the view. Note that currently
// no pane is allowed to stretch all the way to the bottom (see
// comment by message pane calculation, above.
ASSERT( (viewp+viewsz-termp).x <= termsz.x );
ASSERT( (viewp+viewsz-termp).y <= termsz.y-1 );
ASSERT( (hudp+hudsz-termp).x <= termsz.x );
ASSERT( (hudp+hudsz-termp).y <= termsz.y-1 );
ASSERT( (msgp+msgsz-termp).x <= termsz.x );
ASSERT( (msgp+msgsz-termp).y <= termsz.y-1 );
ASSERT( (mlistp+mlistsz-termp).x <= termsz.x );
ASSERT( (mlistp+mlistsz-termp).y <= termsz.y-1 );
#endif